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

SQL for Customer Retrieval

EasySQL · PostgreSQL

Problem

Write a SQL query to retrieve customer information from a database for a Happy Money reporting use case.

Use the customers table and return only customers whose status is active.

Output

  1. One row per active customer with customer_id, customer_name, email, and customer_status.
  2. Sort the results by customer_id in ascending order.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(100)Customer's full name
emailVARCHAR(255)Customer email address
customer_statusVARCHAR(20)Current customer account status
Tablescustomers
Interviewer

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