Skip to content
DAA
Executing queries using Databricks SQL and Databricks SQL Warehouses
medium
Question 4 of 40

A Databricks SQL analyst needs to find all customers who placed more than 5 orders in 2024. Which query correctly uses a GROUP BY with a HAVING clause to achieve this?

ASELECT customer_id, COUNT(*) FROM orders WHERE COUNT(*) > 5 AND YEAR(order_date) = 2024 GROUP BY customer_id
BSELECT customer_id, COUNT(*) as order_count FROM orders WHERE YEAR(order_date) = 2024 GROUP BY customer_id HAVING COUNT(*) > 5
CSELECT customer_id FROM orders WHERE YEAR(order_date) = 2024 HAVING COUNT(*) > 5
DSELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id HAVING COUNT(*) > 5 WHERE YEAR(order_date) = 2024

Educational Content — CertQnA practice questions are written against official exam objectives, covering the same domains tested on the real exam. All content is original and independent — not actual exam questions, not affiliated with any certification vendor. Learn more about our content policy

Discussion

Be the first to share your understanding of this concept

⚠️ Discussion is for concept clarification only. Do not share or request actual exam questions or answers.

Sign in to join the discussion