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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started