GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 110 of 171    Print  
What is Cartesian product in the SQL?

  
Total Answers and Comments: 5 Last Update: February 26, 2008     Asked by: Sameer Yajurvedi 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by:
 
when a join condition is omited when getting  result from two tables then that kind of query gives us Cartesian product, in which all combination of rows displayed. All rows in the first table is joined to all rows of second table......

Above answer was rated as good by the following members:
hereoracleuser
January 09, 2007 16:23:15   #1  
       

RE: What is Cartesian product in the SQL?
when a join condition is omited when getting result from two tables then that kind of query gives us Cartesian product in which all combination of rows displayed. All rows in the first table is joined to all rows of second table......
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
January 29, 2007 07:34:08   #2  
Ajay Nerumati Member Since: January 2007   Contribution: 3    

RE: What is Cartesian product in the SQL?
Hi All It is a common requirement in Oracle to join tables using join syntax you end up getting a cartesian product 1. when a join condition is ommited .2. The condition is not a valid condition.Under such curcumstances all rows of table 'A' are mapped to table 'N' resulting in A*N number or rows.Thank you Ajay Nerumati.Oracle DBA
 
Is this answer useful? Yes | No
February 12, 2008 16:09:23   #3  
g_sidhu Member Since: August 2007   Contribution: 122    

RE: What is Cartesian product in the SQL?
Cartesian Products: If two tables in a join query have no join condition Oracle returns their Cartesian product. Oracle combines each row of one table with each row of the other. A Cartesian product always generates many rows and is rarely useful.A Cartesian product is formed when:A join condition is omittedA join condition is invalidAll rows in the first table are joined to all rows in the second table

To avoid a Cartesian product always include a valid join condition in a WHERE clause.


 
Is this answer useful? Yes | No
February 14, 2008 05:53:50   #4  
safdar Member Since: September 2007   Contribution: 5    

RE: What is Cartesian product in the SQL?

hi
we have two table emp and dept in scott user
emp have 14 rows and dept have 5 rows
if we write this query
select emp.ename emp.sal dept.dname from emp dept;
this query provide you 70 rows
this called cartesian product 14*5




 
Is this answer useful? Yes | No
February 26, 2008 05:28:20   #5  
sampra Member Since: February 2008   Contribution: 278    

RE: What is Cartesian product in the SQL?
when a join condition is omited when getting result from two tables then that kind of query gives us Cartesian product in which all combination of rows displayed. All rows in the first table is joined to all rows of second table......
 
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