Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL for New Netflix Members

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL for New Netflix Members. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Netflix wants a quick daily measure of member acquisition for its subscription analytics dashboard. Write a PostgreSQL query that counts members who joined during the last 7 calendar days, including today.

Requirements

  1. Filter the members table to records with a joined_on date from CURRENT_DATE - INTERVAL '6 days' through CURRENT_DATE.
  2. Return one row containing the number of new members, with the exact output alias new_member_count.

Schema

members
ColumnTypeDescription
member_idPKINTUnique Netflix member identifier
member_nameVARCHAR(100)Member display name
joined_onDATEDate the member joined Netflix
membership_statusVARCHAR(20)Current membership status
Tablesmembers
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results