What does the GROUP BY clause do in a MySQL query?
Correct answer
C. Group rows together based on a shared value.
16 views
C. Group rows together based on a shared value.
16 views
GROUP BY groups rows that share the same value in one or more columns into summary rows. It is almost always used with aggregate functions: SELECT city, COUNT(*) FROM users GROUP BY city; returns one row per city.
Sorting is done by ORDER BY, filtering rows by WHERE, and filtering groups by HAVING.
Practise more Database Management Systems MCQs with answers and explanations on MCQsExam.com.
Not sure why the answer is C? Ask here and get an explanation.