edited by
731 views
3 votes
3 votes

Consider the following set of relations:   
EMP(eno, ename, dno)
DEPT(dno,dname)
Primary key columns are in bold and dno in EMP is a foreign key referring primary key of DEPT table.

Now consider the following queries:

QUERY : 1

SELECT * FROM emp e, dept d WHERE e.dno = d.dno;

QUERY : 2

SELECT * FROM emp NATURAL JOIN dept ;

Then which of the following statements are TRUE regarding the above queries?

  1. Both Query:1 and Query:2 returns same no of rows.
  2. Both Query:1 and Query:2 returns same no of columns.
  3. Both Query:1 and Query:2 returns different no of rows.
  4. Both Query:1 and Query:2 returns different no of columns.
  1. I, II only
  2. I, IV only
  3. II, III only
  4. III, IV only
edited by

2 Answers

Best answer
3 votes
3 votes
EQUI JOIN (vs) NATURAL JOIN
Both returns same no of rows. But in Natural Join, the common columns will exist only ONCE, where as in Equi Join, the common columns repeats twice one for each table.
selected by
0 votes
0 votes
emp NATURAL JOIN dept

Q2 has a Natural Join

FROM emp e, dept d 
WHERE e.dno = d.dno;

Q1 has a cross product with equality condition

 

Both produce the same result for the number rows, but in Cross Product columns would be duplicated, while that won't happen in case of join.

So, I and IV are correct.

 

Option B

Answer:

Related questions

1 votes
1 votes
1 answer
1
Bikram asked Nov 26, 2016
334 views
Consider the join of relation R with a relation S. If R has $m$ tuples and S has $n$ tuples, then the maximum and minimum sizes of the join, respectively, are __________....
0 votes
0 votes
1 answer
2
Bikram asked Nov 26, 2016
245 views
A functional dependency of the form x → y is trivial ify ⊆ xy ⊂ xx ⊆ yx ⊂ y
0 votes
0 votes
1 answer
3
Bikram asked Nov 26, 2016
315 views
What does the following Tuple Relational Calculus query produce?The expression σθ1 (E1 ⋈θ2 E2) is the same as: E1 ⋈θ1^ θ2 E2 (σθ1 E1) ∧ (σθ2 E2 ) E1 ⋈ θ...