Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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
Complex SQL Data Manipulation
00:00
5 left

Complex SQL Data Manipulation

HardSQL · PostgreSQL

Problem

How do you use SQL to perform data manipulations in complex queries?

Use the provided tables to produce creator-level performance metrics for videos published in January 2025. Include creators without qualifying videos or views, and classify and rank creators based on their January activity.

Output

  1. One row per creator, with creator_id, creator_name, video_count, total_views, total_watch_seconds, avg_watch_seconds, engagement_label, and creator_rank.
  2. Include all creators, order by total_watch_seconds descending and creator_id ascending for ties.

Schema

creators
ColumnTypeDescription
creator_idPKINTUnique creator identifier
creator_nameVARCHAR(100)Creator display name
regionVARCHAR(50)Creator region
videos
ColumnTypeDescription
video_idPKINTUnique video identifier
creator_idINTCreator who published the video
video_titleVARCHAR(150)Video title
video_categoryVARCHAR(50)Video category
published_atDATEVideo publication date
video_views
ColumnTypeDescription
view_idPKINTUnique view identifier
video_idINTVideo that received the view
viewed_atDATEDate of the view
watch_secondsINTSeconds watched during the view
Tablescreatorsvideosvideo_views
Interviewer

Your question is Complex SQL Data Manipulation. Start with the requirements and the three 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.