Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> 2 SQL test questions
I just returned from taking the SQL & PL/SQL exam. (Passed - Whew!)
Two questions puzzle me. Maybe someone else has an idea of the correct answers:
1.Create a report that will show net profit per product if the cost is increased 10% and the sale price is increased 25%. The product table follows
Products table
Id number(3) pk
Sale number (8,2)
Cost number (8,2)
Given the query:
Select id, sale * 1.25 - cost * 1.1 net From products;
Which happens:
I was stuck between a & c. The query should work, but it would be
better with a NVL function in case some
rows have a null for cost or sale. What is your take?
2. Mr King is President of the company. Four managers report to him and all other employees report to these four managers.
The query:
select e.name
from emp e
where e.id not in
(select m.mgr from emp m);
returns 'no rows selected' Why?
Any ideas?
Thanks,
Claudia
Received on Tue Nov 14 2000 - 15:37:52 CST
![]() |
![]() |