Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

SQL Practice Questions

The document provides a set of SQL practice questions based on the COMPANY database schema. It includes queries to retrieve employee information based on various criteria, such as department, project involvement, and dependents. The schema outlines the structure of the Employee, Department, Project, Works_On, Dept_Location, and Dependent tables.

Uploaded by

jsanthoshithota
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

SQL Practice Questions

The document provides a set of SQL practice questions based on the COMPANY database schema. It includes queries to retrieve employee information based on various criteria, such as department, project involvement, and dependents. The schema outlines the structure of the Employee, Department, Project, Works_On, Dept_Location, and Dependent tables.

Uploaded by

jsanthoshithota
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL - Practice Questions

Use COMPANY database schema and specify following queries in SQL.

1. Retrieve the names of all employees in department 5 who work more than 10 hours per
week on the ProductX project.

2. List the names of all employees who have a dependent with the same first name as
themselves.

3. Find the names of all employees who are directly supervised by ‘Franklin Wong’.

4. For each project, list the project name and the total hours per week (by all employees)
spent on that project.

5. Retrieve the names of all employees who work on every project.

6. Retrieve the names of all employees who do not work on any project.

7. For each department, retrieve the department name and the average salary of all
employees working in that department.

8. Retrieve the average salary of all female employees.

9. Find the names and addresses of all employees who work on at least one project located
in Houston but whose department has no location in Houston.

10. List the last names of all department managers who have no dependents.

***

COMPANY Database Schema

Employee (FName, LName, SSN, BDate, Address, Gender, Salary, SuperSSN, DNo)

Department (DName, DNo, MgrSSN, MgrStartDate)

Project(PName, PNo, PLocation, DNo)

Works_On (SSN, PNo, Hours)

Dept_Location (Dno, DLocation)

Dependent (Essn, Dependent_name, Gender, Bdate, Relationship)

You might also like