Relational Algebra
Select Operation (σ)
σsubject = "database"(Books)
σsubject = "database" and price = "450"(Books)
σsubject = "database" and price = "450" or year > "2010"(Books)
Project Operation (∏)
∏subject, author (Books)
Union Operation (∪)
r ∪ s = { t | t ∈ r or t ∈ s}
- r, and s must have the same number of attributes.
- Attribute domains must be compatible.
- Duplicate tuples are automatically eliminated.
∏ author (Books) ∪ ∏ author (Articles)
Set Difference (−)
∏ author (Books) − ∏ author (Articles)
Cartesian Product (Χ)
σauthor = 'tutorialspoint'(Books Χ Articles)
Rename Operation (ρ)
Relational Calculus
Tuple Relational Calculus (TRC)
{ T.name | Author(T) AND T.article = 'database' }
{ R| ∃T ∈ Authors(T.article='database' AND R.name=T.name)}
Domain Relational Calculus (DRC)
{< article, page, subject > |∈ TutorialsPoint ∧ subject = 'database'}
0 comments:
Post a Comment