3
sql
-- View all client orders
SELECT *
FROM client_orders;
-- Find the average order total
SELECT AVG(order_total)
FROM client_orders;
-- Get the highest order amount
SELECT MAX(order_total)
FROM client_orders;
-- Get the smallest order amount
SELECT MIN(order_total)
FROM client_orders;
-- Combine all three into a summary
SELECT AVG(order_total) AS avg_order,
MAX(order_total) AS highest_order,
MIN(order_total) AS lowest_order
FROM client_orders;
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.