Question 91

Examine the create table statements for the stores and sales tables.
SQL> CREATE TABLE stores(store_id NUMBER(4) CONSTRAINT store_id_pk PRIMARY KEY, store_name VARCHAR2(12), store_address VARCHAR2(20), start_date DATE); SQL> CREATE TABLE sales(sales_id NUMBER(4) CONSTRAINT sales_id_pk PRIMARY KEY, item_id NUMBER(4), quantity NUMBER(10), sales_date DATE, store_id NUMBER(4), CONSTRAINT store_id_fk FOREIGN KEY(store_id) REFERENCES stores(store_id)); You executed the following statement:
SQL> DELETE from stores
WHERE store_id=900;
The statement fails due to the integrity constraint error:
ORA-02292: integrity constraint (HR.STORE_ID_FK) violated
Which three options ensure that the statement will execute successfully?
  • Question 92

    View the Exhibit and examine the structure of the EMPLOYEES and JOB_HISTORY tables.

    Examine this query which must select the employee IDs of all the employees who have held the job SA_MAN at any time during their employment.
    SELECT employee_id
    FROM employees
    WHERE job_id = 'SA_MAN'
    -------------------------------------
    SELECT employee_id
    FROM job_history
    WHERE job_id='SA_MAN';
    Choose two correct SET operators which would cause the query to return the desired result. (Choose two.)
  • Question 93

    View the exhibit and examine the descriptions of the DEPT and LOCATIONS tables.

    You want to update the CITY column of the DEPT table for all the rows with the corresponding value in the CITY column of the LOCATIONS table for each department.
    Which SQL statement would you execute to accomplish the task?
  • Question 94

    View the Exhibit and examine the structure of the ORDER_ITEMS table.

    Examine the following SQL statement:
    SELECT order_id, product_id, unit_price
    FROM order_items
    WHERE unit_price =
    (SELECT MAX(unit_price)
    FROM order_items
    GROUP BY order_id);
    You want to display the PRODUCT_ID of the product that has the highest UNIT_PRICE per ORDER_ID.
    What correction should be made in the above SQL statement to achieve this?
  • Question 95

    Which three statements are true regarding indexes? (Choose three.)