Project 1
ER Diagram for e commerce is in the attached file:-
Answer of Task 1 and Task 2 is also in the attached file:
Task 3:-
Q1. Answer : -
select * from customer order by city;
Q2. Answer : -
alter table Products rename column Product_id to prod_Product_id;
alter table Products rename column SellerId to prod_SellerId;
alter table Products rename column CategoryName to prod_CategoryName;
alter table Products rename column ProductName to prod_ProductName;
alter table Products rename column ProductColor to prod_ProductColor;
alter table Products rename column ProductSize to prod_ProductSize;
alter table Products rename column ProductCost to prod_ProductCost;
Q3. Answer : -
select * from customer where customer_history > 1;
Q4. Answer : -
select customer.Name, Orders.OrderId, Orders.Order_Status from customer inner join Orders on customer.customer_id = Orders.customer_id where customer.Name like "a%a" and Orders.ProductQuantity > 1;
Q5. Answer : -
select customer.Name, Orders.OrderId, Orders.Order_Status, Orders.ProductQuantity as Quantity, Orders.totalCost as Order_Cost from customer inner join Orders on customer.customer_id = Orders.customer_id where Orders.Order_Status="delivered" and Orders.totalCost>10000 and Orders.OrderId having OrderId > 1;
Q6. Answer : -
given in the attached file :