oracle 1z0-071_2 free exam questions
oracle 1z0-071_2 free exam questions
Oracle
Exam Questions 1Z0-071
Oracle Database 12c SQL
NEW QUESTION 1
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(emp_no)); 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_PK?
A. It would remain disabled and can be enabled only by dropping the foreign key constraint and recreating it.
B. It would remain disabled and has to be enabled manually using the ALTER TABLE command.
C. It would be automatically enabled and immediate.
D. It would be automatically enabled and deferred.
Answer: B
NEW QUESTION 2
View the Exhibit and examine the structure of the EMPLOYEES and JOB_HISTORY tables. (Choose all that apply.)
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.
A. UNION
B. MINUS
C. INTERSECT
D. UNION ALL
Answer: AD
NEW QUESTION 3
Evaluate this ALTER TABLE statement: (Choose the best answer.) ALTER TABLE orders
SET UNUSED (order_date); Which statement is true?
A. After executing the ALTER TABLE command, a new column called ORDER_DATE can be added to the ORDERS table.
B. The ORDER_DATE column must be empty for the ALTER TABLE command to execute successfully.
C. ROLLBACK can be used to restore the ORDER_DATE column.
D. The DESCRIBE command would still display the ORDER_DATE column.
Answer: A
NEW QUESTION 4
Which task can be performed by using a single Data Manipulation Language (DML) statement?
A. Removing all data only from a single column on which a primary key constraint is defined.
B. Removing all data from a single column on which a unique constraint is defined.
C. Adding a column with a default value while inserting a row into a table.
D. Adding a column constraint while inserting a row into a table.
Answer: A
NEW QUESTION 5
View the exhibit and examine the structure of the CUSTOMERS table.
Which two tasks would require subqueries or joins to be executed in a single statement?
A. finding the number of customers, in each city, whose credit limit is more than the average credit limit of all the customers
B. finding the average credit limit of male customers residing in 'Tokyo' or 'Sydney'
C. listing of customers who do not have a credit limit and were born before 1980
D. finding the number of customers, in each city, who’s marital status is 'married'.
E. listing of those customers, whose credit limit is the same as the credit limit of customers residing in the city 'Tokyo'.
Answer: AE
NEW QUESTION 6
You must create a SALES table with these column specifications and data types: (Choose the best answer.) SALESID: Number
STOREID: Number ITEMID: Number
QTY: Number, should be set to 1 when no value is specified
SLSDATE: Date, should be set to current date when no value is specified
PAYMENT: Characters up to 30 characters, should be set to CASH when no value is specified Which statement would create the table?
A. CREATE TABLE Sales(SALESID NUMBER (4),STOREID NUMBER (4),ITEMID NUMBER (4),QTY NUMBER DEFAULT = 1,SLSDATE DATE DEFAULT
SYSDATE,PAYMENT VARCHAR2(30) DEFAULT = "CASH");
B. CREATE TABLE Sales(SALESID NUMBER (4),STOREID NUMBER (4),ITEMID NUMBER (4),QTY NUMBER DEFAULT = 1,SLSDATE DATE DEFAULT
'SYSDATE',PAYMENT VARCHAR2(30) DEFAULT CASH);
C. CREATE TABLE Sales(SALESID NUMBER (4),STOREID NUMBER (4),ITEMID NUMBER (4),qty NUMBER DEFAULT = 1,SLSDATE DATE DEFAULT
SYSDATE,PAYMENT VARCHAR2(30) DEFAULT = "CASH");
D. Create Table sales(salesid NUMBER (4),Storeid NUMBER (4),Itemid NUMBER (4),QTY NUMBER DEFAULT 1,Slsdate DATE DEFAULT SYSDATE,payment
VARCHAR2(30) DEFAULT 'CASH');
Answer: D
NEW QUESTION 7
Which statement is true regarding the UNION operator?
Answer: B
NEW QUESTION 8
Examine the data in the CUST_NAME column of the CUSTOMERS table.
CUST_NAME
-------------------
Renske Ladwig Jason Mallin Samuel McCain Allan MCEwen Irene Mikilineni Julia Nayer
You need to display customers' second names where the second name starts with "Mc" or "MC". Which query gives the required output?
A. SELECT SUBSTR (cust_name, INSTR (cust_name, ' ')+1)FROM customersWHERE SUBSTR (cust_name, INSTR (cust_name, ' ')+1)LIKE INITCAP ('MC%');
B. SELECT SUBSTR (cust_name, INSTR (cust_name, ' ')+1)FROM customersWHERE INITCAP (SUBSTR(cust_name, INSTR (cust_name, ' ')+1)) ='Mc';
C. SELECT SUBSTR (cust_name, INSTR (cust_name, ' ')+1)FROM customersWHERE INITCAP (SUBSTR(cust_name, INSTR (cust_name, ' ')+1))LIKE 'Mc%';
D. SELECT SUBSTR (cust_name, INSTR (cust_name, ' ')+1)FROM customersWHERE INITCAP (SUBSTR(cust_name, INSTR (cust_name, ' ')+1)) =INITCAP
'MC%';
Answer: C
NEW QUESTION 9
You issued the following command: SQL> DROP TABLE employees; Which three statements are true?
Answer: ABF
NEW QUESTION 10
Which three SQL statements would display the value 1890.55 as $1,890.55? (Choose three.)
Answer: ACE
NEW QUESTION 10
Examine the structure of the MEMBERS table: NameNull?Type
------------------------------------------------------------ MEMBER_IDNOT NULLVARCHAR2 (6)
FIRST_NAMEVARCHAR2 (50)
LAST_NAMENOT NULLVARCHAR2 (50)
ADDRESSVARCHAR2 (50)
CITYVARCHAR2 (25)
STATEVARCHAR2 (3)
You want to display details of all members who reside in states starting with the letter A followed by exactly one character.
Which SQL statement must you execute?
Answer: B
NEW QUESTION 13
View the Exhibit and examine the structure of the SALES and PRODUCTS tables. (Choose two.)
In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS table. You must list each product ID and the number of times it has
been sold.
Examine this query which is missing a JOIN operator: SQL > SELECT p.prod_id, count(s.prod_id)
FROM products p sales s ON p.prod_id = s.prod_id
GROUP BY p.prod_id;
Which two JOIN operations can be used to obtain the required output?
Answer: AC
NEW QUESTION 17
Which two statements are true regarding the EXISTS operator used in the correlated subqueries? (Choose two.)
A. The outer query stops evaluating the result set of the inner query when the first value is found.
B. It is used to test whether the values retrieved by the inner query exist in the result of the outer query.
C. It is used to test whether the values retrieved by the outer query exist in the result set of the inner query.
D. The outer query continues evaluating the result set of the inner query until all the values in the result set are processed.
Answer: AC
Explanation:
References:
http://www.techonthenet.com/oracle/exists.php
NEW QUESTION 21
Examine the business rule:
Each student can work on multiple projects and each project can have multiple students.
You need to design an Entity Relationship Model (ERD) for optimal data storage and allow for generating reports in this format:
STUDENT_ID FIRST_NAME LAST_NAME PROJECT_ID PROJECT_NAME PROJECT_TASK
Which two statements are true in this scenario?
A. The ERD must have a 1:M relationship between the STUDENTS and PROJECTS entities.
B. The ERD must have a M:M relationship between the STUDENTS and PROJECTS entities that must be resolved into 1:M relationships.
C. STUDENT_ID must be the primary key in the STUDENTS entity and foreign key in the PROJECTS entity.
D. PROJECT_ID must be the primary key in the PROJECTS entity and foreign key in the STUDENTS entity.
E. An associative table must be created with a composite key of STUDENT_ID and PROJECT_ID, which is the foreign key linked to the STUDENTS and
PROJECTS entities.
Answer: BE
Explanation:
References:
http://www.oracle.com/technetwork/issue-archive/2011/11-nov/o61sql-512018.html
NEW QUESTION 22
View the Exhibit and examine the data in the PRODUCTS table. (Choose the best answer.)
You must display product names from the PRODUCTS table that belong to the 'Software/other' category with minimum prices as either $2000 or $4000 and with
no unit of measure.
You issue this query:
SQL > SELECT prod_name, prod_category, prod_min_price FROM products
Where prod_category LIKE '%Other%' AND (prod_min_price = 2000 OR prod_min_price = 4000) AND prod_unit_of_measure <> ' ';
Which statement is true?
Answer: A
NEW QUESTION 24
View the Exhibit and examine the structures of the employees and departments tables.
Answer: A
NEW QUESTION 26
When does a transaction complete? (Choose all that apply.)
Answer: CDE
NEW QUESTION 30
Which statements are true? (Choose all that apply.)
D. The USER_CONS_COLUMNS view should be queried to find the names of the columns to which a constraint applies.
E. Both USER_OBJECTS and CAT views provide the same information about all the objects that are owned by the user.
F. Views with the same name but different prefixes, such as DBA, ALL and USER, use the same base tables from the data dictionary.
Answer: CDF
Explanation:
References:
https://docs.oracle.com/cd/B10501_01/server.920/a96524/c05dicti.htm
NEW QUESTION 35
Which statement is true regarding the INTERSECT operator?
Answer: D
Explanation:
INTERSECT Returns only the rows that occur in both queries' result sets, sorting them and removing duplicates.
The columns in the queries that make up a compound query can have different names, but the output result set will use the names of the columns in the first
query.
References:
http://oraclexpert.com/using-the-set-operators/
NEW QUESTION 38
View the Exhibit and examine the structure of the CUSTOMERS table.
Using the CUSTOMERS table, you must generate a report that displays a credit limit increase of 15% for all customers.
Customers with no credit limit should have “Not Available” displayed. Which SQL statement would produce the required result?
Answer: C
NEW QUESTION 43
Which statement is true regarding the default behavior of the ORDER BY clause?
Answer: A
NEW QUESTION 46
Which two partitioned table maintenance operations support asynchronous Global Index Maintenance in Oracle database 12c?
Answer: CE
NEW QUESTION 48
Which two are the minimal requirements for a self-join? (Choose two.)
Answer: CE
NEW QUESTION 49
You need to produce a report where each customer’s credit limit has been incremented by $1000. In the output, the customer’s last name should have the
heading Name and the incremented credit limit should be labeled New Credit Limit. The column headings should have only the first letter of each word in
uppercase.
Which statement would accomplish this requirement?
Answer: A
NEW QUESTION 52
Which two statements are true regarding constraints? (Choose two.)
Answer: CD
NEW QUESTION 55
Examine the commands used to create the DEPARTMENT_DETAILS and the COURSE-DETAILS tables: SQL> CREATE TABLE DEPARTMfiNT_D£TAILS
DEPARTMENT_ID NUMBER PRIMARY KEY , DEPARTMEHT_NAME VARCHAR2(50) ,
HOD VARCHAP2(50));
SQL> CREATE TABLE COURSE-DETAILS (COURSE ID NUMBER PRIMARY KEY , COURS_NAME VARCHAR2 (50) ,
DEPARTMEHT_ID NUMBER REFERENCES DEPARTMENT_DETAIL
You want to generate a list of all department IDs along with any course IDs that may have been assigned to them.
Which SQL statement must you use?
A. SELECT d.departranc_id, c.cours«_id FROM cource_deatils c LEFT OUTER JOIN departmnt_details d ON (c.dapartmsnt_id=d.departtnent_id);
B. SELECT d.department_id,
C. course_id FROM dapartment_details d RIGHT OUTER JOIN course_dotails c ON (c.depattnient_id=d.department_id) ;
D. SELECT d.department i
E. ccours_id FROM department_details d RIGHT OUTER JOIN course_details c ON (d.department_id);
F. SELECT d.department_id, c.course_id FROM department_details d LEFT OUTER JOIN course_details c ON (d.department id).- (DEPARTMENT_ID) ;
Answer: D
NEW QUESTION 57
View the exhibit and examine the ORDERS table. ORDERS
Name Null? Type
ORDER ID NOT NULL NUMBER(4) ORDATE DATE DATE CUSTOMER ID NUMBER(3) ORDER TOTAL NUMBER(7,2)
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: C
NEW QUESTION 62
Which three statements are true regarding single-row functions? (Choose three.)
A. The data type returned, can be different from the data type of the argument that is referenced.
B. They can return multiple values of more than one data type.
C. They can accept only one argument.
D. They can be nested up to only two levels.
Answer: AEF
NEW QUESTION 63
View the Exhibit and examine the structure of the EMP table which is not partitioned and not an index-organized table. (Choose two.)
A. The FIRST_NAME column can be dropped even if it is part of a composite PRIMARY KEY provided the CASCADE option is added to the SQL statement.
B. The FIRST_NAME column would be dropped provided at least one column remains in the table.
C. The FIRST_NAME column would be dropped provided it does not contain any data.
D. The drop of the FIRST_NAME column can be rolled back provided the SET UNUSED option is added to the SQL statement.
Answer: B
NEW QUESTION 68
Examine the structure of the PROMOTIONS table: (Choose the best answer.)
Management requires a report of unique promotion costs in each promotion category. Which query would satisfy this requirement?
Answer: A
NEW QUESTION 73
The first DROP operation is performed on PRODUCTS table using the following command: DROP TABLE products PURGE;
Then you performed the FLASHBACK operation by using the following command: FLASHBACK TABLE products TO BEFORE DROP;
Which statement describes the outcome of the FLASHBACK command?
Answer: D
Explanation:
References:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9003.htm
NEW QUESTION 78
View the exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES
NameNull?Type
---------------------- ------------- EMPLOYEE_IDNOT NULLNUMBER(6) FIRST_NAMEVARCHAR2(20) LAST_NAMENOT NULLVARCHAR2(25) HIRE_DATENOT
NULLDATE JOB_IDNOT NULLVARCHAR2(10) SALARYNUMBER(10,2) COMMISSIONNUMBER(6,2) MANAGER_IDNUMBER(6)
DEPARTMENT_IDNUMBER(4) DEPARTMENTS
NameNull?Type
---------------------- -------------
DEPARTMENT_IDNOT NULLNUMBER(4) DEPARTMENT_NAMENOT NULLVARCHAR2(30) MANAGER_IDNUMBER(6) LOCATION_IDNUMBER(4)
You want to update EMPLOYEES table as follows: You issue the following command:
SQL> UPDATE employees SET department_id = (SELECT department_id FROM departments
WHERE location_id = 2100), (salary, commission) =
(SELECT 1.1*AVG(salary), 1.5*AVG(commission) FROM employees, departments
WHERE departments.location_id IN(2900, 2700, 2100))
WHERE department_id IN (SELECT department_id FROM departments WHERE location_id = 2900 OR location_id = 2700; What is outcome?
A. It generates an error because multiple columns (SALARY, COMMISSION) cannot be specified together in an UPDATE statement.
B. It generates an error because a subquery cannot have a join condition in a UPDATE statement.
C. It executes successfully and gives the desired update
D. It executes successfully but does not give the desired update
Answer: D
NEW QUESTION 80
Examine the structure of the EMPLOYEES table. (Choose two.)
You must display the maximum and minimum salaries of employees hired 1 year ago. Which two statements would provide the correct output?
A. SELECT MIN(Salary) minsal, MAX(salary) maxsalFROM employeesWHERE hire_date < SYSDATE-365GROUP BY MIN(salary), MAX(salary);
B. SELECT minsal, maxsalFROM (SELECT MIN(salary) minsal, MAX(salary) maxsal FROM employeesWHERE hire_date < SYSDATE-365)GROUP BY maxsal,
minsal;
C. SELECT minsal, maxsalFROM (SELECT MIN(salary) minsal, MAX(salary) maxsal FROM employeesWHERE hire_date < SYSDATE-365GROUP BY
MIN(salary), MAX(salary);
D. SELECT MIN(Salary), MAX(salary)FROM (SELECT salary FROM employeesWHERE hire_date < SYSDATE-365);
Answer: BD
NEW QUESTION 84
Examine the structure of the SALES table. (Choose two.)
A. It will not be created because the column-specified names in the SELECT and CREATE TABLE clauses do not match.
B. It will have NOT NULL constraints on the selected columns which had those constraints in the SALES table.
C. It will not be created because of the invalid WHERE clause.
D. It is created with no rows.
E. It has PRIMARY KEY and UNIQUE constraints on the selected columns which had those constraints in the SALES table.
Answer: BD
NEW QUESTION 87
View the Exhibit and examine the structure of the ORDER_ITEMS table. (Choose the best answer.)
You must select the ORDER_ID of the order that has the highest total value among all the orders in the ORDER_ITEMS table.
Which query would produce the desired result?
Answer: A
NEW QUESTION 92
Which two statements are true regarding subqueries? (Choose two.)
Answer: AC
NEW QUESTION 93
Examine the structure of the CUSTOMERS table: (Choose two.)
A. Subquery
B. Self-join
C. Full outer-join with self-join
D. Left outer-join with self-join
E. Right outer-join with self-join
Answer: AB
NEW QUESTION 96
View the exhibit and examine the description of the DEPARTMENTS and EMPLOYEES tables.
The 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?
A. The table prefix is missing for the column names in the SELECT clause.
B. The NATURAL JOIN clause is missing the USING 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.
Answer: D
Explanation:
Natural join needs only one column to be the same in each table. The EMPLOYEES and DEPARTMENTS tables have two columns that are the same
(Department_ID and Manager_ID)
A. The DELETE_RULE column indicates the desired state of related rows in the child table when the corresponding row is deleted from the parent table.
B. The R_CONSTRAINT_NAME column contains an alternative name for the constraint.
C. In the second column, 'c' indicates a check constraint.
D. The STATUS column indicates whether the table is currently in use.
Answer: AC
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?
A. The statement would not execute because the positional notation instead of the column name should be used with the ORDER BY clause.
B. The statement would execute successfully and display all the rows in the ascending order of DEPARTMENT_ID.
C. The statement would execute successfully but it will ignore the ORDER BY clause and display the rows in random order.
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.
Answer: D
A. The CREATE TABLE AS SELECT statement can be used to upload data into regular table in the database from an external table.
B. The data and metadata for an external table are stored outside the database.
C. The default REJECT LIMIT for external tables is UNLIMITED.
D. ORACLE_LOADER and ORACLE_DATAPUMP have exactly the same functionality when used with an external table.
Answer: A
Explanation:
References:
https://docs.oracle.com/cd/B28359_01/server.111/b28310/tables013.htm
Answer: B
Answer: ABD
A. The nested query executes after the outer query returns the row.
B. The nested query executes first and then the outer query executes.
C. The outer query executes only once for the result returned by the inner query.
D. Each row returned by the outer query is evaluated for the results returned by the inner query.
Answer: AD
* 1Z0-071 Most Realistic Questions that Guarantee you a Pass on Your FirstTry
* 1Z0-071 Practice Test Questions in Multiple Choice Formats and Updatesfor 1 Year