0% found this document useful (0 votes)
10 views2 pages

cs403p Assignment 2

Gg

Uploaded by

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

cs403p Assignment 2

Gg

Uploaded by

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

Name: Muhammad Zeeshan Ur Rehman

Student ID: BC230412209

Subject CS403p

Assignment 2

Question 1:

single SQL command that meets all the requirements:

SELECT DISTINCT SenderCity, PackageID, SenderCity,


RecipientCity, ShippingDate, DeliveryDate, Weight, Status,
VehicleType

FROM Packages

WHERE VehicleType != 'Van'

AND ShippingDate BETWEEN '2024-03-01' AND '2024-03-29'

AND Status = 'Delivered'

ORDER BY DeliveryDate DESC;

Question 2:

The SQL statement that can be used to find all employees names and their
relative departments, without including employees with NULL DepartmentID,
is:

SELECT DISTINCT SenderCity, PackageID, SenderCity,


RecipientCity, ShippingDate, DeliveryDate, Weight, Status,
VehicleType

FROM Packages

WHERE VehicleType != 'Van'

AND ShippingDate BETWEEN '2024-03-01' AND '2024-03-29'


AND Status = 'Delivered'

ORDER BY DeliveryDate DESC;

Output table of the query:

FirstName LastName DepartmentName

John Smith Sales

Jane Doe Marketing

David Lee Sales

Sarah Jones Engineering

You might also like