Keep SQLtest alive: Help cover this month's $100 server costs to keep all lessons and the SQL playground online. Support the project →
SQL code copied to buffer
Task 22:

Client Rentals by Time of Day

MySQL
Count the number of films rented in each of day intervals: 
Morning 08:00-12:59, Afternoon 13:00-17:59, Evening 18:00-22:59 and Night 23:00-07:59.
Output the resulting table from two columns time_of_day and rentals_count sorted by rentals count in descending order
Expected result Columns: 2 · Rows: 4
time_of_day rentals_count

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.