DBMS Unit 2
DBMS Unit 2
Unit - 2
Relational Model Constraints
● Domain constraints
● Key constraints or Uniqueness Constraints
● Entity Integrity constraints
● Referential integrity constraints
Types of Constraints
Domain Constraints
● Selection(σ)
● Projection(π)
● Union(U)
● Set Difference(-)
● Set Intersection(∩)
● Rename(ρ)
● Cartesian Product(X)
● Join (⋈)
Selection(σ)
Notation: σc(R)
σ Team = 'A'
(Student)
Projection(π)
Notation : πA (R)
πName Salary (Employees)
Union(U)
Set Difference(-)
Set Intersection(∩)
Cartesian Product(X)
Join (⋈)
● JOIN is used to combine related tuples from two
relations R and S.
● In its simplest form the JOIN operator is just the cross
product of the two relations and is represented as (R ⋈
S).
● JOIN allows you to evaluate a join condition between the
attributes of the relations on which the join is
undertaken.
R⋈ cS = σc(R X S)
Join condition C is of the form:
<cond_1> AND <cond_2> AND … AND <cond_k>
Each cond_i is of the form A op B, where:
A is an attribute of R, B is an attribute of S
op is a comparison operator: =, <, >, , , or .
Different types:
● Theta-join
● Equi-join
● Natural join