Oracle PracticeTest 1z0-071 v2019-06-19 by Camilla 131q
Oracle PracticeTest 1z0-071 v2019-06-19 by Camilla 131q
131q
Number: 1z0-071
Passing Score: 800
Time Limit: 120 min
1z0-071
https://www.gratisexam.com/
https://www.gratisexam.com/
Exam A
QUESTION 1
View the exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables.
https://www.gratisexam.com/
https://www.gratisexam.com/
You want to update EMPLOYEES table as follows:
Update only those employees who work in Boston or Seattle (locations 2900 and 2700).
Set department_id for these employees to the department_id corresponding to London (location_id 2100).
Set the employees' salary in location_id 2100 to 1.1 times the average salary of their department.
Set the employees' commission in location_id 2100 to 1.5 times the average commission of their department.
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
Correct Answer: D
Section: (none)
Explanation
https://www.gratisexam.com/
Explanation/Reference:
QUESTION 2
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.
D. Performance would improve in query 2.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 3
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:
https://www.gratisexam.com/
STUDENT_ID FIRST_NAME LAST_NAME PROJECT_ID PROJECT_NAME PROJECT_TASK
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 4
View the Exhibit and examine the details of PRODUCT_INFORMATION table.
https://www.gratisexam.com/
https://www.gratisexam.com/
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 5
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.
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
References:
http://www.techonthenet.com/oracle/exists.php
QUESTION 6
https://www.gratisexam.com/
View the exhibit and examine the structure of the STORES table.
You must display the NAME of stores 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?
A. SELECT name, concat (address| | ','| |city| |', ', country) AS full_address,
start_date,
property_price, property_price*115/100
FROM stores
WHERE MONTHS_BETWEEN (start_date, '01-JAN-2000') <=36;
B. SELECT name, concat (address| | ','| |city| |', ', country) AS full_address,
start_date,
property_price, property_price*115/100
FROM stores
WHERE TO_NUMBER(start_date-TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;
C. SELECT name, address||', '||city||', '||country AS full_address, start_date,
property_price, property_price*115/100
FROM stores
WHERE MONTHS_BETWEEN(start_date,TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;
D. SELECT name, concat (address||','| |city| |', ', country) AS full_address,
start_date,
property_price, property_price*115/100
FROM stores
WHERE MONTHS_BETWEEN (start_date, TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;
https://www.gratisexam.com/
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 7
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.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 8
Examine the command:
https://www.gratisexam.com/
A. When the BOOKS table is dropped, the BOOK_TRANSACTIONS table is dropped.
B. When the BOOKS table is dropped, all the rows in the BOOK_TRANSACTIONS table are deleted but the table structure is retained.
C. When a row in the BOOKS table is deleted, the rows in the BOOK_TRANSACTIONS table whose BOOK_ID matches that of the deleted row in the BOOKS table are
also deleted.
D. When a value in the BOOKS.BOOK_ID column is deleted, the corresponding value is updated in the BOOKS_TRANSACTIONS.BOOK_ID column.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 9
View the exhibit and examine the structure of the EMPLOYEES table.
https://www.gratisexam.com/
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.
https://www.gratisexam.com/
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
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 10
Which three statements are true about multiple-row subqueries?
Explanation/Reference:
QUESTION 11
Examine the structure of the EMPLOYEES table.
https://www.gratisexam.com/
There is a parent/child relationship between EMPLOYEE_ID and MANAGER_ID.
You want to display the last names and manager IDs of employees who work for the same manager as the employee whose EMPLOYEE_ID is 123.
https://www.gratisexam.com/
WHERE e.employee_id = 123;
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 12
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 13
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.
https://www.gratisexam.com/
Which set operator generates the required output?
A. INTERSECT
B. UNION
C. PLUS
D. MINUS
E. SUBTRACT
Correct Answer: D
Section: (none)
https://www.gratisexam.com/
Explanation
Explanation/Reference:
References:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries004.htm
QUESTION 14
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 must be empty for the ALTER TABLE command to execute successfully.
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 15
Evaluate the following SQL statements that are issued in the given order:
https://www.gratisexam.com/
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.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 16
Which three statements are true regarding the data types? (Choose three.)
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 17
Which three statements are true regarding subqueries? (Choose three.)
A. Multiple columns or expressions can be compared between the main query and subquery.
B. Subqueries can contain ORDER BY but not the GROUP BY clause.
C. Main query and subquery can get data from different tables.
D. Subqueries can contain GROUP BY and ORDER BY clauses.
https://www.gratisexam.com/
E. Main query and subquery must get data from the same tables.
F. Only one column or expression can be compared between the main query and subquery.
Explanation/Reference:
References:
http://docs.oracle.com/javadb/10.6.2.1/ref/rrefsqlj13658.html
QUESTION 18
Which statement is true regarding the default behavior of the ORDER BY clause?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 19
Examine the structure of the MEMBERS table.
https://www.gratisexam.com/
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 20
Which two statements are true regarding the COUNT function?
https://www.gratisexam.com/
https://www.gratisexam.com/
A. A SELECT statement using the COUNT function with a DISTINCT keyword cannot have a WHERE clause.
B. COUNT (DISTINCT inv_amt) returns the number of rows excluding rows containing duplicates and NULL values in the INV_AMT column.
C. COUNT (cust_id) returns the number of rows including rows with duplicate customer IDs and NULL value in the CUST_ID column.
D. COUNT (*) returns the number of rows including duplicate rows and rows containing NULL value in any of the columns.
E. The COUNT function can be used only for CHAR, VARCHAR2, and NUMBER data types.
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 21
In which three situations does a transaction complete?
Explanation/Reference:
References:
https://docs.oracle.com/cd/B19306_01/server.102/b14220/transact.htm
QUESTION 22
View the exhibit and examine the data in ORDERS_MASTER and MONTHLY_ORDERS tables.
https://www.gratisexam.com/
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)
https://www.gratisexam.com/
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
References:
https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
QUESTION 23
Evaluate the following SQL statement:
You received the following error while executing the above query:
ERROR
ORA-01756: quoted string not properly terminated
A. Remove the single quotation marks enclosing the character literal string in the SELECT clause
B. Use the escape character to negate the single quotation mark within the literal character string in the SELECT clause
C. Enclose the character literal string in the SELECT clause within double quotation marks
D. Use the Oracle (q) operator and delimiter to allow the use of a single quotation mark within the literal character string in the SELECT clause
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
References:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm
QUESTION 24
View the exhibit and examine the ORDERS table.
https://www.gratisexam.com/
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?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 25
Examine the structure of the INVOICE table.
https://www.gratisexam.com/
Which two SQL statements would execute successfully?
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 26
Which three statements are true about the ALTER TABLE....DROP COLUMN.... command?
https://www.gratisexam.com/
Explanation/Reference:
QUESTION 27
View the exhibit and examine the description of the PRODUCT_INFORMATION table.
https://www.gratisexam.com/
Which SQL statement would retrieve from the table the number of products having LIST_PRICE as NULL?
https://www.gratisexam.com/
A. SELECT COUNT (DISTINCT list_price)
FROM product_information
WHERE list_price is NULL
B. SELECT COUNT (NVL(list_price, 0))
FROM product_information
WHERE list_price is NULL
C. SELECT COUNT (list_price)
FROM product_information
WHERE list_price i= NULL
D. SELECT COUNT (list_price)
FROM product_information
WHERE list_price is NULL
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 28
Which three tasks can be performed using SQL functions built into Oracle Database?
Explanation/Reference:
QUESTION 29
The user SCOTT who is the owner of ORDERS and ORDER_ITEMS tables issues this GRANT command:
GRANT ALL
ON orders, order_items
https://www.gratisexam.com/
TO PUBLIC;
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
References:
http://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljgrant.html
QUESTION 30
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 must 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? (Choose two.)
Correct Answer: CF
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 31
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 32
View the exhibit and examine the structure of the CUSTOMERS table.
https://www.gratisexam.com/
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, whose 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
https://www.gratisexam.com/
Explanation/Reference:
QUESTION 33
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 34
View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables.
https://www.gratisexam.com/
You need to create a view that displays the ORDER_ID, ORDER_DATE, and the total number of items in each order.
https://www.gratisexam.com/
Which CREATE VIEW statement would create the view successfully?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 35
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.
https://www.gratisexam.com/
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 36
Which statement is true regarding the INTERSECT operator?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
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.
QUESTION 37
Examine the following query:
https://www.gratisexam.com/
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
References:
https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1
QUESTION 38
The first DROP operation is performed on PRODUCTS table using this command:
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
References:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9003.htm
QUESTION 39
These are the steps for a correlated subquery, listed in random order:
https://www.gratisexam.com/
4. Rows are returned by the inner query, after being evaluated with the value from the candidate row in the outer query.
Which is the correct sequence in which the Oracle server evaluates a correlated subquery?
A. 2, 1, 4, 3
B. 4, 1, 2, 3
C. 4, 2, 1, 3
D. 2, 4, 1, 3
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
References:
http://rajanimohanty.blogspot.co.uk/2014/01/correlated-subquery.html
QUESTION 40
Evaluate the following query:
A. 150
B. 200
C. 160
D. 16
E. 100
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
References:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions135.htm
https://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2127.htm
https://www.gratisexam.com/
QUESTION 41
Examine the data in the CUST_NAME column of the CUSTOMERS table.
CUST_NAME
-------------------
Renske Ladwig
Jason Mallin
Samuel McCain
Allan MCEwen
Irene Mikkilineni
Julia Nayer
You need to display customers' second names where the second name starts with "Mc" or "MC".
Which query gives the required output?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 42
View the exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS and TIMES tables.
https://www.gratisexam.com/
https://www.gratisexam.com/
The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the CUSTOMERS and TIMES tables, respectively.
A. The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified columns would be passed to the new table.
B. The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the column definition.
C. The NEW_SALES table would not get created because the column names in the CREATE TABLE command and the SELECT clause do not match.
D. The NEW_SALES table would get created and all the FOREIGN KEY constraints defined on the specified columns would be passed to the new table.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 43
Evaluate this query:
SQL> SELECT TRUNC(ROUND(156.00,-1),-1)
FROM DUAL;
What will be the result?
A. 16
B. 100
C. 160
D. 150
E. 200
Correct Answer: C
https://www.gratisexam.com/
Section: (none)
Explanation
Explanation/Reference:
QUESTION 44
Which three statements are true regarding group functions? (Choose three.)
Explanation/Reference:
References:
https://www.safaribooksonline.com/library/view/mastering-oracle-sql/0596006322/ch04.html
QUESTION 45
Which three statements are true? (Choose three.)
https://www.gratisexam.com/
Explanation/Reference:
References:
https://docs.oracle.com/cd/B10501_01/server.920/a96524/c05dicti.htm
QUESTION 46
View the exhibits and examine the structures of the COSTS and PROMOTIONS tables.
https://www.gratisexam.com/
Evaluate the following SQL statement:
https://www.gratisexam.com/
A. It displays prod IDs in the promo with the lowest cost.
B. It displays prod IDs in the promos with the lowest cost in the same time interval.
C. It displays prod IDs in the promos with the highest cost in the same time interval.
D. It displays prod IDs in the promos which cost less than the highest cost in the same time interval.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 47
View the exhibit and examine the descriptions of the DEPT and LOCATIONS tables.
https://www.gratisexam.com/
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.
A. UPDATE dept d
SET city = ALL (SELECT city
FROM locations l
WHERE d.location_id = l.location_id);
B. UPDATE dept d
SET city = (SELECT city
FROM locations l)
WHERE d.location_id = l.location_id;
https://www.gratisexam.com/
C. UPDATE dept d
SET city = ANY (SELECT city
FROM locations l)
D. UPDATE dept d
SET city = (SELECT city
FROM locations l
WHERE d.location_id = l.location_id);
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 48
The BOOKS_TRANSACTIONS table exists in your schema in this database.
You execute this SQL statement when connected to your schema in your database instance.
SQL> SELECT * FROM books_transactions ORDER BY 3;
A. The execution fails unless the numeral 3 in the ORDER BY clause is replaced by a column name.
B. All table rows are displayed sorted in ascending order of the values in the third column.
C. The first three rows in the table are displayed in the order that they are stored.
D. Only the three rows with the lowest values in the key column are displayed in the order that they are stored.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 49
Which statement is true about Data Manipulation Language (DML)?
A. DML automatically disables foreign ley constraints when modifying primary key values in the parent table.
B. Each DML statement forms a transaction by default.
C. A transaction can consist of one or more DML statements.
https://www.gratisexam.com/
D. DML disables foreign key constraints when deleting primary key values in the parent table, only when the ON DELETE CASCADE option is set for the foreign
key constraint.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 50
View the exhibit and examine the structure of the PROMOTIONS table.
You have to generate a report that displays the promo name and start date for all promos that started after the last promo in the ‘INTERNET’ category.
https://www.gratisexam.com/
promo_category= ‘INTERNET’;
B. SELECT promo_name, promo_begin_date FROM promotions
WHERE promo_begin_date IN (SELECT promo_begin_date
FROM promotions
WHERE promo_category= ‘INTERNET’);
C. SELECT promo_name, promo_begin_date FROM promotions
WHERE promo_begin_date > ALL (SELECT promo_begin_date
FROM promotions
WHERE promo_category = ‘INTERNET’);
D. SELECT promo_name, promo_begin_date FROM promotions
WHERE promo_begin_date> ANY (SELECT promo_begin_date
FROM promotions
WHERE promo_category= ‘INTERNET’);
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 51
View the Exhibit and examine the structure of the ORDER_ITEMS table.
https://www.gratisexam.com/
https://www.gratisexam.com/
Examine the following SQL statement:
SELECT order_id, product_id, unit_price
FROM order_items
WHERE unit_price =
(SELECT MAX(unit_price)
FROM order_items
GROUP BY order_id);
You want to display the PRODUCT_ID of the product that has the highest UNIT_PRICE per ORDER_ID. What correction should
be made in the above SQL statement to achieve this?
A. Remove the GROUP BY clause from the subquery and place it in the main query
B. Replace = with the >ANY operator
C. Replace = with the >ALL operator
D. Replace = with the IN operator
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 52
Evaluate the following CREATE TABLE command:
https://www.gratisexam.com/
Which statement is true regarding the above SQL statement?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 53
Using the CUSTOMERS table, you need to generate a report that shows 50% of each credit amount in each income level. The report should NOT show any repeated
credit amounts in each income level.
https://www.gratisexam.com/
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 54
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.
https://www.gratisexam.com/
Which SQL statement would produce the required result?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 55
Examine these SQL statements that are executed in the given order:
https://www.gratisexam.com/
What will be the status of the foreign key EMP_MGR_FK?
Correct Answer: C
Section: (none)
Explanation
https://www.gratisexam.com/
Explanation/Reference:
QUESTION 56
View the Exhibit and examine the structure in the EMPLOYEES tables.
https://www.gratisexam.com/
UNION
SELECT employee_id, department_id
FROM employees
WHERE department_id=90
UNION
SELECT employee_id, department_id
FROM employees
WHERE department_id=10;
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.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 57
View the Exhibit and examine the description for the SALES and CHANNELS tables. (Choose the best answer.)
https://www.gratisexam.com/
You issued this SQL statement:
https://www.gratisexam.com/
Which statement is true regarding the result?
A. The statement will fail because the subquery in the VALUES clause is not enclosed within single quotation marks.
B. The statement will fail because a subquery cannot be used in a VALUES clause.
C. The statement will execute and a new row will be inserted in the SALES table.
D. The statement will fail because the VALUES clause is not required with the subquery.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 58
View the Exhibit and examine the description of the ORDERS table.
https://www.gratisexam.com/
Which two WHERE clause conditions demonstrate the correct usage of conversion functions? (Choose two.)
https://www.gratisexam.com/
Correct Answer: CD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 59
Which three arithmetic operations can be performed on a column by using a SQL function that is built into Oracle database? (Choose three.)
Explanation/Reference:
QUESTION 60
View the Exhibit and examine the structure of the EMPLOYEES and JOB_HISTORY tables.
https://www.gratisexam.com/
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';
https://www.gratisexam.com/
Choose two correct SET operators which would cause the query to return the desired result.
A. UNION
B. MINUS
C. INTERSECT
D. UNION ALL
Correct Answer: AD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 61
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
https://www.gratisexam.com/
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');
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 62
View the Exhibit and examine the details of the PRODUCT_INFORMATION table.
https://www.gratisexam.com/
Evaluate this SQL statement:
SELECT TO_CHAR (list_price, '$9,999')
From product_information;
https://www.gratisexam.com/
Which two statements are true regarding the output? (Choose two.)
A. A row whose LIST_PRICE column contains value 11235.90 would be displayed as #######.
B. A row whose LIST_PRICE column contains value 1123.90 would be displayed as $1,123.
C. A row whose LIST_PRICE column contains value 1123.90 would be displayed as $1,124.
D. A row whose LIST_PRICE column contains value 11235.90 would be displayed as $1,123.
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 63
Which statement is true about SQL query processing in an Oracle database instance? (Choose the best answer.)
A. During parsing, a SQL statement containing literals in the WHERE clause that has been executed by any session and which is cached in memory, is always
reused for the current execution.
B. During execution, the Oracle server may read data from storage if the required data is not already in memory.
C. During row source generation, rows that satisfy the query are retrieved from the database and stored in memory.
D. During optimization, execution plans are formulated based on the statistics gathered by the database instance, and the lowest cost plan is selected for
execution.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 64
Examine the structure of the ORDERS table: (Choose the best answer.)
https://www.gratisexam.com/
You want to find the total value of all the orders for each year and issue this command:
SQL> SELECT TO_CHAR(order_date,'rr'), SUM(order_total) FROM orders
GROUP BY TO_CHAR(order_date, 'yyyy');
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 65
View the Exhibit and examine the structure of the ORDER_ITEMS table.
https://www.gratisexam.com/
You must select the ORDER_ID of the order that has the highest total value among all the orders in the ORDER_ITEMS table.
A. SELECT order_id
FROM order_items
GROUP BY order_id
HAVING SUM(unit_price*quantity) = (SELECT MAX(SUM(unit_price*quantity))
FROM order_items GROUP BY order_id);
B. SELECT order_id
FROM order_items
WHERE(unit_price*quantity) = (SELECT MAX(unit_price*quantity)
FROM order_items)
https://www.gratisexam.com/
GROUP BY order_id;
C. SELECT order_id
FROM order_items
WHERE(unit_price*quantity) = MAX(unit_price*quantity)
GROUP BY order_id;
D. SELECT order_id
FROM order_items
WHERE (unit_price*quantity) = (SELECT MAX(unit_price*quantity)
FROM order_items
GROUP BY order_id)
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 66
View the Exhibit and examine the structure of the EMP table which is not partitioned and not an index-organized table. (Choose two.)
https://www.gratisexam.com/
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.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 67
View the exhibit and examine the structure and data in the INVOICE table.
https://www.gratisexam.com/
A. SELECT MAX(AVG(SYSDATE -inv_date))
FROM invoice
B. SELECT AVG(inv_date)
FROM invoice
C. SELECT MAX(inv_date), MIN(cust_id)
FROM invoice
D. SELECT AVG( inv_date -SYSDATE), AVG(inv_amt)
FROM invoice
Correct Answer: CD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 68
Which two statements best describe the benefits of using the WITH clause? (Choose two.)
A. It can improve the performance of a large query by storing the result of a query block having the WITH clause in the session's temporary tablespace.
B. It enables sessions to reuse the same query block in a SELECT statement, if it occurs more than once in a complex query.
C. It enables sessions to store a query block permanently in memory and use it to create complex queries.
D. It enables sessions to store the results of a query permanently.
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
QUESTION 69
Which three statements are true regarding subqueries? (Choose three.)
https://www.gratisexam.com/
E. Logical operators, such as AND, OR and NOT, cannot be used in the WHERE clause of a subquery.
Explanation/Reference:
QUESTION 70
Which two statements are true regarding single row functions? (Choose two.)
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 71
View the Exhibit and examine the structure of the ORDERS table.
https://www.gratisexam.com/
https://www.gratisexam.com/
You must select ORDER_ID and ORDER_DATE for all orders that were placed after the last order placed by CUSTOMER_ID 101.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 72
You must display details of all users whose username contains the string 'ch_'. (Choose the best answer.)
https://www.gratisexam.com/
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 73
Which three statements are true regarding the usage of the WITH clause in complex correlated subqueries? (Choose three.)
Explanation/Reference:
QUESTION 74
View the Exhibit and examine the data in the PRODUCTS table.
https://www.gratisexam.com/
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.
https://www.gratisexam.com/
D. It generates an error because the condition specified for the PROD_CATEGORY column is not valid.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 75
Examine the structure of the EMPLOYEES table.
You must display the maximum and minimum salaries of employees hired 1 year ago.
Which two statements would provide the correct output? (Choose two.)
https://www.gratisexam.com/
B. SELECT minsal, maxsal
FROM (SELECT MIN(salary) minsal, MAX(salary) maxsal
FROM employees
WHERE hire_date < SYSDATE-365)
GROUP BY maxsal, minsal;
C. SELECT minsal, maxsal
FROM (SELECT MIN(salary) minsal, MAX(salary) maxsal
FROM employees
WHERE hire_date < SYSDATE-365
GROUP BY MIN(salary), MAX(salary));
D. SELECT MIN(Salary), MAX(salary)
FROM (SELECT salary FROM
employees
WHERE hire_date < SYSDATE-365);
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 76
Which two statements are true regarding subqueries? (Choose two.)
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 77
Which two statements are true regarding the execution of the correlated subqueries? (Choose two.)
https://www.gratisexam.com/
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.
Correct Answer: AD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 78
You must create a table for a banking application.
A. DATE
B. NUMBER
C. TIMESTAMP
D. INTERVAL DAY TO SECOND
E. INTERVAL YEAR TO MONTH
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 79
Examine the structure of the CUSTOMERS table: (Choose two.)
https://www.gratisexam.com/
CUSTNO is the PRIMARY KEY.
You must determine if any customers' details have been entered more than once using a different CUSTNO, by listing all duplicate names.
Which two methods can you use to get the required result?
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
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
QUESTION 80
Which two are the minimal requirements for a self-join? (Choose two.)
Correct Answer: CE
https://www.gratisexam.com/
Section: (none)
Explanation
Explanation/Reference:
QUESTION 81
Examine the SQL statement used to create the TRANSACTION table.
The value 'A1' does not exist for trn_id in this table.
Which SQL statement successfully inserts a row into the table with the default value for START_DATE?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 82
Which three SQL statements would display the value 1890.55 as $1,890.55? (Choose three.)
https://www.gratisexam.com/
FROM DUAL;
E. SELECT TO_CHAR (1890.55, '$99G999D99')
FROM DUAL
Explanation/Reference:
QUESTION 83
A subquery is called a single-row subquery when _______.
A. There is only one subquery in the outer query and the inner query returns one or more values
B. The inner query returns a single value to the outer query.
C. The inner query uses an aggregating function and returns one or more values.
D. The inner query returns one or more values and the outer query returns a single value.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 84
You must write a query that prompts users for column names and conditions every time it is executed.
The user must be prompted only once for the table name.
https://www.gratisexam.com/
C. SELECT &col1, &col2
FROM &&table
WHERE &condition = &cond;
D. SELECT &col1, &col2
FROM &&table
WHERE &condition = &&cond
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 85
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.
E. They can be used in SELECT, WHERE, and ORDER BY clauses.
F. They can accept column names, expressions, variable names, or a user-supplied constants as arguments.
Explanation/Reference:
QUESTION 86
View the Exhibit and examine the structure in the DEPARTMENTS tables. (Choose two.)
https://www.gratisexam.com/
Examine this SQL statement:
https://www.gratisexam.com/
UNION
SELECT department_id, department_name DEPT_NAME, 'a' FROM
departments
WHERE department_id=10
A. ORDER BY DEPT_NAME;
B. ORDER BY DEPT_ID;
C. ORDER BY 'b';
D. ORDER BY 3;
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 87
Which two statements are true regarding the WHERE and HAVING clauses in a SELECT statement? (Choose two.)
A. The WHERE and HAVING clauses can be used in the same statement only if they are applied to different columns in the table.
B. The aggregate functions and columns used in the HAVING clause must be specified in the SELECT list of the query.
C. The WHERE clause can be used to exclude rows after dividing them into groups.
D. The HAVING clause can be used with aggregate functions in subqueries.
E. The WHERE clause can be used to exclude rows before dividing them into groups.
Correct Answer: CD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 88
You must create a table EMPLOYEES in which the values in the columns EMPLOYEES_ID and LOGIN_ID must be unique and not null.
Which two SQL statements would create the required table? (Choose two.)
https://www.gratisexam.com/
A. CREATE TABLE employees
(employee_id NUMBER,
login_id NUMBER,
employee_name VARCHAR2(100),
hire_date DATE,
CONSTRAINT emp_id_uk UNIQUE (employee_id, login_id));
B. CREATE TABLE employees
(employee_id NUMBER,
login_id NUMBER,
employee_name VARCHAR2(25),
hire_date DATE,
CONSTRAINT emp_id_pk PRIMARY KEY (employee_id, login_id));
C. CREATE TABLE employees
(employee_id NUMBER CONSTRAINT emp_id_pk PRIMARY KEY,
login_id NUMBER UNIQUE,
employee_name VARCHAR2(25),
hire_date DATE);
D. CREATE TABLE employees
(employee_id NUMBER,
login_id NUMBER,
employee_name VARCHAR2(100),
hire_date DATE,
CONSTRAINT emp_id_uk UNIQUE (employee_id, login_id);
CONSTRAINT emp_id_nn NOT NULL (employee_id, login_id));
E. CREATE TABLE employees
(employee_id NUMBER CONSTRAINT emp_id_nn NOT NULL,
login_id NUMBER CONSTRAINT login_id_nn NOT NULL,
employee_name VARCHAR2(100),
hire_date DATE,
CONSTRAINT emp_num_id_uk UNIQUE (employee_id, login_id));
Correct Answer: BE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 89
View the Exhibit and examine the structure of the PRODUCT_INFORMATION table. (Choose the best answer.)
https://www.gratisexam.com/
https://www.gratisexam.com/
PRODUCT_ID column is the primary key.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 90
Examine the types and examples of relationship that follow:
https://www.gratisexam.com/
B. 1-c, 2-d, 3-a, and 4-b
C. 1-a, 2-b, 3-c, and 4-d
D. 1-c, 2-a, 3-b, and 4-d
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 91
A non-correlated subquery can be defined as __________. (Choose the best answer.)
A. A set of one or more sequential queries in which generally the result of the inner query is used as the search value in the outer query.
B. A set of sequential queries, all of which must return values from the same table.
C. A set of sequential queries, all of which must always return a single value.
D. A SELECT statement that can be embedded in a clause of another SELECT statement only.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 92
Which three statements are true reading subqueries? (Choose three.)
https://www.gratisexam.com/
Explanation
Explanation/Reference:
QUESTION 93
See the Exhibit and examine the structure of the PROMOTIONS table:
https://www.gratisexam.com/
What would be the outcome?
A. It generates an error because multiple conditions cannot be specified for the WHEN clause.
B. It executes successfully and gives the required result.
C. It generates an error because CASE cannot be used with group functions.
D. It generates an error because NULL cannot be specified as a return value.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
CASE Expression
Facilitates conditional inquiries by doing the work of an IF-THEN-ELSE statement:
CASE expr WHEN comparison_expr1 THEN return_expr1
[WHEN comparison_expr2 THEN return_expr2
WHEN comparison_exprn THEN return_exprn
ELSE else_expr]
END
QUESTION 94
View the Exhibits and examine PRODUCTS and SALES tables.
Exhibit 1
https://www.gratisexam.com/
Exhibit 2
You issue the following query to display product name the number of times the product has been sold:
https://www.gratisexam.com/
What happens when the above statement is executed?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 95
Examine the structure of the BOOKS_TRANSACTIONS table:
https://www.gratisexam.com/
Which statement is true about the outcome?
A. It displays details only for members who have borrowed before today with RM as TRANSACTION_TYPE.
B. It displays details for members who have borrowed before today’s date with either RM as TRANSACTION_TYPE or MEMBER_ID as A101 and A102.
C. It displays details for only members A101 and A102 who have borrowed before today with RM TRANSACTION_TYPE.
D. It displays details for members who have borrowed before today with RM as TRANSACTION_TYPE and the details for members A101 or A102.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 96
View the Exhibit and examine the data in the EMPLOYEES table.
Exhibit
You want to generate a report showing the total compensation paid to each employee to date.
https://www.gratisexam.com/
What is the outcome?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 97
Evaluate the following query
https://www.gratisexam.com/
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 98
Which two statements are true regarding savepoints? (Choose two.)
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
Reference: https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10001.htm#SQLRF01701
QUESTION 99
Examine the commands used to create DEPARTMENT_DETAILS and COURSE_DETAILS tables:
https://www.gratisexam.com/
You want to generate a list of all department IDs that do not exist in the COURSE_DETAILS table.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 100
View the Exhibit and examine the details of the PRODUCT_INFORMATION table.
Exhibit
https://www.gratisexam.com/
You must 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.
A. It would not execute because the entire WHERE clause is not enclosed within parentheses.
https://www.gratisexam.com/
B. It would execute but would return no rows.
C. It would not execute because the same column has been used twice with the AND logical operator.
D. It would execute and return the desired result.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 101
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.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 102
View the Exhibit and examine the structure of the ORDERS table.
https://www.gratisexam.com/
Which UPDATE statement is valid?
A. UPDATE orders
https://www.gratisexam.com/
SET order_date = ’12-mar-2007’,
order_total IS NULL
WHERE order_id = 2455;
B. UPDATE orders
SET order_date = ’12-mar-2007’,
AND order_total = TO_NUMBER(NULL)
WHERE order_id = 2455;
C. UPDATE orders
SET order_date = ’12-mar-2007’,
order_total = 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;
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 103
SCOTT is a user in the database.
A. Statement 1 would not execute because the WITH GRANT option is missing.
B. Statement 2 would not execute because system privileges and object privileges cannot be granted together in a single GRANT command.
C. Statement 3 would not execute because role and system privileges cannot be granted together in a single GRANT statement.
https://www.gratisexam.com/
D. Statement 1 would not execute because the IDENTIFIED BY <password> clause is missing.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 104
View the Exhibit and examine the data in the PRODUCT_INFORMATION table.
A. displaying all the products whose minimum list prices are more than average list price of products having the status orderable
B. displaying the total number of products supplied by supplier 102071 and having product status OBSOLETE
C. displaying the number of products whose list prices are more than the average list price
D. displaying all supplier IDs whose average list price is more than 500
E. displaying the minimum list price for each product status
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 105
View the Exhibit and examine the description of the EMPLOYEES table.
You want to calculate the total remuneration for each employee. Total remuneration is the sum of the annual salary and the percentage commission earned for a
year. Only a few employees earn commission.
https://www.gratisexam.com/
Which SQL statement would you execute to get the desired output?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 106
View the Exhibit and examine the structure of the PROMOTIONS table.
https://www.gratisexam.com/
https://www.gratisexam.com/
A. It produces an error because subqueries cannot be used with the CASE expression.
B. It shows COST_REMARK for all the promos in the promo category ‘TV’.
C. It shows COST_REMARK for all the promos in the table.
D. It produces an error because the subquery gives an error.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 107
Which statement is true regarding the USING clause in table joins? (Choose two.)
https://www.gratisexam.com/
B. It can be used to access data from tables through equijoins as well as nonequijoins.
C. It can be used to join tables that have columns with the same name and compatible data types.
D. It can be used to restrict the number of columns used in a NATURAL join.
Correct Answer: CD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 108
Examine the structure proposed for the TRANSACTIONS table:
Which two statements are true regarding the storage of data in the above table structure? (Choose two.)
A. The CUST_CREDIT_VALUE column would allow storage of positive and negative integers.
B. The TRANS_VALIDITY column would allow storage of a time interval in days, hours, minutes, and seconds.
C. The CUST_STATUS column would allow storage of data up to the maximum VARCHAR2 size of 4,000 characters.
D. The TRANS_DATE column would allow storage of dates only in the dd-mon-yyyy format.
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 109
Examine the structure of the MARKS table:
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 110
Which three statements indicate the end of a transaction? (Choose three.)
https://www.gratisexam.com/
A. after a CREATE statement is issued
B. after a SAVEPOINT is issued
C. after a SELECT statement is issued
D. after a ROLLBACK is issued
E. after a COMMIT is issued
Explanation/Reference:
QUESTION 111
Examine the structure of the BOOKS_TRANSACTIONS table.
You want to update this table such that BOOK_ID is set to 'INVALID' for all rows where no MEMBER_ID has been entered.
https://www.gratisexam.com/
Which condition must be used in the WHERE clause to perform the required update?
A. MEMBER_ID = '';
B. MEMBER_ID = NULL;
C. MEMBER_ID IS NULL;
D. MEMBER_ID = "";
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 112
Evaluate the following SQL commands:
https://www.gratisexam.com/
The command to create a table fails. Identify the reason for the SQL statement failure.
A. You cannot use ORD_NO and ITEM_NO columns as a composite primary key because ORD_NO is also the FOREIGN KEY.
B. You cannot use the BETWEEN clause in the condition of a CHECK constraint.
C. You cannot use the NEXTVAL sequence value as a DEFAULT value for a column.
D. You cannot use SYSDATE in the condition of a CHECK constraint.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 113
Evaluate the following query:
https://www.gratisexam.com/
What would be the outcome of the above query?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 114
View the exhibit and examine the description for the SALES and CHANNELS tables.
https://www.gratisexam.com/
https://www.gratisexam.com/
You issued this SQL statement:
A. The statement will fail because the subquery in the VALUES clause is not enclosed within single quotation marks.
B. The statement will fail because a subquery cannot be used in a VALUES clause.
C. The statement will fail because the VALUES clause is not required with a subquery.
D. The statement will execute and a new row will be inserted in the SALES table.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 115
View the Exhibit and examine the structure of the CUSTOMERS table.
https://www.gratisexam.com/
Evaluate the following SQL statement:
A. It returns an error because the BETWEEN operator cannot be used in the HAVING clause.
B. It returns an error because WHERE and HAVING clauses cannot be used in the same SELECT statement.
C. It returns an error because WHERE and HAVING clauses cannot be used to apply conditions on the same column.
D. It executes successfully.
https://www.gratisexam.com/
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 116
View the Exhibit and examine the details of the ORDER_ITEMS table.
Statement 1:
https://www.gratisexam.com/
FROM order_items;
Statement 2:
Which statements are true regarding the output of these SQL statements? (Choose all that apply.)
Explanation/Reference:
QUESTION 117
Which two statements are true regarding subqueries? (Choose two.)
Correct Answer: CE
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 118
Examine the description of the EMP_DETAILS table given below:
Which two statements are true regarding SQL statements that can be executed on the EMP_DETAIL TABLE?
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 119
View the Exhibit and examine the structure of ORDER_ITEMS and ORDERS tables.
https://www.gratisexam.com/
https://www.gratisexam.com/
You need to remove from the ORDER_ITEMS table those rows that have an order status of 0 or 1 in the ORDERS table.
A. DELETE *
FROM order_items
WHERE order_id IN (SELECT order_id)
FROM orders
WHERE order_status IN (0,1));
B. DELETE
FROM (SELECT * FROM order_items I,orders o
WHERE i.order_id = o.order_id AND order_status IN (0,1));
C. DELETE FROM order_items i
WHERE order_id = (SELECT order_id FROM orders o
WHERE i.order_id = o.order_id AND order_status IN (0,1));
D. DELETE
FROM order_items
WHERE order_id IN (SELECT order_id
FROM orders
WHERE orders_status in (0,1));
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 120
Which three tasks can be performed by DDL statements?
https://www.gratisexam.com/
Explanation
Explanation/Reference:
QUESTION 121
View the Exhibit and examine the structure of the ORDER_ITEMS and ORDERS tables.
https://www.gratisexam.com/
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.
https://www.gratisexam.com/
SELECT prder_id, product_id, unit_price*quantity “Total Price”
FROM order_items
WHERE unit_price*quantity > 50000
NATURAL JOIN orders;
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 122
Which two statements are true regarding operators used with subqueries (Choose two.)
Correct Answer: BE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 123
Examine the structure of the SHIPMENTS table:
https://www.gratisexam.com/
You want to generate a report that displays the PO_ID and the penalty amount to be paid if the SHIPMENT_DATE is later than one month from the PO_DATE. The
penalty is $20 per day.
Correct Answer: C
Section: (none)
Explanation
https://www.gratisexam.com/
Explanation/Reference:
QUESTION 124
Examine the structure and data in the PRICE_LIST table:
You plan to give a discount of 25% on the product price and need to display the discount amount in the same format as the PROD_PRICE.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 125
View the Exhibit and examine the data in the PRODUCTS table.
Which statement would add a column called PRICE, which cannot contain NULL?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 126
The customers table has the following structure:
1. Display the first name and tax amount of the customers. Tax is 5% of their credit limit.
2. Only those customers whose income level has a value should be considered.
https://www.gratisexam.com/
3. Customers whose tax amount is null should not be considered.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 127
View the Exhibit and examine the structure of the SALES table.
https://www.gratisexam.com/
The following query is written to retrieve all those product IDs from the SALES table that have more than 55000 sold and have been ordered more than 10 items.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 128
View the Exhibit and examine the description for the PRODUCTS and SALES table.
https://www.gratisexam.com/
https://www.gratisexam.com/
PROD_ID is a primary key in the PRODUCTS table and foreign key in the SALES table with ON DELETE CASCADE option. The SALES table contains data for the last
three years. You want to remove all the rows from the PRODUCTS table for which no sale was done for the last three years.
A. DELETE
FROM products
WHERE prod_id = (SELECT prod_id
FROM sales
WHERE time_id - 3*365 = SYSDATE );
B. DELETE
FROM products
WHERE prod_id = (SELECT prod_id
FROM sales
WHERE SYSDATE >= time_id - 3*365 );
C. DELETE
FROM products
WHERE prod_id IN (SELECT prod_id
FROM sales
WHERE SYSDATE - 3*365 >= time_id);
D. DELETE
FROM products
WHERE prod_id IN (SELECT prod_id
FROM sales
WHERE time_id >= SYSDATE - 3*365 );
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 129
View the Exhibit and examine the structure of the BOOKS table.
https://www.gratisexam.com/
The BOOKS table contains details of 100 books.
A. Both ROLLBACK commands restore the 101 rows that were deleted.
B. Both ROLLBACK commands restore the 100 rows that were deleted.
https://www.gratisexam.com/
C. The first rollback restores the 101 rows that were deleted and the second rollback causes the row was inserted to be deleted and commits the changes.
D. The first rollback restores the 100 rows that were deleted and the second rollback commits only the changes.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 130
Which statement is true about the Oracle SQL, DELETE and TRUNCATE statements?
A. DELTE and TRUNCATE statements can have a rollback done to restore data into a table.
B. DELETE and TRUNCATE statements remove all indexes for the tables on which they are performed.
C. DELETE but not TRUNCATE statement can be used to remove data from selective columns and rows of a table.
D. DELETE but not TRUNCATE statement can be used to selectively remove rows from a table.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 131
View the Exhibit and examine the description of the EMPLOYEES table.
https://www.gratisexam.com/
Evaluate the following SQL statement:
The query was written to retrieve the FIRST_NAME, EMPLOYEE_ID, and review date for employees. The review date is the firsts Monday after the completion of
six months of the hiring. The NLS_TERRITORY parameter is set to AMERICA in the session.
https://www.gratisexam.com/
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.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
https://www.gratisexam.com/
https://www.gratisexam.com/