aiotestking uk

1Z0-071 Exam Questions - Online Test


1Z0-071 Premium VCE File

Learn More 100% Pass Guarantee - Dumps Verified - Instant Download
150 Lectures, 20 Hours

Q1. Which three statements are true regarding group functions? (Choose three.)

A. They can be used on columns or expressions.

B. They can be passed as an argument to another group function.

C. They can be used only with a SQL statement that has the GROUP BY clause.

D. They can be used on only one column in the SELECT clause of a SQL statement.

E. They can be used along with the single-row function in the SELECT clause of a SQL statement.

Answer: A,B,E

Q2. Which two statements are true regarding multiple-row subqueries? (Choose two.)

A. They can contain group functions.

B. They always contain a subquery within a subquery.

C. They use the < ALL operator to imply less than the maximum.

D. They can be used to retrieve multiple rows from a single table only.

E. They should not be used with the NOT IN operator in the main query if NULL is likely to be a part of the result of the subquery.

Answer: A,E

Q3. Which two statements are true regarding the COUNT function? (Choose two.)

A. COUNT(*) returns the number of rows including duplicate rows and rows containing NULL value in any of the columns

B. COUNT(cust_id) returns the number of rows including rows with duplicate customer IDs and NULL value in the CUST_ID column

C. COUNT(DISTINCT inv_amt) returns the number of rows excluding rows containing duplicates and NULL values in the INV_AMT column

D. A SELECT statement using COUNT function with a DISTINCT keyword cannot have a WHERE clause

E. The COUNT function can be used only for CHAR, VARCHAR2 and NUMBER data types

Answer: A,C

Explanation:

Using the COUNT Function

The COUNT function has three formats: COUNT(*)

COUNT(expr) COUNT(DISTINCT expr)

COUNT(*) returns the number of rows in a table that satisfy the criteria of the SELECT statement, including duplicate rows and rows containing null values in any of the columns. If a WHERE clause is included in the SELECT statement, COUNT(*) returns the number of rows that satisfy the condition in the WHERE clause.

In contrast,

COUNT(expr) returns the number of non-null values that are in the column identified by expr.

COUNT(DISTINCT expr) returns the number of unique, non-null values that are in the column identified by expr.

Q4. Which two statements are true regarding the GROUP BY clause in a SQL statement? (Choose two.)

A. You can use column alias in the GROUP BY clause.

B. Using the WHERE clause after the GROUP BY clause excludes the rows after creating groups.

C. The GROUP BY clause is mandatory if you are using an aggregate function in the SELECT clause.

D. Using the WHERE clause before the GROUP BY clause excludes the rows before creating groups.

E. If the SELECT clause has an aggregate function, then those individual columns without an aggregate function in the SELECT clause should be included in the GROUP BY clause.

Answer: D,E

Q5. View the Exhibits and examine the structures of the costs and promotions tables? 

/1.

/2.

Evaluate the following SQL statement: SQL> SELECT prod_id FROM costs

WHERE promo_id IN (SELECT promo_id FROM promotions WHERE promo_cost < ALL

(SELECT MAX(promo_cost) FROM promotions GROUP BY (promo_end_datepromo_begin_date)));

What would be the outcome of the above SQL statement?

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 with cost less than the highest cost in the same time interval.

Answer: D

Q6. Which statements are true? (Choose all that apply.)

A. The data dictionary is created and maintained by the database administrator.

B. The data dictionary views can consist of joins of dictionary base tables and user-defined tables.

C. The usernames of all the users including the database administrators are stored in the data dictionary.

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: C,D,F

Q7. Which three statements are true reading subquenes?

A. A Main query can have many subqueries.

B. A subquery can have more than one main query

C. The subquery and main query must retrieve date from the same table.

D. The subquery and main query can retrieve data from different tables.

E. Only one column or expression can be compared between the subquery and main query.

F. Multiple columns or expressions can be compared between the subquery and main query.

Answer: A,D,F

Q8. Examine the commands used to createDEPARTMENT_DETAILS andCOURSE_DETAILS:

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)

B)

C)

D)

A. Option A

B. Option B

C. Option C

D. Option D

Answer: C

Q9. Examine thestructure 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? 

A)

B)

C)

D)

A. Option A

B. Option B

C. Option C

D. Option D

Answer: C

Q10. 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?

A. DELETE order_id FROM orders

WHERE order_total < 1000;

B. DELETE orders

WHERE order_total < 1000;

C. DELETE

FROM orders

WHERE (SELECT order_id FROM order_items);

D. DELETE orders o, order_items i WHERE o.order id = i.order id;

Answer: B