Project Orders (SQLite & MYSQL)
Project Orders (SQLite & MYSQL)
You are hired by a chain of online retail stores “Reliant retail limited”. They provided you
with “orders” database and seek answers to the following queries as the results from
these queries will help the company in making data driven decisions that will impact the
overall growth of the online retail store.
1st part- Q1-Q6 comes under SQLite and queries should be executed in DB Browser. (Database
- Orders.db)
2nd part- Q7-Q10 comes under MYSQL and the queries should be executed in MYSQL. (SQL
Script
-orders.sql)
All Questions carry 8 marks. Total Marks (8 x 10) = 80
show 'Low stock', 11 <= qty <= 30, show 'In stock', >= 31, show 'Enough
stock'
b. For Stationery and Clothes categories, if qty <= 20, show 'Low stock', 21
<= qty <= 80, show 'In stock', >= 81, show 'Enough stock'
c. Rest of the categories, if qty <= 15 – 'Low Stock', 16 <= qty <= 50 – 'In
3. Write a query to Show the count of cities in all countries other than USA & MALAYSIA,
with more than 1 city, in the descending order of CITIES. (2 rows) [NOTE: ADDRESS
TABLE, Do not use Distinct]
6. Write a query to display the customer_id,customer name, email and order details
(order id, product desc,product qty, subtotal(product_quantity * product_price)) for
all customers even if they have not ordered any item.(225 ROWS)
[NOTE: TABLE TO BE USED - online_customer, order_header, order_items, product]
Part-2(MYSQL)
7. Write a query to display carton id, (len*width*height) as carton_vol and identify the
optimum carton (carton with the least volume whose volume is greater than the total
volume of all items (len * width * height * product_quantity)) for a given order whose
order id is 10006, Assume all items of an order are packed into one single carton
(box). (1 ROW) [NOTE: CARTON TABLE]
shipped order.
other than USA? Also show the total value of those items.
(1 ROWS)[NOTE:PRODUCT TABLE,ADDRESS
TABLE,ONLINE_CUSTOMER TABLE,ORDER_HEADER
TABLE,ORDER_ITEMS TABLE,PRODUCT_CLASS TABLE]