MYSQL: QUERIES (correct please) 1. Produce a listing: custName, No_of_orders, av
ID: 3772512 • Letter: M
Question
MYSQL: QUERIES (correct please)
1. Produce a listing: custName, No_of_orders, avg_order_amt, where the middle column is the total number of orders for the customer and the last column is the average order amount for that customer. HINT: Use column aliases to get the column headings listed above to display for the output. Also, this requires two aggregate functions to be listed in the SELECT clause.
2.. List the orders that were shipped between January 2003 and December 2003.
3. Find the customerID, customer name, orderID and total value of the order for those orders that have not been shipped. HINT: Orders that have not been shipped have a NULL value for the shipDate.
4. Update the shipDate for orderID 10007 to today’s date.
Meta data:
Explanation / Answer
Can help u with this any help needed pls comment
1.
Select c.cname as custName, sum(o.orderID) as No_of_orders, avg(i.price) as avg_order_amtFrom Customer c, Item iJoin Order_ oOn o.customerID = c.customerID and o.itemID = i.itemID;2.
3.
Select c.customerID, c.cname, o.orderIDFrom Order_ oJoin Customer cOn c.customerID = o.customerIDWhere o.orderDate = Null;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.