573 views
1 1 vote
Q1: (Select eno from emp where deptno=10) union(Select eno from emp where deptno=20)

Q2:(Select eno from emp where deptno=10 or deptno=20)

Which one is true?

1)Q1⊆Q2

2)Q2⊆Q1

3)Q1=Q2

4)data inefficient

1 Answer

Best answer
3 3 votes
1.should be ans..

Since" union" eliminates the duplicates by default behavior since it is set operation.

In SQL "select " doesn't eliminate duplicates.
• selected by
Position:
Show:

Related questions

0 0 votes
1 1 answer
104
104 views
GO Classes asked 5 days ago
104 views
The database contains relations $\mathrm{animals}$ and $\mathrm{visits}$, with $\mathrm{aid}$ identifying an animal.Which SQL query returns the names of animals that visi...
0 0 votes
1 1 answer
90
90 views
GO Classes asked 5 days ago
90 views
The $\mathrm{Employee}$ relation contains:$$\begin{array}{|c|c|c|c|} \hline \mathrm{EmployeeNo} & \mathrm{Name} & \mathrm{DateOfBirth} & \mathrm{Department} \\ \hline 000...
2 2 votes
1 1 answer
207
207 views
GO Classes asked 6 days ago
207 views
Relation $\mathrm{R}(\mathrm{at1},\mathrm{at2},\mathrm{at3})$ contains: $$\begin{array}{|c|c|c|} \hline \mathrm{at1} & \mathrm{at2} & \mathrm{at3} \\ \hline 12 & 15 & 510...
0 0 votes
1 1 answer
116
116 views
GO Classes asked 6 days ago
116 views
A concert-ticket system contains $\mathrm{Sales}$ and $\mathrm{Payment}$.Relevant rules are:a row is placed in $\mathrm{Sales}$ when a purchase application is made; if pa...