Database Concepts
Database Concepts
DATABASE INDEPENDENCE:
The ability to modify a scheme definition in
one level without affecting a scheme
definition in the next higher level is called
Data Independence.
Relation : A Relation of a table is data
arranged in rows and columns.
R 5 2
S 4 2
A natural join is a type of equi join which occurs implicitly by comparing all the same names columns in
both tables. The join result has only one column for each pair of equally named columns. In other
words, the Natural Join helps to join the two tables based on the same attribute name and the
datatypes.
We use Equi Join if we need both tables in the output without missing any column. We use Natural Join
if we need only the unique columns without repetition
SELECT * FROM
Employee
NATURAL JOIN
Department;
SQL Joins
A JOIN clause is used to combine rows from two or more tables, based on
a related column between them.
•(INNER) JOIN: Returns records that have matching values in both tables
•LEFT (OUTER) JOIN: Returns all records from the left table, and the
matched records from the right table
•RIGHT (OUTER) JOIN: Returns all records from the right table, and the
matched records from the left table
•FULL (OUTER) JOIN
Examples of different joins