Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Extract Player Demographics
00:00
5 left

Extract Player Demographics

EasySQL · PostgreSQL

Problem

Write a SQL query to extract player demographics from a user database for Zynga.

Use the users table and return the available demographic attributes for every player. Preserve NULL values where demographic information is missing.

Output

  1. One row per player
  2. Columns: player_id, age, gender, and country
  3. Include every player and sort by player_id in ascending order

Schema

users
ColumnTypeDescription
player_idPKINTEGERUnique identifier for the player
ageINTEGERPlayer age in years
genderVARCHAR(30)Player-reported gender
countryVARCHAR(100)Player country
Tablesusers
Interviewer

Your question is Extract Player Demographics. Start with the requirements and the one table 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.