Topic 03

Basic Aggregations

Aggregates perform a calculation on a set of values and return a single value. These are almost always used with GROUP BY in real interviews.

💡 Interview Question

Question: “Calculate the total number of orders and the average order value from the sales table.”


Correct Answer:

SELECT COUNT(order_id), AVG(order_amount) FROM sales;
Next: Intermediate Joins →