232k views
3 votes
The ____________________ set operator is used to display the results that were returned by the first query that were not also returned by the second query.

A) UNION
B) INTERSECT
C) MINUS
D) JOIN

User Talendar
by
7.9k points

1 Answer

3 votes

Final answer:

The set operator used to display results from the first query that are not in the second query is the MINUS operator.

Step-by-step explanation:

The set operator used to display the results that were returned by the first query that were not also returned by the second query is C) MINUS.

In SQL, the MINUS operator takes two queries and returns the rows from the first query that do not appear in the results of the second query. It effectively subtracts the results of the second query from the first. This operator is particular to some databases, like Oracle, while in others like MySQL, the equivalent functionality is achieved using the 'NOT IN' clause or a 'LEFT JOIN' with a NULL check.

For example, if you have two queries, Query A that selects all the students from a school, and Query B that selects students who are in the football team, using the MINUS operator between these two queries would return the students who are in the school but not in the football team.

User Jdickel
by
8.3k points