Table and Integrity Constraints
Table and Integrity Constraints
Table and Integrity Constraints
XII-IP
Tables Integrity Constraints
Employee Department
Type of Join
There are different types of joins available in SQL:
• INNER JOIN (Equi): returns rows when there is a match in both
tables.
• LEFT JOIN: returns all rows from the left table, even if there are
no matches in the right table.
• RIGHT JOIN: returns all rows from the right table, even if there are
no matches in the left table.
• FULL JOIN: returns rows when there is a match in one of the
tables.
• SELF JOIN: is used to join a table to itself as if the table were two
tables, temporarily renaming at least one table in the SQL
statement.
• CARTESIAN JOIN: returns the Cartesian product of the sets of
records from the two or more joined tables.
Type of Join
Procedure to join tables
1. Create two table as given structure and insert values :
Inner Join
I NNER J OI N: Returns all rows when there is at least one match in
BOTH tables. The I NNER J OI N keyword selects all rows from both
tables as long as there is a match between the columns in both tables.