GoConqr has a new look! Let us know what you think.

Quiz

Questionário - Manipuling Data / Manipulating Large Data Sets

RENATO PASQUINI 84 questions

Take the quiz

Questions in this quiz (84)

  1. 1You need to load information about new customers from the NEW_CUST table into the tables CUST and CUST_SPECIAL. If a new customer has a credit limit greater than 10,000, then the details have to be inserted into CUST_SPECIAL. All new customer details have to be inserted into the CUST table. Which technique should beused to load the data most efficiently?
    1. Aexternal table
    2. Bthe MERGE command
    3. Cthe multitable INSERT command
    4. DINSERT using WITH CHECK OPTION
  2. 2Evaluate the CREATE TABLE statement:
    CREATE TABLE products
    (product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY,
    product_name VARCHAR2(15));
    Which statement is true regarding the PROD_ID_PK constraint?
    1. AIt would be created only if a unique index is manually created first.
    2. BIt would be created and would use an automatically created unique index.
    3. CIt would be created and would use an automatically created no unique index.
    4. DIt would be created and remains in a disabled state because no index is specified in the command.
  3. 3Which two statements are true?
    1. AThe USER_SYNONYMS view can provide information about private synonyms.
    2. BThe user SYSTEM owns all the base tables and user-accessible views of the data dictionary.
    3. CAll the dynamic performance views prefixed with V$ are accessible to all the database users.
    4. DThe USER_OBJECTS view can provide information about the tables and views created by the user only.
    5. EDICTIONARY is a view that contains the namesof all the data dictionary views that the user can access.
  4. 4View the Exhibit and examine the description of the EMPLOYEES table.
    Your company decided to give a monthly bonus of $50 to all the employees who have completed
    five years in the company. The following statement is written to display the LAST_NAME,
    DEPARTMENT_ID, and the total annual salary:
    SELECT last_name, department_id, salary+50*12 "Annual Compensation"
    FROM employees
    WHERE MONTHS_BETWEEN(SYSDATE, hire_date)/12 >= 5;
    When you execute the statement, the "Annual Compensation" is not computed correctly. What
    changes would you make to the query to calculate the annual compensation correctly?
    Image for question 4
    1. AChange the SELECT clause to SELECT last_name, department_id, salary*12+50 "Annual Compensation".
    2. BChange the SELECT clause to SELECT last_name, department_id, salary+(50*12) "Annual Compensation".
    3. CChange the SELECT clause to SELECT last_name, department_id, (salary+50)*12 "Annual Compensation".
    4. DChange the SELECT clause to SELECT last_name, department_id, (salary*12)+50 "Annual Compensation".
  5. 5Evaluate the following CREATE SEQUENCE statement:
    CREATE SEQUENCE seq1
    START WITH 100
    INCREMENT BY 10
    MAXVALUE 200
    CYCLE
    NOCACHE;
    The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue the following SQL statement:
    SELECT seq1.nextval FROM dual;
    What is displayed by the SELECT statement?
    1. A1
    2. B10
    3. C100
    4. Dan error
  6. 6View the Exhibit and examine the description of the EMPLOYEES table.

    You want to display the EMPLOYEE_ID, FIRST_NAME, and DEPARTMENT_ID for all the employees who work in the same department and have the same manager as that of the employee having EMPLOYEE_ID 104. To accomplish the task, you execute the following SQL statement:
    SELECT employee_id, first_name, department_id
    FROM employees
    WHERE (manager_id, department_id) =(SELECT department_id, manager_id
    FROM employees
    WHERE employee_id = 104)
    AND employee_id <> 104;
    When you execute the statement itdoes not produce the desired output. What is the reason for this?
    Image for question 6
    1. AThe WHERE clause condition in the main query is using the = comparison operator, instead of EXISTS.
    2. BThe WHERE clause condition in the main query is using the = comparison operator, instead of
      the IN operator.
    3. CThe WHERE clause condition in the main query is using the = comparison operator, instead of
      the = ANY operator.
    4. DThe columns in the WHERE clause condition ofthe main query and the columns selected in
      the subquery should be in the same order.
  7. 7View the Exhibit and examine the descriptions of ORDER_ITEMS and ORDERS tables.

    You want to display the CUSTOMER_ID, PRODUCT_ID, and total (UNIT_PRICE multiplied by QUANTITY) for the order placed. You also want to display the subtotals for a CUSTOMER_ID as well as for a PRODUCT_ID for the last six months.
    Which SQL statement would you execute to get the desired output?
    Image for question 7
    1. ASELECT o.customer_id, oi.product_id, SUM(oi.unit_price*oi.quantity) "Total" FROM
      order_items oi JOIN orders o
      ON oi.order_id=o.order_id
      GROUP BY ROLLUP (o.customer_id,oi.product_id)
      WHERE MONTHS_BETWEEN(order_date, SYSDATE) <= 6;
    2. BSELECT o.customer_id, oi.product_id, SUM(oi.unit_price*oi.quantity) "Total"
      FROM order_items oi JOIN orders o
      ON oi.order_id=o.order_id
      GROUP BY ROLLUP (o.customer_id,oi.product_id)
      HAVING MONTHS_BETWEEN(order_date, SYSDATE) <= 6;
    3. CSELECT o.customer_id, oi.product_id, SUM(oi.unit_price*oi.quantity) "Total"
      FROM order_items oi JOIN orders o
      ON oi.order_id=o.order_id
      GROUP BY ROLLUP (o.customer_id, oi.product_id)
      WHERE MONTHS_BETWEEN(order_date, SYSDATE) >= 6;
    4. DSELECT o.customer_id, oi.product_id, SUM(oi.unit_price*oi.quantity) "Total"
      FROM order_items oi JOIN orders o
      ON oi.order_id=o.order_id
      WHERE MONTHS_BETWEEN(order_date, SYSDATE) <= 6
      GROUP BY ROLLUP (o.customer_id, oi.product_id) ;
  8. 8View the Exhibit and examine the structure of the EMPLOYEES table.

    You want to retrieve hierarchical data of the employees using the top-down hierarchy. Which SQL clause would let you choose the direction to walk through the hierarchy tree?
    Image for question 8
    1. AWHERE
    2. BHAVING
    3. CGROUP BY
    4. DSTART WITH
    5. ECONNECT BY PRIOR
  9. 9Which two statements is true regarding the execution of the correlated subqueries?
    1. AThe nested query executes after the outer query returns the row.
    2. BThe nested query executes first and then the outer query executes.
    3. CThe outer query executes only once for the result returned by the inner query.
    4. DEach row returned by the outer query is evaluated for the results returned by the inner query.
  10. 10OE and SCOTT are the users in the database. The ORDERS table is owned by OE. Evaluate the statements issued by the DBA in the following sequence:
    CREATE ROLE r1;
    GRANT SELECT, INSERT ON oe.orders TO r1;
    GRANT r1 TO scott;
    GRANT SELECT ON oe.orders TO scott;
    REVOKE SELECT ON oe.orders FROM scott;
    What would be the outcome after executing the statements?
    1. ASCOTT would be able to query the OE.ORDERS table.
    2. BSCOTT would not be able to query the OE.ORDERS table.
    3. CThe REVOKE statement would remove the SELECT privilege from SCOTT as well as from the
      role R1.
    4. DThe REVOKE statement would give an error because the SELECT privilege has been granted
      to the role R1.

Information

Description
Oracle Certified Associate Oracle - SQL/PLSQL Quiz on Questionário - Manipuling Data / Manipulating Large Data Sets, created by RENATO PASQUINI on 19/05/2016.
Language
Português
Views
1
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?