Calculate Average Product Price Using AVG Function
📖 Scenario: You work in a small store that sells different products. You want to find out the average price of all products to understand the general pricing.
🎯 Goal: Build a simple database table of products with their prices and write a query to calculate the average price using the AVG function.
📋 What You'll Learn
Create a table called
products with columns id, name, and priceInsert exactly three products with given prices
Write a query to calculate the average price of all products using the
AVG functionUse an alias
average_price for the average value in the query result💡 Why This Matters
🌍 Real World
Stores and businesses often need to analyze average prices to set competitive pricing or understand sales trends.
💼 Career
Knowing how to use aggregate functions like AVG is essential for data analysts, database administrators, and anyone working with data to summarize information quickly.
Progress0 / 4 steps