¿Esta es tu empresa?
Details: 2 SQL questions involving 3 different tables in a database: Table 1 contained subscription payment data by `subscriber_id` and `date` (renewal data, new subscription date), Table 2 contained subscriber personal details (gender, age, location, etc), Table 3 contained stream details by subscriber_id (subscriber_id, content_id, seconds streamed, timestamp, content_title). Question 1: find number of daily active subscriptions in 2019. Question 2: find number of male subscribers who watched at least 3 unique titles in August, being careful not to count titles that were streamed for less than 3 seconds.
Anónimo
Q1: GROUP BY subscription date and count all distinct ids on each date. Q2: Find all males from personal details table. Take all IDs from consumption table that satisfy the following: WHERE seconds_streamed > 3 and number of distinct titles >=3 and EXTRACT(MONTH FROM EVENT_TIMESTAMP) = 8 (August). Inner join male subscriber_ids to subscriber_ids that satisfy above criteria and return count of IDs.