Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL, Power BI, and Python Basics

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

Your question is SQL, Power BI, and Python Basics. Start with the requirements and the two tables 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

Preguntas tecnicas de sql, powerbi, Python

This item focuses on the SQL portion. Using customers and orders, write a query that summarizes completed orders for every customer.

Output

  1. One row per customer with customer_id, customer_name, completed_order_count, completed_revenue, and spending_band.
  2. Include customers without completed orders, treating their count and revenue as zero.
  3. Classify revenue as High for at least 1000, Medium for 500 to 999.99, and Low below 500.
  4. Order by completed_revenue descending, then customer_id ascending.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(100)Customer display name
orders
ColumnTypeDescription
order_idPKINTUnique order identifier
customer_idINTCustomer associated with the order
statusVARCHAR(20)Order lifecycle status
amountNUMERIC(10,2)Order amount
Tablescustomersorders
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results