Multiple choice

Consider the following database table

Table Name- Customer |||||| |---|---|---|---|---| |customerid|firstname|lastname|city|state| |001|Adam|Smith|Pinetop|Arizona| |002|Sarah|Graham|Nogales|Arizona| |003|Linda|Giles|Durango|Colorado| |004|Lisa|Howell|Kailua|Hawaii| |005|Anthony|Davids|Greensboro|North Carolina| |006|Kevin|Smith|Yuma|Arizona| |007|Dalton|Howell|Tillamook|Oregon| |008|Donald|Steyn|Lynden|Washington| |009|Angelo|Mathhews|Pocatello|Idaho| |010|Albie|Morne|Snoqualmie|Washington|

How many people are in each unique state in the customers table?

  1. SELECT customerid FROM customers GROUP BY state;

  2. SELECT customerid, count(state) FROM customers GROUP BY state;

  3. SELECT state, count(state) FROM customers GROUP BY state;

  4. SELECT * FROM customers GROUP BY state;

  5. SELECT count(state) FROM customers GROUP BY state;

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

This is the correct syntax as this will display the result for the unique state for all the customers.