Solveeit Logo

Question

Computer Science Question on SQL

Consider the following two tables emp1 and emp2:emp1

Id| Name
1| Amit
2| Punita
emp2

Id| Name
1| Punita
2| Anand
What is the output of the following query?
SELECT name from emp1 minus SELECT name from emp2;

A

Punita

B

Amit

C

Anand

D

Amit, Punita

Answer

Amit

Explanation

Solution

The 'MINUS' operation returns the difference between two datasets. Here, the name "Amit" in emp1 is not present in emp2.