SELECT MaritalStatus, AVG(NetworthInMillions) FROM Actors GROUP BY MaritalStatus ORDER BY MaritalStatus ASC;
if you execute the last example in this section, the result is:
+---------------+-------------------------+
| MaritalStatus | AVG(NetworthInMillions) |
+---------------+-------------------------+
| Married | 409.6667 |
| Divorced | 570.0000 |
| Single | 195.0000 |
+---------------+-------------------------+
Since we are ordered by <MaritalStatus> ASC, should Divorced come before Married (because D comes before M)?
Course: https://www.educative.io/courses/introductory-guide-to-sql
Lesson: GROUP BY - An Introductory Guide to SQL