Hi there, Thank you for sharing the SQL query interview question. I would be happy to assist you in solving it. To retrieve the names of customers who have made at least three purchases from the 'Electronics' category, along with the count of their purchases, you can use a combination of the SELECT, FROM, WHERE, GROUP BY, and HAVING clauses. Here's a possible solution:
Code:
SELECT customer_name, COUNT(*) AS purchase_count FROM purchases WHERE category = 'Electronics' GROUP BY customer_name HAVING COUNT(*) >= 3
Let's break down the solution step by step:
- We start with the SELECT clause to identify what information we want to retrieve. In this case, we want to fetch the customer's name and the count of their purchases. To...