SQL Set Operators Explained: UNION, INTERSECT, MINUS
SQL Set Operators Explained: UNION, INTERSECT, MINUS
UNION
UNION ALL
INTERSECT
MINUS
Answer: A. Set operators are used to combine the results of two (or more) SELECT [Link] set
operators in Oracle 11g are UNION, UNION ALL, INTERSECT, and MINUS. When used with two SELECT
statements, the UNION set operator returns the results of both [Link],if there are any
duplicates, they are removed, and the duplicated record is listed only [Link] include duplicates in the
results,use the UNION ALL set [Link] lists only records that are returned by both queries;
the MINUS set operator removes the second query's results from the output if they are also found in the
first query's results. INTERSECT and MINUS set operations produce unduplicated results.
UNION
UNION ALL
INTERSECT
MINUS
Answer: B.
sql_certificate
UNION
UNION ALL
INTERSECT
MINUS
Answer: C. INTERSECT Returns only the rows that occur in both queries' result sets, sorting them and
removing duplicates.
UNION
UNION ALL
INTERSECT
MINUS
Answer: D. MINUS Returns only the rows in the first result set that do not appear in the second result
set, sorting them and removing duplicates.
Answer: D. Set operators are used to combine the results of two (or more) SELECT statements. Valid
set operators in Oracle 11g are UNION, UNION ALL, INTERSECT, and MINUS.
Sub-queries
Co-related sub-queries
GROUP BY queries
Compound queries
Answer: D.
It returns rows from the combined queries along with NULL values
It returns rows for the combined queries after eliminating duplicates
It returns rows for the combined queries along with duplicate values
It returns rows for the combined queries ignoring the NULL values
Answer: B. UNION Returns the combined rows from two queries, sorting them and removing duplicates.
It returns rows from the combined queries along with NULL values
It returns rows for the combined queries after eliminating duplicates
It returns rows for the combined queries along with duplicate values
It returns rows for the combined queries ignoring the NULL values
Answer: C. UNION ALL Returns the combined rows from two queries without sorting or removing
duplicates.
Answer: C. INTERSECT Returns only the rows that occur in both queries' result sets, sorting them and
removing duplicates.
It returns rows from the first query but not from the second query
It returns rows for the second query but not from the first query
It returns duplicate rows for the combined queries
It returns rows for the combined queries ignoring the NULL values
Answer: A. MINUS Returns only the rows in the first result set that do not appear in the second result
set, sorting them and removing duplicates.
[Link] is the precedence of the set operators UNION, UNION ALL, INTERSECT and MINUS?
Left to Right
Right to Left
Random Evaluation
Top to Bottom
Answer: A, D. Assuming that there are no grouping of queries using parentheses, the SET operators will
be evaluated from top to bottom and left to right horizontally.
Answer: A. Using parenthesis will explicitly change the order of evaluation when INTERSECT is used
with other operators.
[Link] is true about the SELECT clause when SET operators are used?
Answer: B. All the combined should have the same no. of columns when using SET operators. The
corresponding columns in the queries that make up a compound query must be of the same data type
group.
The SELECT clause should have the same number of columns, data types can be different
The SET operators can be used only for combining two queries
The data type of each column in the 2nd query must match the data type of its corresponding
column in the first query.
None of the above
Answer: C. All the combined should have the same no. of columns when using SET operators. The
corresponding columns in the queries that make up a compound query must be of the same data type
group.
[Link] can the ORDER BY clause be used in case when SET operators are used?
Answer: C. If the ORDER BY clause is used in between any of the queries joined using SET operators, it
will throw an ORA error.
[Link] is true about the queries that have SET operators in their WHERE clause?
These queries must have the same no. and data type of columns in their SELECT clause.
The no. of columns used in the WHERE clause query and the main SELECT can be different
The no. of columns used in the WHERE clause should be the same, the data type can be
different
None of the above
Answer: A. All the combined should have the same no. of columns when using SET operators. The
corresponding columns in the queries that make up a compound query must be of the same data type
group.
[Link] is true about the columns in the second query with respect to the columns in the first query?
The column in the 2nd query must be in the same data type group as the corresponding column
in the 1st query
If a column in the 1st query is a NUMBER, the corresponding column in the 2nd query should be
a VARCHAR2
If a column in the 1st query is a NUMBER, the corresponding column in the 2nd query should be
also be NUMBER.
None of the above
Answer: A, C.
Answer: D.
[Link] is the best way to change the precedence of SET operators given the fact that they have equal
precedence?
The order of usage of the SET operators can be changed to change the precedence
The equal precedence cannot be changed
Parenthesis can be used to change the precedence
None of the above
Answer: C. Parenthesis can be used to group the specific queries in order to change the precedence
explicitly. Parentheses are preferred over other SET operators during execution.
Examine the structure of the EMPLOYEES and DEPARTMENTS tables and consider the following query
and answer the questions 22 and 23.
SELECT department_id
FROM employees e
UNION
SELECT department_id
FROM departments
Answer: A. UNION Returns the combined rows from two queries, sorting them and removing duplicates.
Answer: D. A compound query is one query made up of several queries using different tables.
[Link] is the default sorting order of the results when UNION ALL operator is used?
Descending
Ascending
Either A or B
All of the above
Answer: B. A compound query will by default return rows sorted across all the columns,from left to right
in ascending [Link] only exception is UNION ALL, where the rows will not be sorted. The only place
where an ORDER BY clause is permitted is at the end of the compound query.
[Link] will be the output of the compound query in which columns in the SELECT are of CHAR and
equal length?
Answer: B. 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. The corresponding columns in
the queries that make up a compound query must be of the same data type group.
[Link] will be the output of the compound query in which columns in the SELECT are of CHAR and
different lengths?
The output will have VARCHAR2 data type of equal length
The output will have CHAR data type of equal length
The output will have CHAR data type of different lengths
The output will have VARCHAR2 data type with the length of the larger CHAR value
Answer: D. While the selected column lists do not have to be exactly the same data type, they must be
from the same data type group. The result set of the compound query will have columns with the higher
level of precision.
[Link] will be the output of a compound query if either or both queries select values of VARCHAR2?
Answer: A. While the selected column lists do not have to be exactly the same data type, they must be
from the same data type group. The result set of the compound query will have columns with the higher
level of precision.
Answer: B, C. While the selected column lists do not have to be exactly the same data type, they must
be from the same data type group. The result set of the compound query will have columns with the
higher level of precision.
[Link] will happen if the SELECT list of the compound queries returns both a VARCHAR2 and a
NUMBER data type result?
Oracle will convert them implicitly and return a VARCHAR2 data type result
Oracle will convert them implicitly and return a NUMBER data type result
An ORA error is thrown
None of the above
Answer: D. NULL values are not ignored when the UNION operator is used
[Link] can be said about the names and columns of a SQL query which uses the UNION operator?
Answer: C. 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.
Consider the following exhibit of the JOB_HISTORY table and the query that follows. Answer the
questions 32 and 33 below the query.
[Link] many times the each employee will get displayed by the above query?
0
1
2
4
Answer: B. UNION Returns the combined rows from two queries, sorting them and removing duplicates.
It displays the current and previous job details of the employees twice
It displays the current and previous job details of the employees only once
Either A or B
None of the above
Answer: B.
Examine the given table structures and consider the following query and answer the questions 34 to
37 that follow:
[Link] that an employee with ID 121 has held 2 job IDs in his tenure in the company.
Considering the above query, how many times will his records be displayed in the results?
Once
Twice
Thrice
None of the above
Answer: B. UNION Returns the combined rows from two queries, sorting them and removing duplicates.
Duplicity is measured by the combination of columns and not the individual column separately.
[Link] that the employee with ID 121 held two positions in two different departments - 10 and
20 in the [Link] worked as 'SA_REP' in both the departments 10 and 20. What will be the
outcome of the above query ?
2 rows
3 rows
No rows
ORA error
Answer: B.
[Link] statements best describes the inference drawn from the questions 34 and 35?
Answer: C. As the combination of the job codes and departments is unique, there are no duplicates
obtained.
[Link] will be the sorting in the result set obtained by the query?
Descending on Employee ID
Descending on Job ID
Ascending on Employee ID
Ascending on Department ID
Answer: C. The default sorting will be ascending based on the first column i.e.: Employee ID in this
[Link], this behavior can be modified by placing a single ORDER BY clause at the end.
[Link] of the following operators will be used to obtain duplicate records from the component
queries?
UNION
UNION ALL
MINUS
None of the above
[Link] is the difference between the UNION and the UNION ALL operators?
There is no difference
UNION ALL displays duplicate values too
The output in the case of UNION ALL is not sorted by default
None of the above
Answer: B, C. When used with two SELECT statements, the UNION set operator returns the results of
both queries. However, if there are any duplicates, they are removed, and the duplicated record is listed
only once. To include duplicates in the results, use the UNION ALL set operator
The number of columns and data types of the columns in the component queries should be the
same
The names of the columns and data types of the columns in the component queries should be
the same
Both A and B
None of the above
[Link] can be said about the result set if the order of the intersected tables is altered when using
INTERSECT?
Answer: B.
[Link] need to display the names and job IDs of those employees who currently have a job title that is
the same as their previous one. Which of the following queries will work? (Consider the table
structures as given)
Answer: B.
[Link] the above query i.e. Option B in question 43, what will be the result if the department
ID is also included in the SELECT clause?
Answer: A. The result can be interpreted as - the employees who have worked with the same job title in
the same department.
Answer: D. MINUS set operator removes the second query's results from the output if they are also
found in the first query's results
[Link] can be said regarding the number of columns and data types of the component queries when
a MINUS operator is used?
They should be the same, the data type might be different but they should belong to the same
data type group.
They should be the same along with the names of the columns
Both A and B
None of the above
[Link] need to display the employee IDs of the employees who have not changed their jobs even once
during tenure in the company. Which of the following queries will be correct in this case? (Consider
the table structures as given)
SELECT employee_id
FROM employees
UNION
SELECT employee_id
FROM job_history;
SELECT employee_id
FROM employees
INTERSECT
Select employee_id
FROM job_history;
SELECT employee_id
FROM employees
MINUS
Select employee_id
FROM job_history;
SELECT employee_id
FROM employees
UNION ALL
SELECT employee_id
FROM job_history;
Answer: C.
Examine the given table structures and consider the following query answer the questions 48 and 49
that follow:
Answer: C. Each query must contain the same number of columns, which are compared positionally.
NULL can be substituted in place of column which is missing in the other query within the same
compound query.
[Link] the above query, if the UNION operator is replaced by the MINUS operator, what will
the result mean?
The result shows those employees who have an entry in the JOB_HISTORY table
The result shows those employees who do not have an entry in the JOB_HISTORY, but they are
present in the EMPLOYEES table
Either of A or B
None of the above
Answer: B. MINUS gives the unique results that are present in the first query but not the second query.
Consider the exhibit given below and answer the questions 50 and 51 that follow:
[Link] will be the outcome of the following query?
SELECT AU_DETAILS
FROM AUDIT
UNION
SELECT AU_DETAILS
FROM AUDIT_YEARLY;
It executes successfully giving the correct results including the duplicate values
It executes successfully giving the correct results excluding the duplicate values
It throws an ORA error
None of the above
Answer: C. CLOB or LONG columns cannot be in the SELECT clause when using the UNION set
operators.
[Link] will be the outcome of the query if UNION is replaced with UNION ALL?
It will execute successfully giving the correct results including duplicate values
It throws an ORA error
It will execute successfully giving the correct results excluding duplicate values
It executes successfully but gives the incorrect results.
Answer: B. .UNION, UNION ALL, INTERSECT and MINUS operators when used with a LONG or CLOB
column throws error.
[Link] that there are 4 component queries. How many SET operators can be used to combine
them in a single compound query?
1
2
4
3
Answer: D. The SET operator to be used will are N-1 where N is the number of component queries.
[Link] are SET operators called owning to the fact that two or more SELECTs are involved based on
columns instead of rows when SET operators are used?
Horizontal joins
Cartesian Joins
Vertical joins
Outer joins
Answer: C.
[Link] is the difference between a UNION and INTERSECT operators? (Choose only the best
difference)
UNION combines the results of two component queries into one result set with duplicate values
INTERSECT returns only those rows that are returned by each of the two component queries
UNION gives the distinct values from the component queries, INTERSECT gives the common
values from the component queries
Both B and C
Answer: C.
Examine the structure of the EMPLOYEES table and consider the following query. Answer the
questions 55 to 60 that follow.
SELECT *
FROM EMPLOYEES
where department_id = 10
Query 2
SELECT *
FROM EMPLOYEES E
where E.job_id IN (select first_name from EMPLOYEES E1 where E1.job_id =
[Link] need to extract a report where the results from both the queries are displayed. Which of the
following operators should be used to get the required results?
UNION
UNION ALL
INTERSECT
None of the above
Answer: B. UNION ALL Returns the combined rows from two queries without sorting or removing
duplicates.
[Link] need to display all the duplicate values along with all the values existing in the result set from
both the queries. Which of the following SET operators you can use in the above given queries?
INTERSECT
UNION
MINUS
None of the above
Answer: D. UNION ALL will give the unsorted results with duplicates.
[Link] is the difference between the result sets when using a UNION and a UNION ALL set
operators?
Answer: C, D.
[Link] UNION operator has more overhead on the database than the UNION ALL. What is wrong in this
statement?
Answer: A, C. UNION has to perform more tasks than UNION ALL because it sorts and deduplicates the
result sets. Hence it is recommended that unless distinct rows are required, UNION ALL should be used.
[Link] will be the outcome if the two queries given above are combined using the INTERSECT
operator?
It will display only those employees who are Clerks in the Department 10
It will display all those employees who are in the department 10
It will display all the Clerks.
None of the above
Answer: A. INTERSECT returns those records that are present in query 1 AND query 2.
[Link] among the following is the difference between the INTERSECT and the UNION operators?
INTERSECT follows the 'AND' Boolean logic, UNION follows the 'OR' Boolean logic
UNION follows the 'OR' Boolean logic, whereas INTERSECT follows the 'AND' logic
Either of A or B
None of the above
Answer: A.
[Link] which of the following SET operators, changing the order of the component queries will change
the result set?
UNION
UNION ALL
MINUS
INTERSECT
Answer: C. MINUS Returns only the rows in the first result set that do not appear in the second result
set, sorting them and removing duplicates.
Consider the following query and answer the questions 62 to 66 that follow:
SELECT 4 from dual
INTERSECT
SELECT 1 from dual;
No rows
4
1
NULL
Answer: A. No rows will be selected as the INTERSECT operator will not get any common results from
both the queries - INTERSECT operators gives common results present in query 1 AND query 2.
[Link] will be the outcome of the query if the INTERSECT operator is replaced with MINUS operator?
3
4
0
1
Answer: B. MINUS gives results that are present in the first query and not present in the second query.
[Link] will be the outcome of the above query if the INTERSECT operator is replaced with the UNION
operator?
1
4
4
1
NULL
0
Answer: A. UNION will produce distinct rows in the result set in ascending order.
[Link] will be the outcome of the above query if the INTERSECT operator is replaced with the UNION
ALL operator?
4
1
0
NULL
1
4
Answer: A. UNION ALL displays the results as they are positioned in the query without sorting them.
1
4
4
1
NULL
None of the above
Answer: A.
Examine the JOB_HISTORY_ARCHIVE table structure. It is a backup table for the JOB_HISTORY table
with no additional column. Assuming that both the table have dissimilar data, consider the query given
below and answer the questions 67 to 70 that follow:
67. What will be the outcome of the query given above? (Choose the best answer)
It will return those rows that are different in the two tables
It will return the common rows in the two tables
It will return all the rows from the two tables
None of the above
Answer: A.
[Link] can concluded if the above given query yields rows only from JOB_HISTORY table?
It shows that the JOB_HISTORY contains two rows different from JOB_HISTORY_ARCHIVE
table
It shows that two rows are same in JOB_HISTORY and JOB_HISTORY_ARCHIVE tables
It shows that the JOB_HISTORY_ARCHIVE contains two rows different from JOB_HISTORY
table
None of the above
Answer: A.
Answer: A.
[Link] respect to the query given above, if duplicate records exist in the two tables, which of the
following modifications should be made to the above given query?
COUNT(*)
COUNT(*) and GROUP BY employee_id
COUNT (*) and ORDER BY employee_id
None of the above
Answer: B. COUNT(*) can be used to see the difference between the tables.
NUM TEXT
---------- -----------
1 employee
departments
NUM TEXT
---------- -----------
1 employee
NULL departments
ORA error
NUM TEXT
---------- -----------
departments
1 employee
Answer: C. Here the numeric 1 is compared to a character NULL which throws the error "ORA-01790:
expression must have same datatype as corresponding expression".
Consider the following query and answer the questions 72 and 73 that follow:
[Link] will be the outcome of the query given above? (Assume that the SYSDATE is 1st July, 2013)
Answer: C. NUMBER and DATE do not belong to same data type fail. Here a number obtained by
MONTHS_BETWEEN is compared with a DATE and hence the error.
[Link] that the SELECT statement in the 2nd query is modified as below:
Answer: A.
Which of the below column headings will display in the result set?
EMP ID
Employee ID
EMPLOYEE_ID
ORA error because the column names must be same in the component queries.
Answer: B. 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.
Examine the two table structures given and consider the following query and answer the questions 75
and 76 that follow:
SELECT employee_id
FROM employees e
UNION
SELECT employee_id
FROM job_history j
ORDER BY j.employee_id ;
The results will be ordered by the employee ID from the JOB_HISTORY table
The results will be ordered by the employee ID from the EMPLOYEES table
There will be no ordering of the results
ORA error
Answer: D. The ORDER BY should be done based on the names of the columns from the first query and
not from the 2nd query columns.
[Link] of the following ORDER BY clauses can replace the erroneous ORDER BY in the query given
above?
ORDER BY e.employee_id
ORDER BY j.2
ORDER BY 1
None of the above, ORDER BY is not allowed in the query
Answer: C. This is a more generic specification and Oracle will order based on the first column of the
first query.
SELECT col_1
From TABLE (package1.proc1)
UNION
SELECT col_1
From TABLE (package2.proc2);
Examine the two table structures given and consider the following query. Answer the questions 79 and
80 that follow:
SQL> DESC employees
Name Null? Type
----------------------- -------- ----------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
ORA error
Employee_id and job_id
Employee_id
None of the above
Answer: A. The FOR UPDATE clause cannot be used with the query combined using the SET operators.
It will give all the columns from the employees tables and only the job_id column from the
job_history table
It will throw an error as the number of columns should match in the component queries
Neither B or C
None of the above
Answer: B.
[Link] UNION, UNION ALL, INTERSECT are used in one SQL statement which of the following is true
regarding the SQL statement?
UNION, UNION ALL will be executed first and then the result set will go for the INTERSECT
statement.
The execution of INTERSECT will precede the UNION and UNION ALL execution.
The execution will be done from right to left taking into consideration all the operators at the
same time.
The execution will be done from left to right taking into consideration all the operators at the
same time.
Answer: D.
[Link] the query given below and answer the question that follow:
It executes successfully.
It throws an error
It gives the result 3.
It gives the result 3f
[Link] of the following is false for set operators used in SQL queries?
The set operators are valid when used on columns with the LONG datatype.
The set operators are not valid on columns of type BLOB, CLOB, BFILE, VARRAY, or nested table.
In order for the select query containing an expression, a column alias should be provided in
order to refer it to the order_by_clause.
You cannot use these operators in SELECT statements containing TABLE collection
expressions.
Answer: A. SET operators are unsupported for LONG, CLOB and BLOB data types.
[Link] the given table structure and evaluate the following SQL statement:
Which ORDER BY clauses are valid for the above query? (Choose all that apply.)
ORDER BY 2,1
ORDER BY EMPLOYEE_NO
ORDER BY 2, employee_id
ORDER BY "EMPLOYEE_NO"
Answer: A, C. The ORDER BY clause must reference column by its position or the name referred by the
first query.
[Link] of the following clauses would you use to exclude the column from the 2nd query out of the
two queries combined using SET operators?
GROUP BY
ORDER BY
MINUS
UNION
Answer: C.
[Link] the given table structure as given. What will be the outcome of the below query?
UNION operates over only the first column in the SELECT list
UNION operates over the first columns of the SELECT lists in the component queries
UNION operates over all the columns being selected.
None of the above
Answer: C. UNION operates over all the columns in the SELECT list and does not ignore any columns.
[Link] need to display the departments where the employees with the JOB IDs 'SA_REP' or
'ACCOUNTANT' work. Which of the following queries will fetch you the required results? (Consider the
given table structure)
SELECT department_id
FROM employees E
Where job_id = 'SA_RE'
UNION
SELECT department_id
FROM employees E
Where job_id = 'ACCOUNTANT';
SELECT department_id
FROM employees E
Where job_id = 'SA_REP'
UNION ALL
Select department_id
FROM employees E
Where job_id = 'ACCOUNTANT';
SELECT department_id
FROM employees E
Where job_id = 'SA_REP'
INTERSECT
Select department_id
FROM employees E
Where job_id = 'ACCOUNTANT';
SELECT department_id
FROM employees E
Where job_id = 'SA_REP'
MINUS
Select department_id
FROM employees E
Where job_id = 'ACCOUNTANT';
Answer: A.
[Link] of the following statement is true about the ordering of rows in a query which uses SET
operator?
It is not possible to use ORDER BY in the individual queries that make a compound query.
An ORDER BY clause can be appended to the end of a compound query.
The rows returned by a UNION ALL will be in the order they occur in the two source queries.
The rows returned by a UNION will be sorted across all their columns, right to left.
Answer: A, B, C.
[Link] UNION operator was used to fulfill which of the following function before the ANSI SQL syntax
in place?
RIGHT OUTER JOIN
LEFT OUTER JOIN
EQUI-JOIN
FULL OUTER JOIN
Answer: D.
Answer the related questions 91 and 92 given below. Consider the table structures as given here:
[Link] need to find the job IDs which do not have any JOB history logged for them. Which of the
following queries will work? (Consider the given table structures)
SELECT job_id
FROM employees
UNION ALL
SELECT job_id
FROM job_history;;
SELECT job_id
FROM employees
MINUS
Select job_id
FROM job_history;;
SELECT job_id
FROM employees
UNION
SELECT job_id
FROM job_history;;
Answer: B.
SELECT job_id
FROM employees
UNION
SELECT job_id
FROM job_history;;
SELECT job_id
FROM employees
UNION ALL
SELECT job_id
FROM job_history;;
SELECT job_id
FROM employees
MINUS
Select job_id
FROM job_history;;
SELECT job_id
FROM employees
INTERSECT
SELECT job_id
FROM job_history;;
Answer: A.
Examine the table structures given here. Consider the query given below and answer the related
questions 93 to 97 that follow:
SELECT job_id
FROM employees
UNION ALL
SELECT job_id
FROM job_history;;
[Link] the EMPLOYEES table contains 5 records and the JOB_HISTORY contains 3 records, how many
records will be obtained from the below query?
4
3
0
8
Answer: D. UNION ALL Returns the combined rows from two queries without sorting or removing
duplicates.
[Link] the UNION ALL operator is replaced with UNION operator, how many records will be obtained?
(Assume there are 6 distinct values in both the tables)
5
3
2
6
Answer: D. UNION Returns the combined rows from two queries, sorting them and removing duplicates.
[Link] the UNION ALL operator is replaced with MINUS operator, how many records will be obtained?
(Assume there are 3 distinct values in EMPLOYEES and 2 in JOB_HISTORY)
3
2
1
0
Answer: C. MINUS Returns only the rows in the first result set that do not appear in the second result
set, sorting them and removing duplicates.
[Link] the UNION ALL operator is replaced with INTERSECT operator, how many records will be
obtained? (Assume there are 3 values common between the two tables)
8
6
3
2
Answer: C. INTERSECT Returns only the rows that occur in both queries' result sets, sorting them and
removing duplicates.
[Link] the following query:
[Link] job_id
2. from employees
[Link] BY department_id
[Link] ALL
[Link] job_id
[Link] job_history;
[Link] BY department_id ;
The above query generates an error. Which line in the above query generates an error?
3
7
2
No error is obtained
Answer: A. ORDER BY should only appear at the end of the compound query and not in the component
queries.
[Link] of the following SET operator features are supported in SQL/Foundation:2003 but not by
Oracle?
UNION ALL
MINUS ALL
INTERSECT ALL
EXCEPT ALL
Answer: B, C, D.
[Link] need to find out the common JOB IDs (excluding duplicates) in the departments 100 and 200.
Which query will you fire to get the required results? (Consider the table structure as given)
Answer: A.
[Link] a compound query contains both a MINUS and an INTERSECT operator, which will be applied
first? (Choose the best answer.)