0% found this document useful (0 votes)
28 views1 page

BA - SQL Assignment

The document outlines the creation of three tables: Sales_Data, Product_Details, and Customer_Details, with specified fields and sample data requirements. It also includes four SQL query tasks related to customer orders, bestselling products, purchase frequency, and top spenders based on user input for a city. The queries aim to extract insights from the populated data in the tables.

Uploaded by

SAI DINESH KN
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)
28 views1 page

BA - SQL Assignment

The document outlines the creation of three tables: Sales_Data, Product_Details, and Customer_Details, with specified fields and sample data requirements. It also includes four SQL query tasks related to customer orders, bestselling products, purchase frequency, and top spenders based on user input for a city. The queries aim to extract insights from the populated data in the tables.

Uploaded by

SAI DINESH KN
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/ 1

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 bestselling product.
3. For all customers whose first ever purchase was from online, calculate the average number
of times they purchase from 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