nerdexam
Microsoft

DP-900 · Question #306

You have an Azure SQL database that contains tables for customers and orders. You need to create a query that will return the orders placed by each customer. Which two Transact-SOL statements should…

The correct answer is C. JOIN D. ORDERBY. To retrieve orders associated with each customer, a query must combine rows from two tables and organize the output. JOIN links the tables and ORDER BY sequences the results.

Submitted by eva_at· Mar 30, 2026Identify considerations for relational data on Azure

Question

You have an Azure SQL database that contains tables for customers and orders. You need to create a query that will return the orders placed by each customer. Which two Transact-SOL statements should you include in the query? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

Options

  • AINDEX
  • BEXISTS
  • CJOIN
  • DORDERBY
  • ESELECT

How the community answered

(21 responses)
  • A
    10% (2)
  • B
    5% (1)
  • C
    81% (17)
  • E
    5% (1)

Why each option

To retrieve orders associated with each customer, a query must combine rows from two tables and organize the output. JOIN links the tables and ORDER BY sequences the results.

AINDEX

INDEX is a database object created with CREATE INDEX, not a query clause; it cannot appear inside a SELECT statement to filter or join data.

BEXISTS

EXISTS is a subquery predicate used to test for the presence of rows, not to join two tables and return combined columns from both.

CJOINCorrect

JOIN combines rows from the customers table and the orders table based on a shared key, which is required to associate each order with its customer.

DORDERBYCorrect

ORDER BY sequences the result set - typically by customer identifier - so that orders grouped under each customer are returned in a meaningful, organized order.

ESELECT

While SELECT is required in any query, it alone does not establish the relationship between the customers and orders tables; the question asks for the two statements that specifically address joining and organizing the data.

Concept tested: T-SQL multi-table query with JOIN and ORDER BY

Source: https://learn.microsoft.com/en-us/sql/t-sql/queries/select-transact-sql

Topics

#T-SQL#JOIN#ORDER BY#relational queries

Community Discussion

No community discussion yet for this question.

Full DP-900 Practice