Table: sales_by_film_category
Total sales by movie categories.
col_name | col_type -------------+---------- category | text total_sales | numeric
Question 2
Table: sales_by_film_category
Total sales by movie categories.
col_name | col_type -------------+---------- category | text total_sales | numeric
Sample results
category ----------- Category 1 Category 2 Category 3
Solution
postgresSELECT category
FROM sales_by_film_category
ORDER BY total_sales DESC
LIMIT 3;
Explanation
This query selects the "category" column from the "sales_by_film_category" table, which presumably contains data on the sales of films in different categories. The results are then sorted in descending order based on the "total_sales" column, which likely contains the total revenue generated by each category. Finally, the query limits the output to the top three categories with the highest total sales. This can be useful for identifying the most profitable film categories and making business decisions based on that information.
Last Submission
postgresNo submission yet for this engine. Run and submit your query to save it here.
Submit a query to compare against expected output.
Interview timer
Recommended interview pacing
Easy: 5 min for direct warm-up style questions.
Medium: 10 min for multi-step interview queries.
Hard: 15 min for layered questions with tighter time pressure.
A common bar is solving about 2 medium-or-harder questions in a 30 minute interview.
5:00
Run your query to preview results here.