Customers Who Never Ordered
Updated
Problem statement
You are given two tables, customers and orders.
Return the customer_id and customer_name of every customer who has never placed an order.
Return the rows in ascending order by customer_id.
Table schema
MySQLPostgreSQLPandas
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
customers
| Column | Type | Nullable | Description |
|---|---|---|---|
| customer_idPK | Integer | No | Unique customer identifier. |
| customer_name | Text | No | Customer display name. |
orders
| Column | Type | Nullable | Description |
|---|---|---|---|
| order_idPK | Integer | No | Unique order identifier. |
| customer_id | Integer | No | Customer who placed the order. |
Foreign key: customer_id → customers(customer_id)
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| customer_id | Integer | No | — |
| customer_name | Text | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
- Each
customers.customer_idis unique. - Each
orders.order_idis unique. - Every
orders.customer_idreferences an existing customer. - A customer may have zero, one, or many orders.
- Return each qualifying customer exactly once in ascending
customer_idorder.
More Accenture interview questions
- Nearest Composite NumberOA · Seen Sep 2026
- Minimum Password IncrementsOA · Seen Sep 2026
- Reduce a Number to One DigitOA · Seen Sep 2026
- Candy DistributionOA · Seen Sep 2026
- Economical TripOA · Seen Sep 2026
- Coin ChangeOA · Seen Sep 2026
- Validate Email AddressOA · Seen Sep 2026
- Closest Rhyming WordOA · Seen Aug 2026
- Array Leader ElementsOA · Seen Nov 2025
- Alternating Index Square SumONSITE INTERVIEW · Seen Sep 2026
Similar questions at other companies
- Build Taxi Driver Performance FeaturesBoston Consulting Group · OABoston Consulting Group interview questions
- Students Scoring Above AverageCapstone Investment Advisors · OA
- Bond Interest Summary Above 3%Wells Fargo · OAWells Fargo interview questions
- Employee Promotion OpportunitiesIntuit · OAIntuit interview questions
- Students and Their SubjectsBirla Pivot · OA
- Companies with Average Salary Above 40000AT&T · OAAT&T interview questions
- Weekend Appointments for Consular Services ReschedulingMcKinsey & Company · OAMcKinsey & Company interview questions
- Companies Above a Salary ThresholdVerisk · OA
- Customer Resource Usage AnalysisIBM · OAIBM interview questions
- First Duplicate Transaction Within Ten MinutesLenskart · OA