0% found this document useful (0 votes)
4 views

SQL Practical 8 (1)

This document outlines practical exercises related to Database Management Systems, focusing on SQL queries for various tasks such as retrieving employee names, project descriptions, and time assignments. Each exercise includes a query prompt and space for output, covering topics like joins, intersections, and aggregations. The exercises are designed to enhance understanding of database querying techniques.

Uploaded by

sanjaygpatel19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

SQL Practical 8 (1)

This document outlines practical exercises related to Database Management Systems, focusing on SQL queries for various tasks such as retrieving employee names, project descriptions, and time assignments. Each exercise includes a query prompt and space for output, covering topics like joins, intersections, and aggregations. The exercises are designed to enhance understanding of database querying techniques.

Uploaded by

sanjaygpatel19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Database Management

Systems

Practical :- 8

Er. No :-
Name:-
Prepared By :- Foram Gohel
Database Management Systems

Prepared
By :- Foram Gohel
Database Management Systems
1. Find the names of all people who work in the Consulting department.
Query:

Output:

2. Find the names of all people who work in the Consulting department and
who spend more than 20% of their time on the project with ID ADT4MFIA.
Query:

Output:

3. Find the totalpercentage of time assignedtoemployee Abe Advice.


Query:
Output:

4. Find the descriptions of all projectsthat require more than 70% of an


employee’stime.
Query:

Output:

5. For each employee, list the employee ID, number of projects, and the total
percentage of time for the current projects to which she is assigned. Include
employees not assigned to any project.

Query:

Output:

6. Find the description of all projects with no employees assignedtothem.


Note: Left outer join is the sameasleft join in SQL.
Query:
Output:

7. For each project, find the greatest percentage oftime assignedtoan


employee. Note: nvl function replaces assigned timewith in the query
if itis null.
Query:

8. For each employee ID, find the last name of all employees making
more money than that employee.
Query:

Output:
9. Rank the projects by revenue.
Query:

Output:

10. Find all dates on which projects either started or ended. Eliminate any
duplicate or NULL dates. Sort your results in descending order.
Query:

Output:

11. Use INTERSECT tofind the first and last name of all employees who both
work on the Robotic Spouse and for the Hardwaredepartment.
Query:

Output:

12. Use MINUS to find the first and last name of all employees who work on
the Robotic Spouse but not for theHardwaredepartment.
Query:

13. Find the first and last name of all employees who work on the Download
Client project but not the Robotic Spouse project.
Query:

Prepared By :- Foram Gohel


Database Management Systems

14. Find the first and last name of all employees who work on the Download
Client project and the Robotic Spouse project.

Query:
Output:

15. Find the first and last name of all employees who work on the Download
Client project or the Robotic Spouse project.
Query:

Output:

16. Find the first and last name of all employees who work on the Download
Client project or the Robotic Spouse project but not both.
Query:

17. Using MINUS, find all of the departments without any projects.
Query:

You might also like