753 views
2 votes
2 votes

A relational database contains two tables employee and department in which employee table has coumns emp-no and dept-id and department table has columns dept-id and dept-name. The following insert statements were executed successfully to populate the empty tables:

Insert into department values(1,'computer science')
Insert into department values(2,'information technology')
insert into employee values(1,'Navin',1)
insert into employee values(2,'Mukesh',2)
insert into employee values(3,'Suresh',2)

How many rows and columns will be retrieved by the following SQL statement

Select * from employee, department

A) 0 row and 4 columns

B) 3 rows and 4 columns

C) 3 rows and 5 columns

D) 6 rows and 5 columns

2 Answers

2 votes
2 votes
the two tables will have 2 tuples , 3 tuples thus there cartesian product will be 6 rows and since there are 3+2 collumns thus 5 collums will be there.  GATE-IT-2004
1 votes
1 votes
Sice we have same column name in both table e.g dept_id

so natural join is performed for emp.dept_id = dept.dept_id

natural join: 1st do the cartesian product then apply the above condition.

It will return 3 rows and 4 columns

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
1 answer
3
Sankaranarayanan P.N asked Oct 27, 2016
704 views
A B-tree used as an index for a large database table has four levels including root node. If a new key is inserted in this index, then the maximum number of nodes that co...
1 votes
1 votes
2 answers
4
Sankaranarayanan P.N asked Oct 27, 2016
1,243 views
A table has fields F1, F2, F3, F4, F5 with the following functional dependencies $F1 \rightarrow $F1 \rightarrow F3, F2 \rightarrow F4, (F1,F2) \rightarrow F5$F3$ in ter...