Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






Queries that return more than one row from the inner SELECT statement are called

Multiple-row subqueries

58) Consider the following SQL statement. What will be the result?

SELECT e.last_name, e. salary, d.department_name

From employees e, departemant d

The last name …

Use the ______________operator to return rows returned by the first query that are not present in the second query

MINUS

60) Which SQL statement is used to extract data from a database?

SELECT

61) Consider the following SQL statement. What will be the result?

SELECT e.last_name, d.departemant_name

From employees e NATURAL JOIN departemant d

An error will occur since NATURAL JOIN

62)

 

1.Which SET operator does the following figure indicate?

 

A. UNION

B. UNION ALL

C. INTERSECT

D. MINUS

2.Which SET operator does the following figure indicate?

 

A. UNION

B. UNION ALL

C. INTERSECT

D. MINUS

3.Which SET operator does the following figure indicate?

 

A. UNION

B. UNION ALL

C. INTERSECT

D. MINUS

4.Which SET operator does the following figure indicate?

 

A. UNION

B. UNION ALL

C. INTERSECT

D. MINUS

5.What is true about SET operators?

A. They change values of rows

B. They combine the results of only two component queries into one result

C. They combine the results of 10 component queries into two result sets.

D. They combine the results of two or more component queries into one result

6.What are the queries containing SET operators called?

A. Sub-queries

B. Co-related sub-queries

C. GROUP BY queries

D. Compound queries

7.What is true about the UNION operator?

A. It returns rows from the combined queries along with NULL values

B. It returns rows for the combined queries after eliminating duplicates

C. It returns rows for the combined queries along with duplicate values

D. It returns rows for the combined queries ignoring the NULL values

8.What is true about the UNION ALL operator?

A. It returns rows from the combined queries along with NULL values

B. It returns rows for the combined queries after eliminating duplicates

C. It returns rows for the combined queries along with duplicate values

D. It returns rows for the combined queries ignoring the NULL values

9.What is true about the INTERSECT operator?

A. It returns rows from the combined queries along with NULL values

B. It returns rows for the combined queries after eliminating duplicates

C. It returns the common rows from the combined queries

D. None of the above

10.What is true about the MINUS operator?

A. It returns rows from the first query but not from the second query

B. It returns rows for the second query but not from the first query

C. It returns duplicate rows for the combined queries

D. It returns rows for the combined queries ignoring the NULL values

.

11.What is the precedence of the set operators UNION, UNION ALL, INTERSECT and MINUS?

A. UNION, UNION ALL, INTERSECT and MINUS

B. MINUS, UNION, UNION ALL and INTERSECT



C. INTERSECT, MINUS, UNION ALL, UNION

D. Equal precedence

12.What is the order of evaluation of set operators?

A. Left to Right

B. Right to Left

C. Random Evaluation

D. Top to Bottom

13.In which of the following cases, parenthesis should be specified?

A. When INTERSECT is used with other set operators

B. When UNION is used with UNION ALL

C. When MINUS is used for the queries

D. None of the above

14.What is true about the SELECT clause when SET operators are used?

A. There is no restriction on the columns being selected

B. The columns, expressions used in the SELECT clause must match in number in the combined queries

C. The columns, expressions used in the SELECT clause must be N in the first query and N-1 in the subsequent combined queries

D. Both B and C

15.What is true about the SET operators?

A. The SELECT clause should have the same number of columns, data types can be different

B. The SET operators can be used only for combining two queries

C. The data type of each column in the 2nd query must match the data type of its corresponding column in the first query.

D. None of the above

16.Where can the ORDER BY clause be used in case when SET operators are used?

A. In each of the queries being combined

B. In the first query only

C. At the very end of the compound query

D. None of the above

17.What is true about the queries that have SET operators in their WHERE clause?

A. These queries must have the same no. and data type of columns in their SELECT clause.

B. The no. of columns used in the WHERE clause query and the main SELECT can be different

C. The no. of columns used in the WHERE clause should be the same, the data type can be different

D. None of the above

18.What is true about the columns in the second query with respect to the columns in the first query?

A. The column in the 2nd query must be in the same data type group as the corresponding column in the 1st query

B. If a column in the 1st query is a NUMBER, the corresponding column in the 2nd query should be a VARCHAR2

C. If a column in the 1st query is a NUMBER, the corresponding column in the 2nd query should be also be NUMBER.

D. None of the above

19.What among the following is true about SET operators?

A. SET operators cannot be used in sub-queries

B. SET operators can only be used in the WHERE clause

C. ORDER BY can be used for all queries combined by a SET operator

D. SET operators can be used in sub-queries

20.What is the best way to change the precedence of SET operators given the fact that they have equal precedence?

A. The order of usage of the SET operators can be changed to change the precedence

B. The equal precedence cannot be changed

C. Parenthesis can be used to change the precedence

D. None of the above

21.What can be said about duplicate values and SET operators?

A. No SET operator displays duplicate values

B. All SET operators can display duplicate values

C. Only UNION ALL operator displays duplicate values

D. None of the above

Answer: C.UNION, INTERSECT and MINUS automatically eliminate duplicate values


Date: 2016-01-14; view: 1084


<== previous page | next page ==>
There can be more than one condition in a query | Examine the structure of the EMPLOYEES and DEPARTMENTS tables and consider the following query and answer the questions 22 and 23.
doclecture.net - lectures - 2014-2024 year. Copyright infringement or personal data (0.014 sec.)