QuestionQ153

VerifiedManipulating Data

Examine the structure of the EMPLOYEES table:

Question Image

You need to create a SQL script file containing an INSERT statement. When the script runs, the INSERT statement must add a row with the specified values to the EMPLOYEES table. The statement must pass values to the table columns as specified below:

Question Image

Which INSERT statement satisfies these requirements?

Explanation

WITH CHECK OPTION on the inline view prevents an inserted row from violating the view predicate. Because the target subquery permits only department_id IN (20, 50), a substituted department value outside that set causes the insert to fail. The statement also uses EMP_ID_SEQ.NEXTVAL for the employee ID, substitution variables for the specified run-time values, 2000 for salary, and NULL for manager ID. Oracle documents that WITH CHECK OPTION prohibits changes that would produce rows not included in the subquery.

Learn more

Community Discussion

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