1Z0-047_2.pdf - Part II

Description

Quiz on 1Z0-047_2.pdf - Part II , created by anillvap on 28/01/2014.
anillvap
Quiz by anillvap, updated more than 1 year ago
anillvap
Created by anillvap almost 11 years ago
637
0

Resource summary

Question 1

Question
View the Exhibit and examine the description of the ORDER_ITEMS and PRODUCT_INFORMATION tables. The ORDER_ITEM table has records pertaining to details for each product in an order. The PRODUCT_INFORMATION table has records for all the products available for ordering. Evaluate the following SQL statement: SELECT oi.order_id, pi.product_id FROM order_items oi RIGHT OUTER JOIN product_information pi ON (oi.product_id=pi.product_id); Which statement is true regarding the output of this SQL statement?
Answer
  • A. The query would return the ORDER_ID and PRODUCT_ID for only those products that are ordered.
  • B. The query would return the ORDER_ID and PRODUCT_ID for the products that are ordered as well as for the products that have never been ordered.
  • C. The query would return the ORDER_ID and PRODUCT_ID for the products that are ordered but not listed in the PRODUCT_INFORMATION table.
  • D. The query would return the ORDER_ID and PRODUCT_ID for those products that are ordered as well as for the products that have never been ordered, and for the products that are not listed in the PRODUCT_INFORMATION table.

Question 2

Question
Evaluate the following statement: CREATE TABLE bonuses(employee_id NUMBER, bonus NUMBER DEFAULT 100); The details of all employees who have made sales need to be inserted into the BONUSES table. You can obtain the list of employees who have made sales based on the SALES_REP_ID column of the ORDERS table. The human resources manager now decides that employees with a salary of $8,000 or less should receive a bonus. Those who have not made sales get a bonus of 1% of their salary. Those who have made sales get a bonus of 1% of their salary and also a salary increase of 1%. The salary of each employee can be obtained from the EMPLOYEES table. Which option should be used to perform this task most efficiently?
Answer
  • A. MERGE
  • B. Unconditional INSERT
  • C. Conditional ALL INSERT
  • D. Conditional FIRST INSERT

Question 3

Question
Which statement is true regarding the ROLLUP operator specified in the GROUP BY clause of a SQL statement?
Answer
  • A. It produces only the subtotals for the groups specified in the GROUP BY clause.
  • B. It produces only the grand totals for the groups specified in the GROUP BY clause.
  • C. It produces higher-level subtotals, moving from right to left through the list of grouping columns specified in the GROUP BY clause.
  • D. It produces higher-level subtotals, moving in all the directions through the list of grouping columns specified in the GROUP BY clause.

Question 4

Question
View the Exhibit and examine DEPARTMENTS and the LOCATIONS tables. Evaluate the following SQL statement: SELECT location_id, city FROM locations l WHERE NOT EXISTS (SELECT location_id FROM departments WHERE location_id <> l.location_id); This statement was written to display LOCATION_ID and CITY where there are no departments located. Which statement is true regarding the execution and output of the command?
Answer
  • A. The statement would execute and would return the desired results.
  • B. The statement would not execute because the = comparison operator is missing in the WHERE clause of the outer query.
  • C. The statement would execute but it will return zero rows because the WHERE clause in the inner query should have the = operator instead of <>.
  • D. The statement would not execute because the WHERE clause in the outer query is missing the column name for comparison with the inner query result.

Question 5

Question
Evaluate the following SQL statements that are issued in the given order: CREATE TABLE emp (emp_no NUMBER(2) CONSTRAINT emp_emp_no_pk PRIMARY KEY, ename VARCHAR2(15), salary NUMBER(8,2), mgr_no NUMBER(2) CONSTRAINT emp_mgr_fk REFERENCES emp); ALTER TABLE emp DISABLE CONSTRAINT emp_emp_no_pk CASCADE; ALTER TABLE emp ENABLE CONSTRAINT emp_emp_no_pk; What would be the status of the foreign key EMP_MGR_FK?
Answer
  • A. It would be automatically enabled and deferred.
  • B. It would be automatically enabled and immediate.
  • C. It would remain disabled and has to be enabled manually using the ALTER TABLE command.
  • D. It would remain disabled and can be enabled only by dropping the foreign key constraint and re-creating it.

Question 6

Question
View the Exhibit and examine the structure of the LOCATIONS and DEPARTMENTS tables. Which SET operator should be used in the blank space in the following SQL statement to display the cities that have departments located in them? SELECT location_id, city FROM locations ____ SELECT location_id, city FROM locations JOIN departments USING(location_id);
Answer
  • A. UNION
  • B. MINUS
  • C. INTERSECT
  • D. UNION ALL

Question 7

