Question: I need help writing a few SQL queries/codes. I'll post them below! Using ROWNUM to limit the size of the result. (Notice that SQL and
I need help writing a few SQL queries/codes. I'll post them below!
Using ROWNUM to limit the size of the result. (Notice that SQL and some systems use the LIMIT or TOP clauses. Oracle uses ROENUM to accomplish similar tasks.)
1) DENSE RANK query ... compare with the previous query. Find the dense rank of the salary 31000 among all salaries. Hint: The dense ranks in this database are 1 for 25000, 2 for 30000, 3 for 38000, and so on.
2)
HIERARCHICAL query (uses START WITH and CONNECT BY PRIOR)
Find pairs of SSN's such that the first SSN in the pair is that of an employee while the second SSN in the pair is that of his/her supervisor. Start with SSN 453453453.
Hint: The output of your query should be:
453453453 333445555
333445555 888665555
888665555 -
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
