PrepAway - Latest Free Exam Questions & Answers

Which SQL statement will return the number of states in each region, ordered by number of states?

A table named STATES has the following columns: STATE_CD, REGION_CD, and
STATE_NAME. Which SQL statement will return the number of states in each region, ordered by
number of states?

PrepAway - Latest Free Exam Questions & Answers

A.
SELECT state_cd, COUNT(*)
FROM states
ORDER BY COUNT(*);

B.
SELECT state_cd, COUNT(*)
FROM states
GROUP BY state_cd
ORDER BY state_cd;

C.
SELECT region_cd, COUNT(*)
FROM states
GROUP BY state_cd
ORDER BY COUNT(*);

D.
SELECT region_cd, COUNT(*)
FROM states
GROUP BY region_cd
ORDER BY COUNT(*);

Explanation:


Leave a Reply