Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with writing these SQL statements: 1. Print the names of employees for each department which has fewer than 4 employees. 2. Find
I need help with writing these SQL statements:
1. Print the names of employees for each department which has fewer than 4 employees.
2. Find the names of employees who have worked on project 2 but not on project 3.
3. Find the names of employees who worked on project 2 and project 3.
4.Find the SSN's of each employee who works on every project that John Smith works on.
EMPLOYEE FNAME MINIT LNAME SSN BOATE ADDRESS SEX SALARY SUPEASSN DNO DEPARTMENT ONAME ONUMBER MGRSON MGASTARTDATE DEPT_LOCATIONS DNUMBER DLOCATION PROJECT PNAME PNUMDER PLOCATION ONUM WORKS ON ESSN PNO HOURS DEPENDENT ESSN PEPENDENT.NAME SEX BDATE RELATIONSHIP EMPLOYEE FNAME MINIT T J . Neha Franklin Alicia Jennifer Ramesh Joyce Ahmad James S K LNAME Smith Wong Zelaya Wallace Narayan English Jabbar Borg SSN 123456789 333445555 999887777 907654321 666804444 453453453 987987987 888665555 BDATE 09-JAN-55 00-DEC-45 19-JUL-58 20-JUN-31 15-SEP-52 31-JUL-62 29-MAR-59 10-NOV-27 ADDRESS 731 Fondron, Houston, TX 638 Voss, Houston, TX 3321 Castle, Spring, TX 291 Berry, Bellaire, TX 975 Fire Oak, Humble, TX 5631- Rice, Houston, TX 980 Dallas, Houston, TX 450 Stone, Houston, TX SEX SALARY M . 30000 M 40000 F 25000 F 43000 M 38000 F 25000 M 25000 M 55000 SUPERSSN DNO 333445555 5 888665555 5 987654321 4 888665555 4 333445555 5 333445555 5 987654321 4 null 1 A V E DEPT LOCATIONS ONUMOER PARTMENT DNUMBER 5 DNAME Research Administration Headquarters MGASSN 333445555 987654321 688665555 MGRSTAATDATE 22-MAY-78 01 JAN-86 19-JUN-71 1 4 5 5 5 DLOCATION Houston Stafford Beliaire Sugarland Houston 4 1 PROJECT PNUMBER ORKS ON ESSN 123456789 123456789 066884444 453453453 453453463 333446555 333445555 333445555 333445555 999887777 999887777 987987987 987907987 987654321 987654321 888665555 PNO 1 2 3 1 2 2 3 10 20 30 10 10 30 30 20 20 HOURS 32.5 7.5 40.0 20.0 20.0 10.0 10.0 10.0 10.0 30.0 10.0 35.0 5.0 20.0 15.0 nult PNAME ProductX ProductY Productz Computerization Reorganization Newbenefits 1 2 3 PLOCATION DNUM Bellaire 5 Sugarland 5 Houston 5 Stafford 4 Houston 1 Stafford 10 20 30 ENDENT ESSN 333445555 333445555 333445555 987654321 123456789 123456789 123456789 DEPENDENT NAME Alice Theodore Joy Abner Michael Alice Elizabeth SEX F M F M M F BDATE 05-APA-76 25-OCT-73 03-MAY-49 29-FEB-32 01-JAN-78 31-DEC-78 05-MAY-57 RELATIONSHIP DAUGHTER SON SPOUSE SPOUSE SON DAUGHTER SPOLIC FStep 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