Multiple choice technology databases

SELECT count(*),status_id,status_name FROM kcrt_statuses WHERE STATUS_ID IN (SELECT STATUS_ID FROM kcrt_request_type_statuses) GROUP BY status_id; What will be the output?

  1. Returns the count of rows grouped by statuses

  2. Error - Incorrect use of COUNT. It has to have a column name.

  3. Error - because of the GROUP BY Clause or Selected columns

  4. Does not return the count, just displays the other two fields.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The query selects status_name, but status_name is not listed in the GROUP BY clause. In standard SQL, any non-aggregated column in the SELECT list must be included in the GROUP BY clause, which causes a syntax error.