Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL Query for Customer Data
00:00
5 left

SQL Query for Customer Data

EasySQL · PostgreSQL

Problem

Write a simple SQL query to extract data from a customer table for Unknowns.

Assume the table is named customers. Return the requested customer fields for every customer, ordered by customer ID.

Output

  1. One row per customer
  2. Columns: customer_id, customer_name, and email
  3. Include all customers and sort by customer_id ascending

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(120)Customer's full name
emailVARCHAR(255)Customer email address
statusVARCHAR(20)Customer account status
cityVARCHAR(80)Customer's city
Tablescustomers
Interviewer

Your question is SQL Query for Customer Data. 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.