Question
Which CREATE TABLE statement is valid?
Answer
  • A. CREATE TABLE ord_details (ord_no NUMBER(2) PRIMARY KEY, item_no NUMBER(3) PRIMARY KEY, ord_date date NOT NULL);
  • B. CREATE TABLE ord_details (ord_no NUMBER(2) UNIQUE, NOT NULL, item_no NUMBER(3), ord_date date DEFAULT SYSDATE NOT NULL);
  • C. CREATE TABLE ord_details (ord_no NUMBER(2) , item_no NUMBER(3), ord_date date DEFAULT NOT NULL, CONSTRAINT ord_uq UNIQUE (ord_no), CONSTRAINT ord_pk PRIMARY KEY (ord_no));
  • D. CREATE TABLE ord_details (ord_no NUMBER(2), item_no NUMBER(3), ord_date date DEFAULT SYSDATE NOT NULL, CONSTRAINT ord_pk PRIMARY KEY (ord_no, item_no));

Question 8

Question
Evaluate the following SELECT statement and view the Exhibit to examine its output: SELECT constraint_name, constraint_type, search_condition, r_constraint_name, delete_rule, status FROM user_constraints WHERE table_name = ORDERS Which two statements are true about the output? (Choose two.)
Answer
  • A. In the second column, indicates a check constraint.
  • B. The STATUS column indicates whether the table is currently in use.
  • C. The R_CONSTRAINT_NAME column gives the alternative name for the constraint.
  • D. The column DELETE_RULE decides the state of the related rows in the child table when the corresponding row is deleted from the parent table.

Question 9

Question
Which statement is true regarding Flashback Version Query?
Answer
  • A. It returns versions of rows only within a transaction.
  • B. It can be used in subqueries contained only in a SELECT statement.
  • C. It will return an error if the undo retention time is less than the lower bound time or SCN specified.
  • D. It retrieves all versions including the deleted as well as subsequently reinserted versions of the rows.

Question 10

Question
Which two statements are true regarding multiple-row subqueries? (Choose two.)
Answer
  • A. They can contain group functions.
  • B. They always contain a subquery within a subquery.
  • C. They use the < ALL operator to imply less than the maximum.
  • D. They can be used to retrieve multiple rows from a single table only.
  • E. They should not be used with the NOT IN operator in the main query if NULL is likely to be a part of the result of the subquery.

Question 11

Question
View the Exhibit and examine the structure of the ORDERS table. The columns ORDER_MODE and ORDER_TOTAL have the default values 'direct' and 0 respectively. Which two INSERT statements are valid? (Choose two.)
Answer
  • A. INSERT INTO orders VALUES (1, '09-mar-2007', 'online','',1000);
  • B. INSERT INTO orders (order_id,order_date,order_mode, customer_id,order_total) VALUES(1,TO_DATE(NULL), 'online', 101, NULL);
  • C. INSERT INTO (SELECT order_id,order_date,customer_id FROM orders) VALUES (1,'09-mar-2007', 101);
  • D. INSERT INTO orders VALUES (1,'09-mar-2007', DEFAULT, 101, DEFAULT);
  • E. INSERT INTO orders (order_id,order_date,order_mode,order_total) VALUES (1,'10-mar-2007','online',1000);

Question 12

Question
The following are the steps for a correlated subquery, listed in random order: 1) The WHERE clause of the outer query is evaluated. 2) The candidate row is fetched from the table specified in the outer query. 3) The procedure is repeated for the subsequent rows of the table, till all the rows are processed. 4) Rows are returned by the inner query, after being evaluated with the value from the candidate row in the outer query. Identify the option that contains the steps in the correct sequence in which the Oracle server evaluates a correlated subquery.
Answer
  • A. 4, 2, 1, 3
  • B. 4, 1, 2, 3
  • C. 2, 4, 1, 3
  • D. 2, 1, 4, 3

Question 13

Question
View the Exhibit and examine the structure of the EMPLOYEES table. Evaluate the following SQL statement: SELECT employee_id, last_name, job_id, manager_id FROM employees START WITH employee_id = 101 CONNECT BY PRIOR employee_id=manager_id; Which statement is true regarding the output for this command?
Answer
  • A. It would return a hierarchical output starting with the employee whose EMPLOYEE_ID is 101, followed by his or her peers.
  • B. It would return a hierarchical output starting with the employee whose EMPLOYEE_ID is 101, followed by the employee to whom he or she reports.
  • C. It would return a hierarchical output starting with the employee whose EMPLOYEE_ID is 101, followed by employees below him or her in the hierarchy.
  • D. It would return a hierarchical output starting with the employee whose EMPLOYEE_ID is101, followed by employees up to one level below him or her in the hierarchy.

Question 14

Question
Which two statements are true about the GROUPING function? (Choose two.)
Answer
  • A. It is used to find the groups forming the subtotal in a row.
  • B. It is used to identify the NULL value in the aggregate functions.
  • C. It is used to form the group sets involved in generating the totals and subtotals.
  • D. It can only be used with ROLLUP and CUBE operators specified in the GROUP BY clause.

Question 15

Question
Given below is a list of datetime data types and examples of values stored in them in a random order: Datatype Example 1)INTERVAL YEAR TO MONTH a) '2003-04-15 8:00:00 -8:00' 2)TIMESTAMP WITH LOCAL TIME ZONE b) '+06 03:30:16.000000' 3)TIMESTAMP WITH TIME ZONE c) '17-JUN-03 12.00.00.000000 AM' 4)INTERVAL DAY TO SECOND d) '+02-00' Identify the option that correctly matches the data types with the values.
Answer
  • A. 1-d, 2-c, 3-a, 4-b
  • B. 1-b, 2-a, 3-c, 4-d
  • C. 1-b, 2-a, 3-d, 4-c
  • D. 1-d, 2-c, 3-b, 4-a

Question 16

Question
View the Exhibit and examine the description of the PRODUCT_INFORMATION table. You want to display the expiration date of the warranty for a product. Which SQL statement would you execute?
Answer
  • A. SELECT product_id, SYSDATE + warranty_period FROM product_information;
  • B. SELECT product_id, TO_YMINTERVAL(warranty_period) FROM product_information;
  • C. SELECT product_id, TO_YMINTERVAL(SYSDATE) + warranty_period FROM product_information;
  • D. SELECT product_id, TO_YMINTERVAL(SYSDATE + warranty_period) FROM product_information;

Question 17

Question
View the Exhibit and examine the structure of the ORDERS table. NEW_ORDERS is a new table with the columns ORD_ID, ORD_DATE, CUST_ID, and ORD_TOTAL that have the same data types and size as the corresponding columns in the ORDERS table. Evaluate the following INSERT statement: INSERT INTO new_orders (ord_id, ord_date, cust_id, ord_total) VALUES(SELECT order_id,order_date,customer_id,order_total FROM orders WHERE order_date > '31-dec-1999'); Why would the INSERT statement fail?
Answer
  • A. because column names in NEW_ORDERS and ORDERS tables do not match
  • B. because the VALUES clause cannot be used in an INSERT with a subquery
  • C. because the WHERE clause cannot be used in a subquery embedded in an INSERT statement
  • D. because the total number of columns in the NEW_ORDERS table does not match the total number of columns in the ORDERS table

Question 18

Question
View the Exhibit and examine the structure of the ORDER_ITEMS and ORDERS tables. You are asked to retrieve the ORDER_ID, PRODUCT_ID, and total price (UNIT_PRICE multiplied by QUANTITY), where the total price is greater than 50,000. You executed the following SQL statement: SELECT order_id, product_id, unit_price*quantity "Total Price" FROM order_items WHERE unit_price*quantity > 50000 NATURAL JOIN orders; Which statement is true regarding the execution of the statement?
Answer
  • A. The statement would execute and provide the desired result.
  • B. The statement would not execute because the ON keyword is missing in the NATURAL JOIN clause.
  • C. The statement would not execute because the WHERE clause is before the NATURAL JOIN clause.
  • D. The statement would not execute because the USING keyword is missing in the NATURAL JOIN clause.

Question 19

Question
View the Exhibit and examine the structure of the EMPLOYEES table. You want to know the FIRST_NAME and SALARY for all employees who have the same manager as that of the employee with the first name 'Neena' and have salary equal to or greater than that of 'Neena'. Which SQL statement would give you the desired result?
Answer
  • A. SELECT first_name, salary FROM employees WHERE (manager_id, salary) >= ALL (SELECT manager_id, salary FROM employees WHERE first_name = 'Neena' ) AND first_name <> 'Neena';
  • B. SELECT first_name, salary FROM employees WHERE (manager_id, salary) >= (SELECT manager_id, salary FROM employees WHERE first_name = 'Neena' ) AND first_name <> 'Neena';
  • C. SELECT first_name, salary FROM employees WHERE (manager_id, salary) >= ANY (SELECT manager_id, salary FROM employees WHERE first_name = 'Neena' ) AND first_name <> 'Neena';
  • D. SELECT first_name, salary FROM employees WHERE ( manager_id = (SELECT manager_id FROM employees WHERE first_name = 'Neena' ) AND salary >= ( SELECT salary FROM employees WHERE first_name = 'Neena' ) ) AND first_name <> 'Neena';

Question 20

Question
View the Exhibit and examine the structure of the ORDERS table. Which UPDATE statement is valid?
Answer
  • A. UPDATE orders SET order_date = '12-mar-2007', order_total IS NULL WHERE order_id = 2455;
  • B. UPDATE orders SET order_date = '12-mar-2007', order_total = NULL WHERE order_id = 2455;
  • C. UPDATE orders SET order_date = '12-mar-2007' AND order_total = TO_NUMBER(NULL) WHERE order_id = 2455;
  • D. UPDATE orders SET order_date = TO_DATE('12-mar-2007','dd-mon-yyyy'), SET order_total = TO_NUMBER(NULL) WHERE order_id = 2455;

Question 21

Question
View the Exhibit and examine the descriptions for ORDERS and ORDER_ITEMS tables. Evaluate the following SQL statement: SELECT o.customer_id, oi.product_id, SUM(oi.unit_price*oi.quantity) "Order Amount" FROM order_items oi JOIN orders o ON oi.order_id = o.order_id GROUP BY CUBE (o.customer_id, oi.product_id); Which three statements are true regarding the output of this SQL statement? (Choose three.)
Answer
  • A. It would return the subtotals for the Order Amount of every CUSTOMER_ID.
  • B. It would return the subtotals for the Order Amount for every PRODUCT_ID.
  • C. It would return the subtotals for the Order Amount of every PRODUCT_ID and CUSTOMER_ID as one group.
  • D. It would return the subtotals for the Order Amount of every CUSTOMER_ID and PRODUCT_ID as one group.
  • E. It would return only the grand total for the Order Amount of every CUSTOMER_ID and PRODUCT_ID as one group.

