Seeing the Big Picture: SUM, AVG, and COUNT
Learn how to count rows and take the sum and average of data.
Step 1: Start with a question
So far, you’ve been exploring individual rows—every employee, every record. Now let’s think bigger.
What if you asked: What’s the total salary cost for the company?
Instead of listing all employees, you want a single number, the total sum of all salaries.
Prompt: Write a SQL query that calculates the total of all salaries from the employees table.
Powered by AI
5 Prompts Remaining
Step 2: Run and observe
AI will likely produce:
Run it. You’ll see a single number.
Reflect:
One row now represents the whole dataset.
SUM()added up all ...