Based on table CLUB, which SQL query will display earliest and latest DOJ…
2017
Based on table CLUB, which SQL query will display earliest and latest DOJ under each TYPE?


- A.
SELECT MIN(DOJ), MAX(DOJ) FROM CLUB;
- B.
SELECT MIN(DOJ), MAX(DOJ) FROM CLUB GROUP BY TYPE;
- C.
SELECT MIN(DOJ), MAX(DOJ), TYPE FROM CLUB GROUP BY TYPE;
- D.
SELECT MIN(DOJ), MAX(DOJ), TYPE GROUP BY TYPE FROM CLUB;
Attempted by 1277 students.
Show answer & explanation
Correct answer: C
Correct answer: SELECT TYPE, MIN(DOJ), MAX(DOJ) FROM CLUB GROUP BY TYPE;
What this does: groups rows by the TYPE column and computes the earliest (MIN) and latest (MAX) DOJ for each TYPE.
Include TYPE in the SELECT so each result row is labeled with its TYPE.
Using MIN(DOJ) gives the earliest date of joining for that TYPE; MAX(DOJ) gives the latest.
A query without GROUP BY returns overall min/max for the entire table, not per TYPE.
Ensure correct clause order: SELECT ... FROM ... GROUP BY ...; the grouping clause cannot appear before FROM.