Lab Task: 05
Course Code: CL2005
Course Title: Database Systems - Lab
Semester: Spring 2026
Instructor: Muhammad Mehdi
Email: [Link]@[Link]
Guidelines
● Please review the lab manual before starting the task to ensure you fully understand the
requirements.
● You may use only the concepts covered in the lab manual to complete this task.
● Your submission must be a single PDF file that includes:
● The source code (in plain text)
● Screenshots of the corresponding outputs
● Name your file using the following format: rollno_name_labtasknumber.pdf
Example: 24p-1234_ozair_labtask05.pdf
● Unethical use of AI tools will result in a deduction of 5 marks.
● Late submissions will incur a penalty of -1 mark per day.
Tasks
You are provided with a SQL script file named [Link], which contains SQL
statements to create and populate the required tables using a simplified, dataset based on
E-commerce applications.
The complete schema of the database, consisting of all tables and the relationships among them is
described in the given ER Diagram:
1
Database Systems - Lab
Create a database in SQLite and execute the given script file with the .read command to load the
provided dataset. After successfully setting up the database, perform the following SQL queries:
1. List all orders with the customer's full name and order date.
2. Show all products with their category name.
3. List order items with product name and quantity.
4. Show all payments with corresponding customer names.
5. Show total amount spent by each customer.
6. List customers who have placed more than one order.
7. Show total revenue generated by each product.
8. Find the most expensive product purchased in any order.
2
Database Systems - Lab
9. List all customers and their orders (include customers with no orders).
10.List all products and show if they were ever ordered.
11.Show all suppliers and products (include suppliers without products).
12.FULL JOIN customers and payments to show unpaid orders and orphan payments.
13.Find products supplied by suppliers from the same country (self-join suppliers).
14.Find the top 3 customers by total spending.
15.For each month, show total sales revenue.
3
Database Systems - Lab