Company: Intuit_21_jan
Difficulty: medium
Problem Description In online streaming services, analyzing viewer engagement is key to content optimization. You are tasked with generating a viewer engagement report that categorizes viewership duration into three segments. For each stream, calculate the total number of viewers and the count of viewers whose watch duration falls into the following categories: Less than 15 minutes ( < 15 ) 15 to 30 minutes (inclusive, >= 15 and <= 30 ) More than 30 minutes ( > 30 ) Schema streams Table Column Name Type Constraints Description id INT PRIMARY KEY The identifier of the stream. name VARCHAR(255) The name of the stream. visitors Table Column Name Type Constraints Description stream_id INT FOREIGN KEY ( streams.id ) The reference to the stream. start_dt VARCHAR(19) Date and time viewing started ( YYYY-MM-DD HH:MM:SS ). end_dt VARCHAR(19) Date and time viewing ended ( YYYY-MM-DD HH:MM:SS ). Required Output Your query should return the following columns, ordered by name in ascendi