GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 90 of 171    Print  
what is the result of
select * from table1, table2

there is a common column between them but no where caluse has been specified

  
Total Answers and Comments: 9 Last Update: July 14, 2009     Asked by: sm 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 12, 2006 02:11:20   #1  
aditi        

RE: what is the result ofselect * from table1, t...
i tried to run the query & got the same result as on performing natural join on the tables.
 
Is this answer useful? Yes | No
June 12, 2006 05:10:09   #2  
Bharat        

RE: what is the result ofselect * from table1, t...

The result will be the cartesian product of the rows


 
Is this answer useful? Yes | No
June 13, 2006 02:19:14   #3  
MANS1201 Member Since: June 2006   Contribution: 1    

RE: what is the result ofselect * from table1, t...
THE RESULT OF SELECT * FROM TABLE1 TABLE2 ISGIVE THE ROWS AND COLUMN OF THE TABLE1 AND TABLE 2 WITH THE CARTISION PRODUCT OF THE TABLES
 
Is this answer useful? Yes | No
June 16, 2006 02:13:07   #4  
Arnab Sengupta        

RE: what is the result ofselect * from table1, t...
Hi Aditi The tables probably contained one row each. With no where clause specified you would hit a cartesian join.Regards.Arnab.
 
Is this answer useful? Yes | No
June 18, 2006 11:06:17   #5  
vssandilya Member Since: December 2005   Contribution: 8    

RE: what is the result ofselect * from table1, t...
select * from table1 inner join table2
 
Is this answer useful? Yes | No
June 19, 2006 05:28:16   #6  
abc        

RE: what is the result ofselect * from table1, t...

Any queries that you run without a where clause would create a cartesian join which has meaningless output.


 
Is this answer useful? Yes | No
July 24, 2006 02:44:54   #7  
msuri        

RE: what is the result ofselect * from table1, t...

Though the they haveing common cloumn without mention where or Natural join its will be cartesian product


 
Is this answer useful? Yes | No
August 02, 2006 10:34:46   #8  
dmadhusudhanarao Member Since: August 2006   Contribution: 7    

RE: what is the result ofselect * from table1, t...

assume that 2 table are emp dept

now write query like this

select * from emp dept

the out put is emp has 14 records and dept has 4 records

then output is 14x4 56 records you will simply.


 
Is this answer useful? Yes | No
July 14, 2009 02:49:42   #9  
jaspreet.nagra Member Since: July 2009   Contribution: 3    

RE: what is the result ofselect * from table1, table2there is a common column between them but no where caluse has been specified

Assume you have following two tables:

SQL> select * from aa;
DAT NAME
---- --------

1 Amit
2 Jas

SQL> select * from bb;
DAT ANAME
---- ---------

1 Delhi
3 Mumbai

The following SQL will give me 4 rows
SQL> select * from aa bb;
DAT NAME DAT_1 ANAME
---- ------- ------- ---------

1 Amit 1 Delhi
2 Jas 1 Delhi
1 Amit 3 Mumbai
2 Jas 3 Mumbai


Now if any of the 2 table having 0 rows then the result will : No rows selected. As

in Oracle any addition multiplication division and joining two tables with one as null the output will only be as Null.

To have natural join we need to do following:

SQL> select * from aa natural join bb;
DAT NAME ANAME
--- ------ -------
1 Amit Delhi


I hope this will help.



 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape