Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. all project names 2. unique project locations 3. all works on data 4. all wor

ID: 3671942 • Letter: 1

Question

1. all project names

2. unique project locations

3. all works on data

4. all works on data for more than 17 hours

5. all department numbers with a Houston department location

6. all employee information for employees who have a dependent

7. employee last name, first name, and department name for female employees

8. employee last name and project name for employees who have at least one dependent and work on a project at least 17 hours.

9. employee last names for employees who do not work on any projects.

10. employee last names who have a child the same sex as they are.

11. employee last names for employees who do not have a child of the same sex as themselves

Part 2: Interpret the following SQL Queries:

1. select pnumber, dnum, lname, bdate

from projects, department, employee

where dnum = dnumber and mgrssn = ssn

and plocation = 'Stafford'

2. (select lname from employee) except

(select lname from employee, dependent

where ssn = essn)

EMPLOYEE Fname Minit Lname Ssn Bdate Address S Sex Salary Super_ssn Dno DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT LOCATIONS Dnumber Dlocation PROJECT Pname Pnumber PlocationDnum WORKS ON Essn Pno Hours DEPENDENT Essn Dependent name Sex Bdate Relationship

Explanation / Answer

Project(Pname, Pnumber, Plocation, Dnumber);

1. All project names: SELECT Pname from Project;

2. Unique project locations: SELECT distinct(Plocation) from Project;

Works_On(Essn, Pno, Hours);

3. All Works_on data: SELECT * from Works_On;

4. All Works_on data for more than 17 hours: SELECT * from Works_On WHERE Hours > 17;