Page 1 of 1

Oracle Assignment :S

Posted: Sun Apr 04, 2010 10:29 am
by jpoisson
So in my DB class we are working in oracle and ffor being an introductry course it is getting pretty intense.

Code: Select all

Sample Question:
--Question s) Find the name of the customer with the oldest vehicle. Show also the year of the vehicle

	SELECT * FROM (
		SELECT DISTINCT(FirstName || ' ' || LastName) AS Name, Year
		FROM Customer, Vehicle
		WHERE Customer.CustNo = Vehicle.CustNo
		ORDER BY Year
	) 
	WHERE ROWNUM <=1;

As you can see that is my answer to the question. It took me several hours to figure it out but I did. Now I have stumbled upon some other questions that don't seem to be as extensive but are just as mind boggling. I will let everyone know how I am Doing with the assignment. I think I have 5 or 6 questions left. but they are hurting my head. maybe I need a break for a little while.

Re: Oracle Assignment :S

Posted: Mon Apr 12, 2010 9:54 am
by MAruz
Ouch, at least you can take your time, and try out different approaches, should be glad it's not an exam...

We had our first exam in oracle a few weeks ago too, multiple choice. You get served a question (often together with a select query or a create table query), and then 5 options where one is correct (or should be, we did find questions where none of the 5 options were correct >_< )

I got a B on this, so I'm happy :)
The test had some traps in it too, some were more obvious than others:
SELECT * FROM table;
WHERE year > 1999;
Easy to miss that semi-colon after table and presume only some of the rows gets selected, but all rows are, then you encounter a loose where sentence.
SELECT * FROM table, table;
This one had me puzzled during the exam, I had no idea if this was legal or not, and of course no way of testing if it was...

And of course I had to mix up the union, intersect, minus and join mechanics, so I got a few wrong answers there too.

Re: Oracle Assignment :S

Posted: Fri Apr 16, 2010 6:58 pm
by jpoisson
Yea my midterm test was tricky too. but he had us practically write out by hand about 50 different sql statements and 5 ERD's. Now my exam is around the corner I feel confident that I may do well but their is always doubt in my head.