0% found this document useful (0 votes)
58 views3 pages

BA - SQL Assignment Dec 2024

The document outlines the creation of three tables: Sales_Data, Product_Details, and Customer_Details, with specified fields and sample data. It also includes four SQL query tasks to extract specific customer and sales information based on the provided tables. The queries focus on customer order history, identifying bestsellers, analyzing first-time online purchasers, and determining top spenders in a specified city.

Uploaded by

omc.msdsm01
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)
58 views3 pages

BA - SQL Assignment Dec 2024

The document outlines the creation of three tables: Sales_Data, Product_Details, and Customer_Details, with specified fields and sample data. It also includes four SQL query tasks to extract specific customer and sales information based on the provided tables. The queries focus on customer order history, identifying bestsellers, analyzing first-time online purchasers, and determining top spenders in a specified city.

Uploaded by

omc.msdsm01
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

Create 3 tables with the following details:

1. Sales_Data: order_id, SKUs bought (multiple comma separated values), price, discount,
order_date, customer_id, order_city, channel_type (can be either ‘online’/’offline’ only)

(Note: SKUs should be alpha-numeric codes for products belonging in 2 categories, steel
starting with ST and ceramic starting with CR)

2. Product_Details: SKU, MRP, product_name

3. Customer_Details: customer_id, name, phone_number, email

Please populate the data with sample data that can be downloaded online.

Solve the following questions by writing queries with respect to the above tables:

1. Name and list the details of all customers who have placed multiple orders and have
purchased a ceramic item at least once.
2. Find the most expensive bestseller
3. For all customers who have purchased for the first time online, calculate the average
number of times they purchase offline in a month
4. List the top 7 spenders in Y city (here Y should be a user-input variable)

You might also like