SQL · Meta · Medium
Write a SQL query that identifies the three customers who purchased the most books from qualifying categories. Input You are given these tables: Purchases(CustomerId, BookId, Category) records each book purchase and the category associated with it. Books(BookId, Author) maps each book to its author. Output Return the IDs of up to three customers ordered by the number of books they purchased in categories that satisfy the qualification rule. Requirements A category qualifies…
Checking your access…