DISCLAIMER: ANSI SQL (The SQL that's used universally) includes everything taught in this section. However, some of the syntax shown will vary between your Relational Database Management Service (RDBMS).
Welcome to the last Beginner-level tutorial! To finish off the basics, we will learn how to write clean SQL and
best practices about formatting code. In this tutorial, we will cover how to write the cleanest SQL queries possible.
select name as product_name, AVG(price) as avg_price from products group by name;
SELECT name AS product_name, AVG(price) AS avg_price FROM customers GROUP BY name;
SELECT name AS product_name, AVG(price) AS avg_price FROM customers GROUP BY name;
SELECT name AS productName, AVG(price) AS avgPrice FROM customers GROUP BY name;
SELECT name AS product_name, AVG(price) AS avg_price
FROM customers
GROUP BY name;