Tutorials Hut

  • SQL Testing




  • What is SQL- CARTESIAN or Cross JOIN ?

    • The cross join returns a Cartesian product of rows from both tables.
    • It Returns All rows from first table, Each row from the first table is combined with all rows from the second table

    If Table 1 Contains n rows and Table 2 contains m rows

    Then cross join of both the tables will return m*n rows.

    Syntax:

    SELECT select_List FROM Table1 cross join Table2;

    Example:

    Table 1 – Department

    Consider Department table having below records.

    DepartmentTable

    Table 2 – Student

    Consider Student table having below records.

    StudentTable
    Select * from Student cross join Department

    After executing above query , we will find the below result:

    CrossJoin



  • SQL Testing


















  • Leave a Reply

    Your email address will not be published. Required fields are marked *