1z0-071 Exam Question 1

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? (Choose three.)
  • 1z0-071 Exam Question 2

    See the Exhibit and examine the structure of the PROMOTIONS table:
    Using the PROMOTIONS table,
    you need to find out the average cost for all promos in the range $0-2000 and $2000-5000 in category A.
    You issue the following SQL statements:
    What would be the outcome?
  • 1z0-071 Exam Question 3

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

    Evaluate the following SQL statements:
    Statement 1:
    SELECT MAX(unit_price*quantity) "Maximum Order"
    FROM order_items;
    Statement 2:
    SELECT MAX(unit_price*quantity) "Maximum Order"
    FROM order_items
    GROUP BY order_id;
    Which statements are true regarding the output of these SQL statements? (Choose all that apply.)
  • 1z0-071 Exam Question 4

    The user SCOTTwho is the owner of ORDERSand ORDER_ITEMStables issues this GRANTcommand:
    GRANT ALL
    ON orders, order_items
    TO PUBLIC;
    What must be done to fix the statement?
  • 1z0-071 Exam Question 5

    Examine this statement which returns the name of each employee and their manager:

    You want to extend the query to include employees with no manager. What must you add before JOINto do this?