Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Write a Basic SQL Extraction
00:00
5 left

Write a Basic SQL Extraction

EasySQL · PostgreSQL

Problem

What is your experience with SQL, and can you write a query to extract specific data?

Use the provided orders table. Write a query that returns completed orders with an amount greater than 100.

Output

  1. One row per qualifying order, with order_id, customer_name, amount, and order_date
  2. Exclude non-completed orders and orders with amounts of 100 or less
  3. Order by amount descending, with order_id ascending as the tie-breaker

Schema

orders
ColumnTypeDescription
order_idPKINTUnique order identifier
customer_nameVARCHAR(100)Customer name
statusVARCHAR(20)Order status
amountDECIMAL(10,2)Order amount
order_dateDATEDate the order was placed
Tablesorders
Interviewer

Your question is Write a Basic SQL Extraction. 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.