Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
SQL for Weekly Completion Rates
00:00
5 left

SQL for Weekly Completion Rates

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance at Notion Labs by team, joining task completion data with team metadata and calculating completion rates by week.

Use the provided task and team tables. Treat a task as completed only when its status is completed, and exclude tasks without a planned date.

Output

  1. One row per team and calendar week containing at least one task
  2. Columns: team_id, team_name, week_start, total_tasks, completed_tasks, completion_rate_pct
  3. Sort by team_id, then week_start ascending

Schema

team_metadata
ColumnTypeDescription
team_idPKINTUnique identifier for the team
team_nameVARCHAR(100)Notion Labs team name
departmentVARCHAR(100)Department containing the team
manager_emailVARCHAR(255)Email address of the team manager
task_completion_data
ColumnTypeDescription
task_idPKINTUnique identifier for the task
team_idINTTeam responsible for the task
planned_atTIMESTAMPTimestamp when the task was planned
statusVARCHAR(30)Current task status
Tablestask_completion_datateam_metadata
Interviewer

Your question is SQL for Weekly Completion Rates. Start with the requirements and the two tables in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.