2
sql
-- View all clients
SELECT * FROM clients;
-- Count how many clients are in the database
SELECT COUNT(*) FROM clients;
-- Count how many clients have provided their email
SELECT COUNT(email) FROM clients;
-- View all clients orders
SELECT * FROM client_orders;
-- Calculate the total order amount across all orders
SELECT SUM(order_total) FROM client_orders;
-- Show both client count and total order value in one query
SELECT COUNT(*) AS total_clients, SUM(order_total) AS total_revenue
FROM client_orders;
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.