MODULE: DATABASE DESIGN AND DEVELOPMENT PRACTICAL CASE STUDY
PROGRAME: DATA SCIENCE 1 & BOS 1
To be collected on: 19/06/2024 through your class representatives
INSTRUCTIONS: 1. Answer all questions
2. Marks are allocated at the end of each question.
3. collect both softcopies (word docs) and Hard copies (printed docs)
4. copy and paste your correct sql queries after proving they are returning the
correct results.
CASE STUDY: TECHSTORE E-COMMERCE DATABASE
Introduction
TechStore is an online retailer that sells various electronic products. The company wants to analyze
its sales data to improve business strategies. They have provided you with a database containing
information about their sales transactions. The database is the file called [Link] which is
attached to this case study.
Tasks:
1. Import the database into your phpMyAdmin environment (3)
2. How many tables are there in the database? (2)
3. Write a query to count the total number of sales transactions recorded in the ‘Sales’ table (2)
4. Write a query to calculate the average total amount of sales transactions from the ‘Sales’ table (2)
5. Write a query to group the sales transactions by product_id and calculate the total quantity sold for
each product. (2)
6. Write a query to group the sales transactions by customer_id and calculate the average total amount
spent by each customer. (2)
7. Write a query to group the sales transactions by customer_id and calculate the average total amount
spent by each customer. Then, filter the results to show only those customers who have an average
spending of more than $100. (2)