LPI
102-500 · Question #184
Which of the following SQL queries counts the number of occurrences for each value of the field order_type in the table orders?
The correct answer is B. SELECT order_type,COUNT(*) FROM orders GROUP BY order_type. See the full explanation below for the reasoning.
Question
Which of the following SQL queries counts the number of occurrences for each value of the field order_type in the table orders?
Options
- ASELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
- BSELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
- CCOUNT(SELECT order_type FROM orders);
- DSELECT COUNT(*) FROM orders ORDER BY order_type;
- ESELECT AUTO_COUNT FROM orders COUNT order_type;
How the community answered
(28 responses)- A14% (4)
- B71% (20)
- C7% (2)
- D4% (1)
- E4% (1)
Community Discussion
No community discussion yet for this question.