QuestionQ252

VerifiedManipulating Data

View the exhibit and examine the structures of the ORDERS and CUSTOMERS tables. 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?

Question Image

Explanation

A scalar subquery that returns one column from one row can be used as an expression in an INSERT ... VALUES list. The customer lookup returns the single matching CUSTOMER_ID, which is supplied as the required ORDERS.CUSTOMER_ID value while the remaining values correspond to the columns in ORDERS table order. Oracle Database SQL Language Reference: Scalar Subquery Expressions

Learn more

Community Discussion

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