Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Extract Player Demographics

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

Your question is Extract Player Demographics. 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

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
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results