Oracle Assignment :S

Keep it clean but fun.
Post Reply
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Oracle Assignment :S

Post 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.
User avatar
MAruz
Posts: 117
Joined: Fri Nov 20, 2009 12:31 pm

Re: Oracle Assignment :S

Post 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.
PHP, Java, JavaScript, HTML, CSS, XML, MySQL / Oracle
Photoshop, Illustrator
www.cuddly-zombie.com
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Re: Oracle Assignment :S

Post 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.
Post Reply

Return to “Off-Topic”