Challenge

Project 2

Write a query to find the average order value for all Customers.

SELECT AVG (purch_amt) FROM orders;

3.Query your database to find the sum of all orders received in this month

SELECT COUNT(OrderID)
FROM Order WHERE month = "november";

4.Query your database to find customers count in various cities, group them by names of cities

SELECT city, COUNT(ID)
FROM customer
GROUP BY city;

5.Query your database to get all the sellers who have base in the same city in which the customers who ordered their products. Order them in the order of highest number of products sold to customers in same city to lowest.

SELECT customer_id , MAX(order_price) AS HighestPurchase
FROM customer_order_details
GROUP BY customer_id
ORDER BY MAX(order_price) DESC

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.