Page 1 :
Table Joins in SQL, , Fetching data from multiple tables Fetching data in faster way
Page 2 :
Joining, , A join is a query that combines rows from two of, more tables. In JOIN query more than one table, are listed in FROM clause. MySQL provides, , various type of Joining :, , 1) CROSS JOIN or CARTESIAN PRODUCT, 2) EQUI-JOIN, 3) NATURAL JOIN
Page 3 :
VINOD KUMAR VERMA, PGT(CS), KV OEF KANPUR &, SACHIN BHARDWAJ, PGT(CS), KV NO.1 TEZPUR,, , Cross Join (Cartesian product), , ¢ It return all possible concatenation of all rows, from both table i.e. one row of First table is, joined with all the rows of second table., , ¢ Cartesian product join each row of one table, with each row of another table. So if —, , ¢ First table have 6 rows and second table have 4 rows, then total number of rows in output will be 6 x 4 = 24., , e i.e. Total Number of Rows. after Cartesian, product(Cardinality) = Cardinality of First Table X, Cardinality of Second Table
Page 4 :
— |, , VINOD KUMAR VERMA, PGT(CS), KV OEF KANPUR &, SACHIN BHARDWAJ, PGT(CS), KV NO.1 TEZPUR, , Cross Join (Cartesian product), Ea, , RED LIGHT, GREEN CYAN, BLUE SILVER, , e Suppose | want a combination of all colors with all, shades. In this case Cartesian product or cross join is, used., , ¢ For Example, ° Select * from Shades,Color, , ¢ Output will contain 9 rows i.e. no. of rows in first, table x no. of rows in second table
Page 5 :
mysql> select * from shades,color;, , yellow, eta, , rows in set (0.00 sec), , * from shades;, , rows in set (@.01 sec)