Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the query in SQL: List the lname, ssn of employees who work on either pno=10 or pno=20: a) Write this using a single block

Write the query in SQL: List the lname, ssn of employees who work on either pno=10 or pno=20: a) Write this using a single block query b) Write this using the keyword join in the FROM clause c) Write this as a nested query using the in predicate d) Write this as a nested query using a quantified predicate containing '=' e) Write this as a correlated nested query using the exists predicate f) Write this using a set operation g) Write this using a nested query in the FROM clause

The database is as follows:

image text in transcribed

EMPLOYEE | FNAME | MINIT |LNAME | SSN SEX SALARY | SUPERSSN DNO Smith 123456789 1965-01-09 333445555 638 Voss, Houston, TX 987654321 Wallace 9876543211941-06-20 975 Fire Oak, Humble, TX 5631 Rice, Houston, TX 980 Dallas, Houston, TX 450 Stone, Houston, TX Narayan 453453453 1972-07-31 987987987 1969-03-29 333445555 Jabbar 987654321 Borg DEPT LOCATIONS DNAME Research DNUMBER MGRSSN MGRSTARTDATE 1988-05-22 995-01-01 1981-06-19 DEPARTMENT Headquarters WORKS ON ESSNPNO HOURS 123456789 53453453 PROJECT PNAME PNUMBER PLOCATION DNUM 987987987 987987987 ESSN I DEPENDENT NAME SEX BDATE RELATIONSHIP Theodore 1983-10-25 1958-05-03 1942-02-28 1988-01-04 SPOUSE EMPLOYEE | FNAME | MINIT |LNAME | SSN SEX SALARY | SUPERSSN DNO Smith 123456789 1965-01-09 333445555 638 Voss, Houston, TX 987654321 Wallace 9876543211941-06-20 975 Fire Oak, Humble, TX 5631 Rice, Houston, TX 980 Dallas, Houston, TX 450 Stone, Houston, TX Narayan 453453453 1972-07-31 987987987 1969-03-29 333445555 Jabbar 987654321 Borg DEPT LOCATIONS DNAME Research DNUMBER MGRSSN MGRSTARTDATE 1988-05-22 995-01-01 1981-06-19 DEPARTMENT Headquarters WORKS ON ESSNPNO HOURS 123456789 53453453 PROJECT PNAME PNUMBER PLOCATION DNUM 987987987 987987987 ESSN I DEPENDENT NAME SEX BDATE RELATIONSHIP Theodore 1983-10-25 1958-05-03 1942-02-28 1988-01-04 SPOUSE

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

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

1. Is it a topic you are interested in and know something about?

Answered: 1 week ago