Calculate Average Sales Using AVG Function
📖 Scenario: You work at a small store that keeps track of daily sales in a database table. You want to find out the average sales amount to understand how well the store is doing on average each day.
🎯 Goal: Build a SQL query that calculates the average sales amount from the sales data using the AVG function.
📋 What You'll Learn
Create a table called
sales with columns day and amount.Insert the exact sales data for 5 days into the
sales table.Write a SQL query that uses the
AVG function to find the average sales amount.Complete the query to return the average sales with the column name
average_sales.💡 Why This Matters
🌍 Real World
Calculating averages is common in business to understand typical performance, such as average sales, average customer ratings, or average expenses.
💼 Career
Knowing how to use the AVG function and filter data with WHERE is essential for data analysts, database administrators, and anyone working with data to generate meaningful insights.
Progress0 / 4 steps