RE:cord

[SQL] AVG / GROUP BY / ORDER BY DESC 본문

SQL

[SQL] AVG / GROUP BY / ORDER BY DESC

beie 2024. 11. 22. 13:55

<1>

SELECT AVG(no_of_likes) FROM fb_posts;

 

 

<2>

SELECT education, AVG(salary) FROM google_salaries GROUP BY education;

 

 

<3>

SELECT * FROM movie_catalogue ORDER BY duration DESC;

 

* Ascending: ORDER BY column / ORDER BY column ASC

* Descending: ORDER BY column DESC