Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

What are the six n1ain types of occupational orientation?

Answered: 1 week ago