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

Quiz

Simulado 4 - (46) 1Z0-071 - Oracle Database SQL

Jorge Junior 46 questions

Take the quiz

Questions in this quiz (46)

  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. 2Which three tasks can be performed using regular expression support in Oracle Database 10g? (Choose three.)
    1. AIt can be used to concatenate two strings.
    2. BIt can be used to find out the total length of the string.
    3. CIt can be used for string manipulation and searching operations.
    4. DIt can be used to format the output for a column or expression having string data.
    5. EIt can be used to find and replace operations for a column or expression having string data.
  3. 3Evaluate the following SQL statement:
    ALTER TABLE emp
    DROP COLUMN first_name;
    Which two statements is true regarding the above command? (Choose two.)
    Image for question 3
    1. AThe FIRST_NAME column would be dropped provided it does not contain any data.
    2. BThe FIRST_NAME column would be dropped provided at least one or more columns remain in the table.
    3. CThe FIRST_NAME column can be rolled back provided the SET UNUSED option is added to the above SQL statement.
    4. DThe FIRST_NAME column can be dropped even if it is part of a composite PRIMARY KEY
      provided the CASCADE option is used.
  4. 4Evaluate 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.
  5. 5Which 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.
  6. 6Which two WHERE clause conditions demonstrate the correct usage of conversion functions?Image for question 6
    1. AWHERE order_date > TO_DATE('JUL 10 2006','MON DD YYYY')
    2. BWHERE TO_CHAR(order_date,'MON DD YYYY') = 'JAN 20 2003'
    3. CWHERE order_date > TO_CHAR(ADD_MONTHS(SYSDATE,6),'MON DD YYYY')
    4. DWHERE order_date IN ( TO_DATE('Oct 21 2003','Mon DD YYYY'), TO_CHAR('NOV 21 2003','Mon DD YYYY') )
  7. 7View 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 7
    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".
  8. 8Evaluate 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
  9. 9View 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 9
    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.
  10. 10View 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 10
    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) ;

Information

Description
46 Questoẽs aberta e sem tempo de execução
Language
Português
Views
4
Tags
oracle
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?