SQL Joins SQL Joins: A joins is a relational operation that combines row in one table to the rows in another table related table according to common values existing in…
SQL Joins With Table
SQL Joins With Table: A joins is a relational operation that combines row in one table to the rows in another table related table according to common values existing in corresponding columns such as primary and foreign key columns.
The joins condition is specified with WHERE clause of SELECT statement. You may join two tables if each one contains a column with same domain of values. It must be noted that to join multiple tables, there should be one WHERE condition for each pair of tables being joined. Thus if N tables are to be combined, there should be N-1 WHERE condition.
Join is the combination of product, projection and selection operations. If selection operation is omitted, then the resultant table may contain duplicated rows.
Types of SQL Joins
There are the following types of joins
Equi-joins is the type of join in which joining condition is based on the equality (=) between values in common columns.
For example, to retrieve data from STUDENT and RESULT table the SELECT statement is written as:
WHERE Student.Roll_no = Result.Roll_no
The result of the above query is