Resolved: I am getting an error when submitting the 2 codes in the exercise
Please, execute the following command:
set @@global.sql_mode := replace(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', '');
Then, you have to restart the Workbench in order to save the new settings.
Thanks for reaching out.
Please, use the code provided by Muhammad. Then, you have to restart the Workbench in order to save the new settings.
Hope this helps.
Hello, please why does the code provided by Muhammad need to be executed first in his workbench?
The issue with your query is that you're using the AVG function in the SELECT clause without properly grouping the other columns. When you use an aggregate function like AVG with a GROUP BY clause, you should only include columns in the SELECT clause that are either part of the grouping or used with an aggregate function.