FastPrepCustomers Who Never Ordered

Customers Who Never Ordered

Accenture logoAccenture● EasyINTERNOA

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

ColumnTypeNullableDescription
customer_idPKIntegerNoUnique customer identifier.
customer_nameTextNoCustomer display name.

orders

ColumnTypeNullableDescription
order_idPKIntegerNoUnique order identifier.
customer_idIntegerNoCustomer who placed the order.

Foreign key: customer_id → customers(customer_id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
customer_idIntegerNo—
customer_nameTextNo—

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • Each customers.customer_id is unique.
  • Each orders.order_id is unique.
  • Every orders.customer_id references an existing customer.
  • A customer may have zero, one, or many orders.
  • Return each qualifying customer exactly once in ascending customer_id order.

More Accenture problems

See Accenture hiring insights