QuestionQ236

VerifiedManipulating Data

Refer to the exhibit and review the structures of the ORDERS and CUSTOMERS tables.

Question Image

Only one customer has CUST_LAST_NAME equal to Roberts. Which INSERT statement should be used to add a row to the ORDERS table for the customer whose CUST_LAST_NAME is Roberts and whose CREDIT_LIMIT is 600?

Explanation

A scalar subquery can supply a column value in an INSERT ... VALUES statement. The subquery retrieves the matching customer's CUSTOMER_ID, and the stated uniqueness ensures that it returns one value for the ORDERS.CUSTOMER_ID column.

Community Discussion

No comments yet. Be the first to start the discussion!