AVG - Average Aggregate1 / 10
AVG is an aggregate function that returns the average of a specified column. To get the average ticket price, try:
SELECT AVG(ticket_price) FROM flights;| flight_id | airline | route | ticket_price | duration_minutes |
|---|---|---|---|---|
| 1 | Delta | NYC-LAX | 320 | 360 |
| 2 | United | NYC-ORD | 210 | 150 |
| 3 | American | NYC-MIA | 260 | 180 |
| 4 | JetBlue | NYC-BOS | 120 | 60 |
| 5 | Southwest | NYC-DEN | 280 | 300 |
Ctrl+Enter to submit
AVG - Average Aggregate - Free SQL Practice Online
Practise AVG - Average Aggregate with 10 free, interactive SQL exercises. You type real queries into your browser and get instant feedback on every answer - no database setup, no install, and no signup. It is a fast, hands-on way to learn SQL online and build query skills you can use at work.