Question 22

Question
View the Exhibit and examine the details of the EMPLOYEES table. You want to generate a hierarchical report for all the employees who report to the employee whose EMPLOYEE_ID is 100. Which SQL clauses would you require to accomplish the task? (Choose all that apply.)
Answer
  • A. WHERE
  • B. HAVING
  • C. GROUP BY
  • D. START WITH
  • E. CONNECT BY

Question 23

Question
View the Exhibit and examine the data in ORDERS_MASTER and MONTHLY_ORDERS tables. Evaluate the following MERGE statement: MERGE INTO orders_master o USING monthly_orders m ON (o.order_id = m.order_id) WHEN MATCHED THEN UPDATE SET o.order_total = m.order_total DELETE WHERE (m.order_total IS NULL) WHEN NOT MATCHED THEN INSERT VALUES (m.order_id, m.order_total); What would be the outcome of the above statement?
Answer
  • A. The ORDERS_MASTER table would contain the ORDER_IDs 1 and 2.
  • B. The ORDERS_MASTER table would contain the ORDER_IDs 1, 2 and 3.
  • C. The ORDERS_MASTER table would contain the ORDER_IDs 1, 2 and 4.
  • D. The ORDERS_MASTER table would contain the ORDER_IDs 1, 2, 3 and 4.

Question 24

Question
Evaluate the following ALTER TABLE statement: ALTER TABLE orders SET UNUSED order_date; Which statement is true?
Answer
  • A. The DESCRIBE command would still display the ORDER_DATE column.
  • B. ROLLBACK can be used to get back the ORDER_DATE column in the ORDERS table.
  • C. The ORDER_DATE column should be empty for the ALTER TABLE command to execute successfully.
  • D. After executing the ALTER TABLE command, you can add a new column called ORDER_DATE to the ORDERS table.

Question 25

Question
View the Exhibit and examine the ORDERS table. The ORDERS table contains data and all orders have been assigned a customer ID. Which statement would add a NOT NULL constraint to the CUSTOMER_ID column?
Answer
  • A. ALTER TABLE orders ADD CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);
  • B. ALTER TABLE orders MODIFY customer_id CONSTRAINT orders_cust_id_nn NOT NULL;
  • C. ALTER TABLE orders MODIFY CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);
  • D. ALTER TABLE orders ADD customer_id NUMBER(6)CONSTRAINT orders_cust_id_nn NOT NULL;

Question 26

Question
Which three statements indicate the end of a transaction? (Choose three.)
Answer
  • A. after a COMMIT is issued
  • B. after a ROLLBACK is issued
  • C. after a SAVEPOINT is issued
  • D. after a SELECT statement is issued
  • E. after a CREATE statement is issued

Question 27

Question
View the Exhibit and examine the structure of the ORDERS table. You have to display ORDER_ID, ORDER_DATE, and CUSTOMER_ID for all those orders that were placed after the last order placed by the customer whose CUSTOMER_ID is 101. Which query would give you the desired output?
Answer
  • A. SELECT order_id, order_date FROM orders WHERE order_date > ALL (SELECT MAX(order_date) FROM orders ) AND customer_id = 101;
  • B. SELECT order_id, order_date FROM orders WHERE order_date > ANY (SELECT order_date FROM orders WHERE customer_id = 101);
  • C. SELECT order_id, order_date FROM orders WHERE order_date > ALL (SELECT order_date FROM orders WHERE customer_id = 101);
  • D. SELECT order_id, order_date FROM orders WHERE order_date IN (SELECT order_date FROM orders WHERE customer_id = 101);

Question 28

Question
You need to create a table with the following column specifications: 1. Employee ID (numeric data type) for each employee 2. Employee Name, (character data type) which stores the employee name 3. Hire date, to store the date when the employee joined the organization 4. Status (character data type). It should contain the value if no data is entered. 5. Resume (character large object [CLOB] data type), which would contain the resume submitted by the employee Which is the correct syntax to create this table?
Answer
  • A. CREATE TABLE EMP_1 (emp_id NUMBER(4), emp_name VARCHAR2(25), start_date DATE, e_status VARCHAR2(10) DEFAULT 'ACTIVE', resume CLOB(200));
  • B. CREATE TABLE 1_EMP (emp_id NUMBER(4), emp_name VARCHAR2(25), start_date DATE, emp_status VARCHAR2(10) DEFAULT 'ACTIVE', resume CLOB);
  • C. CREATE TABLE 1_EMP (emp_id NUMBER(4), emp_name VARCHAR2(25), start_date DATE, emp_status VARCHAR2(10) DEFAULT "ACTIVE", resume CLOB);
  • D. CREATE TABLE EMP_1 (emp_id NUMBER, emp_name VARCHAR2(25), start_date DATE, emp_status VARCHAR2(10) DEFAULT 'ACTIVE', resume CLOB);

Question 29

Question
The details of the order ID, order date, order total, and customer ID are obtained from the ORDERS table. If the order value is more than 30000, the details have to be added to the LARGE_ORDERS table. The order ID, order date, and order total should be added to the ORDER_HISTORY table, and order ID and customer ID should be added to the CUST_HISTORY table. Which multitable INSERT statement would you use?
Answer
  • A. Pivoting INSERT
  • B. Unconditional INSERT
  • C. Conditional ALL INSERT
  • D. Conditional FIRST INSERT

Question 30

Question
View the Exhibit and examine the description of the EMPLOYEES table. Evaluate the following SQL statement: SELECT first_name, employee_id, NEXT_DAY(ADD_MONTHS(hire_date, 6), 1) "Review" FROM employees; The query was written to retrieve the FIRST_NAME, EMPLOYEE_ID, and review date for employees. The review date is the first Monday after the completion of six months of the hiring. The NLS_TERRITORY parameter is set to AMERICA in the session. Which statement is true regarding this query?
Answer
  • A. The query would execute to give the desired output.
  • B. The query would not execute because date functions cannot be nested.
  • C. The query would execute but the output would give review dates that are Sundays.
  • D. The query would not execute because the NEXT_DAY function accepts a string as argument.

Question 31

Question
View the Exhibit and examine the structure of the EMPLOYEES table. You want to display all employees and their managers having 100 as the MANAGER_ID. You want the output in two columns: the first column would have the LAST_NAME of the managers and the second column would have LAST_NAME of the employees. Which SQL statement would you execute?
Answer
  • A. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e ON m.employee_id = e.manager_id WHERE m.manager_id=100;
  • B. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e ON m.employee_id = e.manager_id WHERE e.manager_id=100;
  • C. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e ON e.employee_id = m.manager_id WHERE m.manager_id=100;
  • D. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e WHERE m.employee_id = e.manager_id AND e.manager_id=100;

Question 32

Question
View the Exhibit1 and examine the descriptions of the EMPLOYEES and DEPARTMENTS tables. The following SQL statement was executed: SELECT e.department_id, e.job_id, d.location_id, sum(e.salary) total, GROUPING(e.department_id) GRP_DEPT, GROUPING(e.job_id) GRP_JOB, GROUPING(d.location_id) GRP_LOC FROM employees e JOIN departments d ON e.department_id = d.department_id GROUP BY ROLLUP (e.department_id, e.job_id, d.location_id); View the Exhibit2 and examine the output of the command. Which two statements are true regarding the output? (Choose two.)
Answer
  • A. The value 1 in GRP_LOC means that the LOCATION_ID column is taken into account to generate the subtotal.
  • B. The value 1 in GRP_JOB and GRP_LOC means that JOB_ID and LOCATION_ID columns are not taken into account to generate the subtotal.
  • C. The value 1 in GRP_JOB and GRP_LOC means that the NULL value in JOB_ID and LOCATION_ID columns are taken into account to generate the subtotal.
  • D. The value 0 in GRP_DEPT, GRP_JOB, and GRP_LOC means that DEPARTMENT_ID, JOB_ID, and LOCATION_ID columns are taken into account to generate the subtotal.

Question 33

Question
View the Exhibit and examine the description of the DEPARTMENTS and EMPLOYEES tables. To retrieve data for all the employees for their EMPLOYEE_ID, FIRST_NAME, and DEPARTMENT NAME, the following SQL statement was written: SELECT employee_id, first_name, department_name FROM employees NATURAL JOIN departments; The desired output is not obtained after executing the above SQL statement. What could be the reason for this?
Answer
  • A. The NATURAL JOIN clause is missing the USING clause.
  • B. The table prefix is missing for the column names in the SELECT clause.
  • C. The DEPARTMENTS table is not used before the EMPLOYEES table in the FROM clause.
  • D. The EMPLOYEES and DEPARTMENTS tables have more than one column with the same column name and data type.

Question 34

Question
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?
Answer
  • A. UPDATE dept d SET city = ANY (SELECT city FROM locations l);
  • B. UPDATE dept d SET city = (SELECT city FROM locations l) WHERE d.location_id = l.location_id;
  • C. UPDATE dept d SET city = (SELECT city FROM locations l WHERE d.location_id = l.location_id);
  • D. UPDATE dept d SET city = ALL (SELECT city FROM locations l WHERE d.location_id = l.location_id);

Question 35

Question
View the Exhibit and examine the data in the LOCATIONS table. Evaluate the following SQL statement: SELECT street_address FROM locations WHERE REGEXP_INSTR(street_address,'[^[:alpha:]]') = 1; Which statement is true regarding the output of this SQL statement?
Answer
  • A. It would display all the street addresses that do not have a substring 'alpha'.
  • B. It would display all the street addresses where the first character is a special character.
  • C. It would display all the street addresses where the first character is a letter of the alphabet.
  • D. It would display all the street addresses where the first character is not a letter of the alphabet.

Question 36

Question
Evaluate the following expression using meta character for regular expression: '[^Ale|ax.r$]' Which two matches would be returned by this expression? (Choose two.)
Answer
  • A. Alex
  • B. Alax
  • C. Alxer
  • D. Alaxendar
  • E. Alexender

Question 37

Question
The ORDERS table belongs to the user OE. OE has granted the SELECT privilege on the ORDERS table to the user HR. Which statement would create a synonym ORD so that HR can execute the following query successfully? SELECT * FROM ord;
Answer
  • A. CREATE SYNONYM ord FOR orders; This command is issued by OE.
  • B. CREATE PUBLIC SYNONYM ord FOR orders; This command is issued by OE.
  • C. CREATE SYNONYM ord FOR oe.orders; This command is issued by the database administrator.
  • D. CREATE PUBLIC SYNONYM ord FOR oe.orders; This command is issued by the database administrator.

Question 38

Question
View the Exhibit and examine the description of the EMPLOYEES and DEPARTMENTS tables. You want to display the LAST_NAME for the employees, LAST_NAME for the manager of the employees, and the DEPARTMENT_NAME for the employees having 100 as MANAGER_ID. The following SQL statement was written: SELECT m.last_name "Manager", e.last_name "Employee", department_name "Department" FROM employees m JOIN employees e ON (m.employee_id = e.manager_id) WHERE e.manager_id=100 JOIN departments d ON (e.department_id = d.department_id); Which statement is true regarding the output of this SQL statement?
Answer
  • A. The statement would provide the desired results.
  • B. The statement would not execute because the ON clause is written twice.
  • C. The statement would not execute because the WHERE clause is wrongly placed.
  • D. The statement would not execute because the self join uses the ON clause instead of the USING clause.

Question 39

Question
Evaluate the following DELETE statement: DELETE FROM orders; There are no other uncommitted transactions on the ORDERS table. Which statement is true about the DELETE statement?
Answer
  • A. It removes all the rows in the table and allows ROLLBACK.
  • B. It would not remove the rows if the table has a primary key.
  • C. It removes all the rows as well as the structure of the table.
  • D. It removes all the rows in the table and does not allow ROLLBACK.

Question 40

Question
View the Exhibit and examine the structure of ORDERS and ORDER_ITEMS tables. ORDER_ID is the primary key in the ORDERS table. It is also the foreign key in the ORDER_ITEMS table wherein it is created with the ON DELETE CASCADE option. Which DELETE statement would execute successfully?
Answer
  • A. DELETE order_id FROM orders WHERE order_total < 1000;
  • B. DELETE orders WHERE order_total < 1000;
  • C. DELETE FROM orders WHERE (SELECT order_id FROM order_items);
  • D. DELETE orders o, order_items i WHERE o.order_id = i.order_id;

Question 41

Question
View the Exhibit and examine the description for EMPLOYEES and DEPARTMENTS tables. Evaluate the following SQL statement: SELECT e.department_id, e.job_id, d.location_id, sum(e.salary) total FROM employees e JOIN departments d ON e.department_id = d.department_id GROUP BY CUBE (e.department_id, e.job_id, d.location_id); Which two statements are true regarding the output of this command? (Choose two.)
Answer
  • A. The output would display the total salary for all the departments.
  • B. The output would display the total salary for all the JOB_IDs in a department.
  • C. The output would display only the grand total of the salary for all JOB_IDs in a LOCATION_ID.
  • D. The output would display the grand total of the salary for only the groups specified in the GROUP BY clause.

Question 42

Question
View the Exhibit and examine the data in EMP and DEPT tables. In the DEPT table, DEPTNO is the PRIMARY KEY. In the EMP table, EMPNO is the PRIMARY KEY and DEPTNO is the FOREIGN KEY referencing the DEPTNO column in the DEPT table. What would be the outcome of the following statements executed in the given sequence? DROP TABLE emp; FLASHBACK TABLE emp TO BEFORE DROP; INSERT INTO emp VALUES (2,COTT 10); INSERT INTO emp VALUES (3,ING 55);
Answer
  • A. Both the INSERT statements would fail because all constraints are automatically retrieved when the table is flashed back.
  • B. Both the INSERT statements would succeed because none of the constraints on the table are automatically retrieved when the table is flashed back.
  • C. Only the first INSERT statement would succeed because all the constraints except the primary key constraint are automatically retrieved after a table is flashed back.
  • D. Only the second INSERT statement would succeed because all the constraints except referential integrity constraints that reference other tables are retrieved automatically after the table is flashed back.

Question 43

Question
View the Exhibit and examine the structure of the ORDERS table. The ORDER_ID column is the PRIMARY KEY in the ORDERS table. Evaluate the following CREATE TABLE command: CREATE TABLE new_orders(ord_id, ord_date DEFAULT SYSDATE, cust_id) AS SELECT order_id,order_date,customer_id FROM orders; Which statement is true regarding the above command?
Answer
  • A. The NEW_ORDERS table would not get created because the DEFAULT value cannot be specified in the column definition.
  • B. The NEW_ORDERS table would get created and only the NOT NULL constraint defined on the specified columns would be passed to the new table.
  • C. The NEW_ORDERS table would not get created because the column names in the CREATE TABLE command and the SELECT clause do not match.
  • D. The NEW_ORDERS table would get created and all the constraints defined on the specified columns in the ORDERS table would be passed to the new table.

Question 44

Question
Which two statements are true regarding the GROUP BY clause in a SQL statement? (Choose two.)
Answer
  • A. You can use column alias in the GROUP BY clause.
  • B. Using the WHERE clause after the GROUP BY clause excludes the rows after creating groups.
  • C. The GROUP BY clause is mandatory if you are using an aggregate function in the SELECT clause.
  • D. Using the WHERE clause before the GROUP BY clause excludes the rows before creating groups.
  • E. If the SELECT clause has an aggregate function, then those individual columns without an aggregate function in the SELECT clause should be included in the GROUP BY clause.

Question 45

Question
Which statement is true regarding synonyms?
Answer
  • A. Synonyms can be created for tables but not views.
  • B. Synonyms are used to reference only those tables that are owned by another user.
  • C. A public synonym and a private synonym can exist with the same name for the same table.
  • D. The DROP SYNONYM statement removes the synonym, and the status of the table on which the synonym has been created becomes invalid.

Question 46

Question
Evaluate the following command: CREATE TABLE employees (employee_id NUMBER(2) PRIMARY KEY, last_name VARCHAR2(25) NOT NULL, department_id NUMBER(2), job_id VARCHAR2(8), salary NUMBER(10,2)); You issue the following command to create a view that displays the IDs and last names of the sales staff in the organization: CREATE OR REPLACE VIEW sales_staff_vu AS SELECT employee_id, last_name,job_id FROM employees WHERE job_id LIKE 'SA_%' WITH CHECK OPTION; Which statements are true regarding the above view? (Choose all that apply.)
Answer
  • A. It allows you to insert details of all new staff into the EMPLOYEES table.
  • B. It allows you to delete the details of the existing sales staff from the EMPLOYEES table.
  • C. It allows you to update the job ids of the existing sales staff to any other job id in the EMPLOYEES table.
  • D. It allows you to insert the IDs, last names and job ids of the sales staff from the view if it is used in multitable INSERT statements.

Question 47

Question
View the Exhibit and examine the structure of EMPLOYEES and JOB_HISTORY tables. The EMPLOYEES table maintains the most recent information regarding salary, department, and job for all the employees. The JOB_HISTORY table maintains the record for all the job changes for the employees. You want to delete all the records from the JOB_HISTORY table that are repeated in the EMPLOYEES table. Which two SQL statements can you execute to accomplish the task? (Choose two.)
Answer
  • A. DELETE FROM job_history j WHERE employee_id = (SELECT employee_id FROM employees e WHERE j.employee_id = e.employee_id) AND job_id = (SELECT job_id FROM employees e WHERE j.job_id = e.job_id);
  • B. DELETE FROM job_history j WHERE (employee_id, job_id) = ALL (SELECT employee_id, job_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id )
  • C. DELETE FROM job_history j WHERE employee_id = (SELECT employee_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id )
  • D. DELETE FROM job_history j WHERE (employee_id, job_id) = (SELECT employee_id, job_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id )

Question 48

Question
The user SCOTT who is the owner of ORDERS and ORDER_ITEMS tables issues the following GRANT command: GRANT ALL ON orders, order_items TO PUBLIC; What correction needs to be done to the above statement?
Answer
  • A. PUBLIC should be replaced with specific usernames.
  • B. ALL should be replaced with a list of specific privileges.
  • C. WITH GRANT OPTION should be added to the statement.
  • D. Separate GRANT statements are required for ORDERS and ORDER_ITEMS tables.

Question 49

Question
Given below is a list of functions and the tasks performed by using these functions, in random order. Function Usage 1) LPAD a) Used to truncate a column, expression, or value to n decimal places 2) TRUNC b) Used to remove heading or trailing or both characters from the character string 3) DECODE c) Pads the character value right-justified to a total width of n character positions 4) TRIM d) Used to return the numeric value for position of a named character from the character string 5) INSTR e) Used to translate an expression after comparing it with each search value Which option correctly matches the function names with their usage?
Answer
  • A. 1-c, 2-b, 3-e, 4-a, 5-d
  • B. 1-e, 2-b, 3-c, 4-a, 5-d
  • C. 1-e, 2-a, 3-c, 4-d, 5-b
  • D. 1-c, 2-a, 3-e, 4-b, 5-d

Question 50

Question
Which statement is true regarding the CUBE operator in the GROUP BY clause of a SQL statement?
Answer
  • A. It produces only aggregates for the groups specified in the GROUP BY clause.
  • B. It finds all the NULL values in the superaggregates for the groups specified in the GROUP BY clause.
  • C. It produces 2 n possible superaggregate combinations, if the n columns and expressions are specified in the GROUP BY clause.
  • D. It produces n+1 possible superaggregate combinations, if the n columns and expressions are specified in the GROUP BY clause.

Question 51

Question
Which statement is true regarding the SESSION_PRIVS dictionary view?
Answer
  • A. It contains the current object privileges available in the user session.
  • B. It contains the current system privileges available in the user session.
  • C. It contains the object privileges granted to other users by the current user session.
  • D. It contains the system privileges granted to other users by the current user session.

Question 52

Question
View the Exhibit and examine the details for the CATEGORIES_TAB table. Evaluate the following incomplete SQL statement: SELECT category_name,category_description FROM categories_tab You want to display only the rows that have 'harddisks' as part of the string in the CATEGORY_DESCRIPTION column. Which two WHERE clause options can give you the desired result? (Choose two.)
Answer
  • A. WHERE REGEXP_LIKE (category_description, 'hard+.s');
  • B. WHERE REGEXP_LIKE (category_description, '^H|hard+.s');
  • C. WHERE REGEXP_LIKE (category_description, '^H|hard+.s$');
  • D. WHERE REGEXP_LIKE (category_description, '[^H|hard+.s]');

Question 53

Question
Which two statements are true regarding roles? (Choose two.)
Answer
  • A. A role can be granted to itself.
  • B. A role can be granted to PUBLIC.
  • C. A user can be granted only one role at any point of time.
  • D. The REVOKE command can be used to remove privileges but not roles from other users.
  • E. Roles are named groups of related privileges that can be granted to users or other roles.

Question 54

Question
View the Exhibit and examine the data in the CUST_DET table. You executed the following multitable INSERT statement: INSERT FIRST WHEN credit_limit >= 5000 THEN INTO cust_1 VALUES(cust_id, credit_limit, grade, gender) WHEN grade = THEN INTO cust_2 VALUES(cust_id, credit_limit, grade, gender) WHEN grade = THEN INTO cust_3 VALUES(cust_id, credit_limit, grade, gender) INTO cust_4 VALUES(cust_id, credit_limit, grade, gender) ELSE INTO cust_5 VALUES(cust_id, credit_limit, grade, gender) SELECT * FROM cust_det; The row will be inserted in _______.
Answer
  • A. CUST_1 table only because CREDIT_LIMIT condition is satisfied
  • B. CUST_1 and CUST_2 tables because CREDIT_LIMIT and GRADE conditions are satisfied
  • C. CUST_1,CUST_2 and CUST_5 tables because CREDIT_LIMIT and GRADE conditions are satisfied but GENDER condition is not satisfied
  • D. CUST_1, CUST_2 and CUST_4 tables because CREDIT_LIMIT and GRADE conditions are satisfied for CUST_1 and CUST_2, and CUST_4 has no condition on it

Question 55

Question
View the Exhibit and examine the data in the EMPLOYEES tables. Evaluate the following SQL statement: SELECT employee_id, department_id FROM employees WHERE department_id= 50 ORDER BY department_id UNION SELECT employee_id, department_id FROM employees WHERE department_id= 90 UNION SELECT employee_id, department_id FROM employees WHERE department_id= 10; What would be the outcome of the above SQL statement?
Answer
  • A. The statement would execute successfully and display all the rows in the ascending order of DEPARTMENT_ID.
  • B. The statement would execute successfully but it will ignore the ORDER BY clause and display the rows in random order.
  • C. The statement would not execute because the positional notation instead of the column name should be used with the ORDER BY clause.
  • D. The statement would not execute because the ORDER BY clause should appear only at the end of the SQL statement, that is, in the last SELECT statement.

Question 56

Question
Evaluate the SQL statements: CREATE TABLE new_order (orderno NUMBER(4), booking_date TIMESTAMP WITH LOCAL TIME ZONE); The database is located in San Francisco where the time zone is -8:00. The user is located in New York where the time zone is -5:00. A New York user inserts the following record: INSERT INTO new_order VALUES(1, TIMESTAMP ?007-05-10 6:00:00 -5:00?); Which statement is true?
Answer
  • A. When the New York user selects the row, booking_date is displayed as '007-05-10 3.00.00.000000'
  • B. When the New York user selects the row, booking_date is displayed as '2007-05-10 6.00.00.000000 -5:00'.
  • C. When the San Francisco user selects the row, booking_date is displayed as '007-05-10 3.00.00.000000'
  • D. When the San Francisco user selects the row, booking_date is displayed as '007-05-10 3.00.00.000000 -8:00'
Show full summary Hide full summary

Similar

1Z0-047_2.pdf - Part I
anillvap
1Z0-047_2.pdf - Part III
anillvap
10 Mind Mapping Strategies for Teachers
Andrea Leyden
01 Long Term causes of the French Revolution
Holly Lovering
Biology- Genes, Chromosomes and DNA
Laura Perry
A level Computing Quiz
Zacchaeus Snape
An Inspector Calls: Mr Arthur Birling
Rattan Bhorjee
An Inspector Calls
Georgia 27
AQA GCSE Physics Unit 3 Mindmap
Gabi Germain
An Inspector Calls - Quotes and Context
James Holder
Mapa Mental para Resumir y Conectar Ideas
Rosario Sharline Vilcarromero Saenz