The CROSS JOIN keyword returns all records from both tables (table1 and table2).
CROSS JOIN Syntax
SELECT column_name(s)
FROM table1
CROSS JOIN table2;
Given below is a selection of name table
The CROSS JOIN keyword returns all records from both tables (table1 and table2).
CROSS JOIN Syntax
SELECT column_name(s)
FROM table1
CROSS JOIN table2;
Given below is a selection of name table
Full outer join in SQL helps combine data from two tables. One can begin writing a query along the lines of select data from a table. The query is then followed by 'full outer join' keyword and the second table name whose data needs to be combined with the first table. Then there is an on clause which joins the data between the two tables based on common values between similar fields in the two tables.
In the below example we have a table named 'name'.
The empID (employee ID) column is the common factor between the two tables. We will thus perform a join on these columns. The output should be a combination of the two tables. Hence the output must contain the columns 'empID', 'name' and 'age'. We will leverage the concept of full outer join as shown below to achieve our goal. Note that in a full outer join all records from the right hand table are returned along with all the records from the left hand side table.
Right join in SQL helps combine data from two tables. One can begin writing a query along the lines of select data from a table. The query is then followed by 'right join' keyword and the second table name whose data needs to be combined with the first table. Then there is an on clause which joins the data between the two tables based on common values between similar fields in the two tables.
In the below example we have a table named 'name'.
Left join in SQL helps combine data from two tables. One can begin writing a query along the lines of select data from a table. The query is then followed by 'left join' keyword and the second table name whose data needs to be combined with the first table. Then there is an on clause which joins the data between the two tables based on common values between similar fields in the two tables.
In the below example we have a table named 'name'.
Inner join in SQL helps combine data from two tables. One can begin writing a query along the lines of select data from a table. The query is then followed by 'inner join' keyword and the second table name whose data needs to be combined with the first table. Then there is an on clause which joins the data between the two tables based on common values between similar fields in the two tables.
In the below example we have a table named 'name'.