Support ongoing development - donate to help us maintain and improve the platform. 🖥️ Support sqltest →
SQL code copied to buffer
Task 155:

Film Distribution by Category and Store

MySQL
If you are familiar with the concept of PIVOT, try to apply it in practice. Count the number of different movies in each category for each branch of the company.
Create a table with columns category - movie category and in_store_1, in_store_2 - the number of movies in this category in each of the branches respectively. Sort the table by category in alphabetical order.
Expected result Columns: 3 · Rows: 16
category in_store_1 in_store_2

Sample rows open after wrong checks: 0 of 2

Write your query below and click "Check it!". Tables are described in the right pane.

The query result will appear here. Ctrl+Enter - Run query

Hi! Could we please enable some services and cookies to improve your experience and our website?

Privacy & Cookie Policy.