What is Cartesian product in the SQL?

Showing Answers 1 - 18 of 18 Answers

Guest

  • Jan 9th, 2007
 

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......

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

  Was this answer useful?  Yes

g_sidhu

  • Feb 12th, 2008
 

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.

safdar

  • Feb 14th, 2008
 

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



  Was this answer useful?  Yes

sampra

  • Feb 26th, 2008
 

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......

  Was this answer useful?  Yes

jomarie

  • Sep 2nd, 2014
 

this is formed when join conditions is omitted or invalid

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions