Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Writing a Simple SQL Query
00:00
5 left

Writing a Simple SQL Query

EasySQL · PostgreSQL

Problem

Can you write a simple SQL query to extract customer data from a database?

Use the customers table and return only customers whose status is active. Include the requested customer fields and present the results in ascending customer ID order.

Output

  1. One row per active customer
  2. Columns: customer_id, customer_name, and email
  3. Sort 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
statusVARCHAR(20)Customer account status
Tablescustomers
Interviewer

Your question is Writing a Simple SQL Query. 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.