Free Databricks Certified Data Analyst Associate Actual Exam Questions - Question 10 Discussion
customer_name
number_of_orders
John Doe
388
Zhang San
234
Which statement will produce this output?
Option D has typos but uses GROUP BY, which is necessary for aggregation.
It’s A for me too. Aside from the typo in D, you need the GROUP BY clause on customer_name to aggregate orders properly, which B lacks and C doesn’t even use count correctly. A’s syntax is clean and matches the expected output perfectly.
A imo, because B uses a weird clause "USE customer_name" which isn’t valid SQL, and C doesn’t use count, so it won’t total orders. D’s typo kills it too.
Probably A, since D has a typo in the column name.
A/D? The option A uses count(order_id) with GROUP BY customer_name, which makes sense to get the number of orders per customer. But D is similar, just with a typo in "customerjiame" instead of "customer_name". B looks wrong since it has USE customer_name, which isn’t valid SQL here. C doesn’t have count, so it won’t aggregate orders properly. Probably A is correct if the spelling is right.