PdfPrep.com

Which four Transact-SQL segments should you use to develop the solution?

DRAG DROP

A database contains tables as shown in the exhibit. (Click the Exhibit button.)

Customer who are inactive are moved from the Customers table to the InactiveCustomers table. Any orders for inactive customers are removed from the Orders table.

You write the following SELECT statement to return all the inactive customers:

SELECT CustomerId FROM InactiveCustomers

You need to extend the SELECT statement to include customers who do not have any orders.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

Answer:

Explanation:

EXCEPT returns distinct rows from the left input query that aren’t output by the right input query.

References: https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-except­and-intersect-transact-sql?view=sql-server-2017

Exit mobile version