Fall 2024 - CS403P - 2
Fall 2024 - CS403P - 2
Instructions:
Please read the following instructions carefully before solving & submitting the assignment solution:
It should be clear that your assignment will not get any credit (zero marks) if:
Objectives:
GOOD LUCK
Virtual University of Pakistan 2
Task: You are required to execute a single SQL command satisfying the following requirements i.e., A single
SQL query should fulfill all the requirements.
1. Find all the unique sender cities from which packages have been shipped.
2. Find all packages that were not delivered by van.
3. Find all packages that were shipped between Mar 01 st, 2024 and Mar 29th, 2024 (inclusive). Follow the
order date as YYY-MM-DD.
4. Find all delivered packages, ordered by their delivery date, with the most recent deliveries appearing first.
Note: Don’t write separate commands. All the four requirements should be met in single SQL Query.
Virtual University of Pakistan 3
Employees Table
EmployeeI FirstNa LastNa DepartmentI Salar
D me me D y
1 John Smith 1 6000
0
2 Jane Doe 2 7500
0
3 David Lee 1 6500
0
4 Sarah Jones 3 8000
0
5 Michael Brown NULL 5500
0
Departments Table
DepartmentI DepartmentName Location
D
1 Sales New York
2 Marketing London
3 Engineering Paris
Task: You are required to write down the SQL query to Retrieve names and their respective departments of all
the employees. You should also show the output table of the query. Remember, we don't want to include
employees who might have null value (for Department ID).