Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the SQL table creation script below, create a SQL query that SELF-JOINS the table fac to itself, showing the fid, fname, rank and salary

Given the SQL table creation script below, create a SQL query that SELF-JOINS the table fac to itself, showing the fid, fname, rank and salary of everyone with a rank of 'ASSO',or 'INST' that have a greater salary than ANY of the 'FULL' faculty members. NOTE: don't look for the average salary of either group, just if anyone in 'ASSO','INST' makes more than 'FULL' and DON'T use a GROUP BY:

drop table fac;

CREATE TABLE fac (fid NUMBER, fname VARCHAR2(30), ext NUMBER(9), dept VARCHAR2(5), rank VARCHAR2(10), salary NUMBER(7,2) ); INSERT INTO fac VALUES(036, 'BARGES', 325, 'MGT','ASSO',35000);

INSERT INTO fac VALUES(117, 'JARDIN', 212, 'FIN','FULL',33000);

INSERT INTO fac VALUES(098, 'KENNEDY',176, 'ACC', 'ASSO',30000);

INSERT INTO fac VALUES(075, 'SAMPLE', 171,'MKT','ASST', 25000);

INSERT INTO fac VALUES(138, 'WARD', 125,'MGT','INST', 20000);

INSERT INTO fac VALUES(219, 'PETERS', 220,'FIN','FULL', 45000);

INSERT INTO fac VALUES(151, 'DARDIN', 250,'ACC','ASSO', 37000);

INSERT INTO fac VALUES(138, 'SAMPLE', 205,'MGT','INST', 22000);

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago