Oracle Database 12c SQL 1Z0 071 Exam
Oracle Database 12c SQL 1Z0 071 Exam
ORACLE
QUESTION 1
You issue the following command to drop the PRODUCTS table:
Which three statements are true about the implication of this command?
Explanation/Reference:
QUESTION 2
You execute the following commands:
For which substitution variables are you prompted for the input?
Correct Answer: D
Explanation/Reference:
QUESTION 3
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?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 4
View the Exhibit and examine the structure of CUSTOMERS table.
Using the CUSTOMERS table, you need to generate a report that shows an increase in the credit limit by 15% for all customers. Customers whose credit limit has not
been entered should have the message "Not Available" displayed.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 5
EMPLOYEES
Name Null? Type
----------------- ----- -------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(10,2)
COMMISSION NUMBER(6,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
DEPARTMENTS
Name Null? Type
----------------- ----- -------------
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
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 correct result.
D. It executes successfully but does not give the correct result.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 6
Evaluate the following two queries:
A. Performance would improve in query 2 only if there are null values in the CUST_CREDIT_LIMIT column.
B. There would be no change in performance.
C. Performance would degrade in query 2.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
References:
http://oraclexpert.com/restricting-and-sorting-data/
QUESTION 7
Examine the business rule:
Each student can take up 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:
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.
Correct Answer: BE
Section: (none)
Explanation
Explanation/Reference:
References:
http://www.oracle.com/technetwork/issue-archive/2011/11-nov/o61sql-512018.html
QUESTION 8
View the Exhibit and examine the details of PRODUCT_INFORMATION table.
You have the requirement to display PRODUCT_NAME from the table where the CATEGORY_ID column has values 12 or 13, and the SUPPLIER_ID column has the
value 102088. You executed the following SQL statement:
SELECT product_name
FROM product_information
WHERE (category_id = 12 AND category_id = 13) AND supplier_id = 102088;
A. It would not execute because the same column has been used in both sides of the AND logical operator to form the condition.
B. It would not execute because the entire WHERE clause condition is not enclosed within the parentheses.
C. It would execute and the output would display the desired result.
D. It would execute but the output would return no rows.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 9
Which two statements are true regarding the EXISTS operator used in the correlated subqueries? (Choose two.)
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
References:
http://www.techonthenet.com/oracle/exists.php
QUESTION 10
View the exhibit and examine the structure of the STORES table.
STORES table
Name Null? Type
----------------- ----- -------------
STORE_ID NUMBER
NAME VARCHAR2(100)
ADDRESS VARCHAR2(200)
CITY VARCHAR2(100)
COUNTRY VARCHAR2(100)
START_DATE DATE
END_DATE DATE
PROPERTY_PRICE NUMBER
You want to display the NAME of the store along with the ADDRESS, START_DATE, PROPERTY_PRICE, and the projected property price, which is 115% of property
price.
The stores displayed must have START_DATE in the range of 36 months starting from 01-Jan-2000 and above.
Which SQL statement would get the desired output?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 11
The BOOKS_TRANSACTIONS table exists in your database.
A. The execution fails unless the numeral 3 in the ORDER BY clause is replaced by a column name.
B. Rows are displayed in the order that they are stored in the table only for the three rows with the lowest values in the key column.
C. Rows are displayed in the order that they are stored in the table only for the first three rows.
D. Rows are displayed sorted in ascending order of the values in the third column in the table.
Explanation/Reference:
QUESTION 12
Examine the command:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 13
View the exhibit and examine the structure of the EMPLOYEES table.
Correct Answer: B
Explanation/Reference:
QUESTION 14
Which three statements are true about multiple-row subqueries?
Explanation/Reference:
QUESTION 15
Examine the structure of the EMPLOYEES table.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 16
Which normal form is a table in if it has no multi-valued attributes and no partial
dependencies?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
References:
https://blog.udemy.com/database-normal-forms/
QUESTION 17
Sales data of a company is stored in two tables, SALES1 and SALES2, with some data being duplicated across the tables. You want to display the results from the
SALES1 table, which are not present in the SALES2 table.
SALES1 table
Name Null Type
------------------ ------------- ----------------
SALES_ID NUMBER
STORE_ID NUMBER
ITEMS_ID NUMBER
QUANTITY NUMBER
SALES_DATE DATE
SALES2 table
Name Null Type
---------------- ------------- -----------------
SALES_ID NUMBER
STORE_ID NUMBER
ITEMS_ID NUMBER
QUANTITY NUMBER
SALES_DATE DATE
A. INTERSECT
B. UNION
C. PLUS
D. MINUS
E. SUBTRACT
Explanation/Reference:
References:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries004.htm
QUESTION 18
Evaluate the following ALTER TABLE statement:
A. After executing the ALTER TABLE command, you can add a new column called ORDER_DATE to the ORDERS table.
B. The ORDER_DATE column should be empty for the ALTER TABLE command to execute succsessfully.
C. ROLLBACK can be used to get back the ORDER_DATE column in the ORDERS table.
D. The DESCRIBE command would still display the ORDER_DATE column.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 19
Evaluate the following SQL statements that are issued in the given order:
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.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 20
Which three statements are true regarding the data types?
A. The minimum column width that can be specified for a VARCHAR2 data type column is one.
B. Only one LONG column can be used per table.
C. A TIMESTAMP data type column stores only time values with fractional seconds.
D. The BLOB data type column is used to store binary data in an operating system file.
E. The value for a CHAR data type column is blank-padded to the maximum defined column width.
Explanation/Reference:
QUESTION 21
Which three statements are true regarding subqueries?
Explanation/Reference:
References:
http://docs.oracle.com/javadb/10.6.2.1/ref/rrefsqlj13658.html
QUESTION 22
Which statement is true regarding the default behavior of the ORDER BY clause?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Which query can be used to display the last names and city names only for members from the states MO and MI?
A. SELECT last_name, city FROM members WHERE state ='MO' AND state ='MI';
B. SELECT last_name, city FROM members WHERE state LIKE 'M%';
C. SELECT last_name, city FROM members WHERE state IN ('MO', 'MI');
D. SELECT DISTINCT last_name, city FROM members WHERE state ='MO' OR state ='MI';
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 24
Which task can be performed by using a single Data Manipulation Language (DML) statement?
Correct Answer: C
Section: (none)
Explanation
QUESTION 25
Examine the structure of the BOOKS_TRANSACTIONS table:
You want to display the member IDs, due date, and late fee as $2 for all transactions.
Which SQL statement must you execute?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 26
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)
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 27
Examine the structure of the INVOICE table.
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 28
Which three statements are true about the ALTER TABLE....DROP COLUMN.... command?
Explanation/Reference:
QUESTION 29
View the exhibit and examine the description of the PRODUCT_INFORMATION table.
Explanation/Reference:
QUESTION 30
Which three tasks can be performed using SQL functions built into Oracle Database?
Explanation/Reference:
QUESTION 31
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;
Correct Answer: D
Section: (none)
Explanation/Reference:
References:
http://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljgrant.html
QUESTION 32
You are designing the structure of a table in which two columns have the specifications:
COMPONENT_ID – must be able to contain a maximum of 12 alphanumeric characters and uniquely identify the row
EXECUTION_DATETIME – contains Century, Year, Month, Day, Hour, Minute, Second to the maximum precision and is used for calculations and comparisons
between components.
Which two options define the data types that satisfy these requirements most efficiently?
Correct Answer: CF
Section: (none)
Explanation
Explanation/Reference:
QUESTION 33
You want to display the date for the first Monday of the next month and issue the following command:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 34
Which two statements are true regarding the GROUP BY clause in a SQL statement? (Choose two.)
Correct Answer: DE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 35
Examine the commands used to create DEPARTMENT_DETAILS and COURSE_DETAILS:
You want to generate a list of all department IDs along with any course IDs that may have been assigned to them.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 36
Which two tasks can be performed by using Oracle SQL statements?
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
References:
http://www.techonthenet.com/oracle/password.php
https://docs.oracle.com/cd/B28359_01/server.111/b28324/tdpii_distdbs.htm
QUESTION 37
View the exhibit for the structure of the STUDENT and FACULTY tables.
STUDENT
Name Null? Type
------------------ ------------------- -------------
STUDENT_ID NOT NULL NUMBER(2)
STUDENT_NAME VARCHAR2(20)
FACULTY_ID VARCHAR2(2)
LOCATION_ID NUMBER(2)
FACULTY
Name Null? Type
------------------ ------------------- -------------
FACULTY_ID NOT NULL NUMBER(2)
FACULTY_NAME VARCHAR2(20)
LOCATION_ID NUMBER(2)
You need to display the faculty name followed by the number of students handled by the faculty at the base location.
Examine the following two SQL statements:
Statement 1
Statement 2
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 38
Which statement correctly grants a system privilege?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 39
View the exhibit and examine the structure of ORDERS and CUSTOMERS tables.
ORDERS
Name Null? Type
ORDER_ID NOT NULL NUMBER(4)
ORDER_DATE NOT NULL DATE
ORDER_MODE VARCHAR2(8)
CUSTOMERS
Name Null? Type
CUSTOMER_ID NOT NULL NUMBER(6)
CUST_FIRST_NAME NOT NULL VARCHAR2(20)
CUST_LAST_NAME NOT NULL VARCHAR2(20)
CREDIT_LIMIT NUMBER(9,2)
CUST_ADDRESS VARCHAR2(40)
Which INSERT statement should be used to add a row into the ORDERS table for the customer whose CUST_LAST_NAME is Roberts and CREDIT_LIMIT is 600?
Assume there exists only one row with CUST_LAST_NAME as Roberts and CREDIT_LIMIT as 600.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
A. A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a unique index.
B. Indexes should be created on columns that are frequently referenced as part of any expression.
C. When a table is dropped, the corresponding indexes are automatically dropped.
D. For each DML operation performed, the corresponding indexes are automatically updated.
Explanation/Reference:
References:
http://viralpatel.net/blogs/understanding-primary-keypk-constraint-in-oracle/
QUESTION 41
View the exhibit and examine the description of the DEPARTMENTS and EMPLOYEES tables.
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.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
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)
QUESTION 42
Which two statements are true about sequences created in a single instance database? (Choose two.)
A. When the MAXVALUE limit for the sequence is reached, you can increase the MAXVALUE limit by using the ALTER SEQUENCE statement.
B. DELETE <sequencename> would remove a sequence from the database.
C. The numbers generated by a sequence can be used only for one table.
D. CURRVAL is used to refer to the last sequence number that has been generated.
E. When a database instance shuts down abnormally, the sequence numbers that have been cached but not used would be available once again when the
Correct Answer: AD
Section: (none)
Explanation
Explanation/Reference:
References:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_2012.htm#SQLRF00817
https://docs.oracle.com/cd/A84870_01/doc/server.816/a76989/ch26.htm
QUESTION 43
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'.
Correct Answer: AE
Section: (none)
Explanation/Reference:
QUESTION 44
Which statement is true about transactions?
A. A set of Data Manipulation Language (DML) statements executed in a sequence ending with a SAVEPOINT forms a single transaction.
B. Each Data Definition Language (DDL) statement executed forms a single transaction.
C. A set of DDL statements executed in a sequence ending with a COMMIT forms a single transaction.
D. A combination of DDL and DML statements executed in a sequence ending with a COMMIT forms a single transaction.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
References:
https://docs.oracle.com/database/121/CNCPT/transact.htm#CNCPT038
QUESTION 45
View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 46
Which statement is true about an inner join specified in the WHERE clause of a query?
A. It must have primary-key and foreign-key constraints defined on the columns used in the join condition.
B. It requires the column names to be the same in all tables used for the join conditions.
C. It is applicable for equijoin and nonequijoin conditions.
D. It is applicable for only equijoin conditions.
Correct Answer: C
Section: (none)
Explanation/Reference:
QUESTION 47
Which statement is true regarding the INTERSECT operator?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
References:
http://oraclexpert.com/using-the-set-operators/
QUESTION 48
Examine the following query:
Correct Answer: C
Section: (none)
Explanation