SlideShare a Scribd company logo
1 of 17
Database-Management
Concepts
Relational Algebra
 Recalling Relational Model
 Defining Relational Algebra
 Set Theoretic Operations
 Specific Relational Operations
Relational Model
Relational Model consists of the elements: relations,
which are made up of attributes.
 A relation is a set of attributes with values for each attribute
such that:
 Each attribute value must be a single value only (atomic).
 All values for a given attribute must be of the same type (or
domain).
 Each attribute name must be unique.
 The order of attributes is insignificant
 No two rows (tuples) in a relation can be identical.
 The order of the rows (tuples) is insignificant.
Defining Relational Algebra
 Relational Algebra is a collection of
operations on Relations.
 Relations are operands and the result of
an operation is another relation.
 Two main collections of relational
operations:
1. Set theory operations:
Union, Intersection, Difference and Cartesian
product.
2. Specific Relational Operations:
Selection, Projection, Join, Division
Set Theoretic Operations
Relation: R
First Last Age
Bill Smith 22
Sally Green 28
Mary Keen 23
Tony Jones 32
Relation : S
First Last Age
Forrest Gump 36
Sally Green 28
DonJuan DeMarco 27
Consider the following relations R and S
Set Theoretic Operations
Union: R U S
Result: Relation with tuples from R and S with duplicates removed.
First Last Age
Bill Smith 22
Sally Green 28
Mary Keen 23
Tony Jones 32
Forrest Gump 36
DonJuan DeMarco 27
Result of R U S
Set Theoretic Operations
Difference: R - S
Result: Relation with tuples from R but not from S.
Result of R - S
First Last Age
Bill Smith 22
Mary Keen 23
Tony Jones 32
Set Theoretic Operations
Difference: R ∩ S
Result: Relation with tuples that appear in both R and S.
Result of R ∩ S
First Last Age
Sally Green 28
Set Theoretic Operations
 Cartesian Product: Produce all combinations of tuples from
two relations.
Relation: R
First Last Age
Bill Smith 22
Mary Keen 23
Tony Jones 32
Relation: S
Dinner Dessert
Steak Ice Cream
Lobster
Cheesecak
e
Result: R X S
First Last Age Dinner Dessert
Bill Smith 22 Steak Ice Cream
Bill Smith 22 Lobster Cheesecake
Mary Keen 23 Steak Ice Cream
Mary Keen 23 Lobster Cheesecake
Tony Jones 32 Steak Ice Cream
Tony Jones 32 Lobster Cheesecake
Specific Relational Operations
Selection Operators
 Selection and Projection are unary operators.
 The selection operator is sigma: σ
 The selection operation acts like a filter on a relation by returning
only a certain number of tuples.
 The resulting relation will have the same degree as the original
relation.
 The resulting relation may have fewer tuples than the original
relation.
 The tuples to be returned are dependent on a condition that is part of
the selection operator.
 σ C (R) Returns only those tuples in R that satisfy condition C
 A condition C can be made up of any combination of comparison or
logical operators that operate on the attributes of R.
Specific Relational Operations
 Comparison operators: < > ≥ ≤ = ≠
 Logical operators:
T F
T T F
F F F
Use the Truth tables (memorize these) for logical expressions:
T F
T T T
F T F
T F
F T
Specific Relational Operations
 Assume the following relation EMP has the following tuples:
Name Office Dept Rank
Smith 400 CS Assistant
Jones 220 Econ Adjunct
Green 160 Econ Assistant
Brown 420 CS Associate
Smith 500 Fin Associate
Specific Relational Operations
Select only those Employees in the CS department:
Dept = 'CS' (EMP)
Result:
Name Office Dept Rank
Smith 400 CS Assistant
Brown 420 CS Associate
Selection Examples
Specific Relational Operations
Selection Examples
Select only those Employees with last name Smith who are
assistant professors:
Name = 'Smith' Rank = 'Assistant' (EMP)
Name Office Dept Rank
Smith 400 CS Assistant
Result
Specific Relational Operations
Selection Examples
Result
Select only those Employees who are either Assistant Professors or in the
Economics department:
Rank = 'Assistant' Dept = 'Econ' (EMP)
Name Office Dept Rank
Smith 400 CS Assistant
Jones 220 Econ Adjunct
Green 160 Econ Assistant
Specific Relational Operations
Selection Examples
Result
Select only those Employees who are not in the CS
department or Adjuncts:
(Rank = 'Adjunct' Dept = 'CS') (EMP)
Name Office Dept Rank
Green 160 Econ Assistant
Smith 500 Fin Associate
Thank You


More Related Content

Viewers also liked

Information System Security(lecture 1)
Information System Security(lecture 1)Information System Security(lecture 1)
Information System Security(lecture 1)Ali Habeeb
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of DatabaseMarlon Jamera
 
Information System Security introduction
Information System Security introductionInformation System Security introduction
Information System Security introductionShu Shin
 
Information system and security control
Information system and security controlInformation system and security control
Information system and security controlCheng Olayvar
 
Security and control in mis
Security and control in misSecurity and control in mis
Security and control in misGurjit
 
Security & control in management information system
Security & control in management information systemSecurity & control in management information system
Security & control in management information systemOnline
 
Information Security Management System ISO/IEC 27001:2005
Information Security Management System ISO/IEC 27001:2005Information Security Management System ISO/IEC 27001:2005
Information Security Management System ISO/IEC 27001:2005ControlCase
 
SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)
SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)
SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)Biswajit Bhattacharjee
 
Database Management Systems (DBMS)
Database Management Systems (DBMS)Database Management Systems (DBMS)
Database Management Systems (DBMS)Dimara Hakim
 

Viewers also liked (9)

Information System Security(lecture 1)
Information System Security(lecture 1)Information System Security(lecture 1)
Information System Security(lecture 1)
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Information System Security introduction
Information System Security introductionInformation System Security introduction
Information System Security introduction
 
Information system and security control
Information system and security controlInformation system and security control
Information system and security control
 
Security and control in mis
Security and control in misSecurity and control in mis
Security and control in mis
 
Security & control in management information system
Security & control in management information systemSecurity & control in management information system
Security & control in management information system
 
Information Security Management System ISO/IEC 27001:2005
Information Security Management System ISO/IEC 27001:2005Information Security Management System ISO/IEC 27001:2005
Information Security Management System ISO/IEC 27001:2005
 
SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)
SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)
SECURITY & CONTROL OF INFORMATION SYSTEM (Management Information System)
 
Database Management Systems (DBMS)
Database Management Systems (DBMS)Database Management Systems (DBMS)
Database Management Systems (DBMS)
 

Similar to Database management concept

Intro to relational model
Intro to relational modelIntro to relational model
Intro to relational modelATS SBGI MIRAJ
 
Relational algebra operations
Relational algebra operationsRelational algebra operations
Relational algebra operationsSanthiNivas
 
1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdfKavinilaa
 
Relational algebra-and-relational-calculus
Relational algebra-and-relational-calculusRelational algebra-and-relational-calculus
Relational algebra-and-relational-calculusSalman Vadsarya
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbmsshekhar1991
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptxkavitha623544
 
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Raj vardhan
 
Module 2-2.ppt
Module 2-2.pptModule 2-2.ppt
Module 2-2.pptShylaja40
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.pptSreenivas R
 
3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebraZakriyaMalik2
 
Chapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdfChapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdfTamiratDejene1
 
Relational operation final
Relational operation finalRelational operation final
Relational operation finalStudent
 
Relational Algebra.pptx for Module four
Relational Algebra.pptx for  Module fourRelational Algebra.pptx for  Module four
Relational Algebra.pptx for Module fourMonaliaghosh
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2Mukund Trivedi
 

Similar to Database management concept (20)

Intro to relational model
Intro to relational modelIntro to relational model
Intro to relational model
 
354 ch6
354 ch6354 ch6
354 ch6
 
Relational algebra operations
Relational algebra operationsRelational algebra operations
Relational algebra operations
 
1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf
 
Ra Revision
Ra RevisionRa Revision
Ra Revision
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
relational algebra
relational algebrarelational algebra
relational algebra
 
Relational algebra-and-relational-calculus
Relational algebra-and-relational-calculusRelational algebra-and-relational-calculus
Relational algebra-and-relational-calculus
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx
 
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
 
Chapter6
Chapter6Chapter6
Chapter6
 
Module 2-2.ppt
Module 2-2.pptModule 2-2.ppt
Module 2-2.ppt
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.ppt
 
3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra
 
Chapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdfChapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdf
 
Relational operation final
Relational operation finalRelational operation final
Relational operation final
 
Relational Algebra.pptx for Module four
Relational Algebra.pptx for  Module fourRelational Algebra.pptx for  Module four
Relational Algebra.pptx for Module four
 
Relational Algebra-23-04-2023.pdf
Relational Algebra-23-04-2023.pdfRelational Algebra-23-04-2023.pdf
Relational Algebra-23-04-2023.pdf
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
 

Recently uploaded

Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..MaherOthman7
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfJNTUA
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxRashidFaridChishti
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsVIEW
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxKarpagam Institute of Teechnology
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...drjose256
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxCHAIRMAN M
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailingAshishSingh1301
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)NareenAsad
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdfKamal Acharya
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfAshrafRagab14
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docxrahulmanepalli02
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Studentskannan348865
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...IJECEIAES
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfMadan Karki
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.benjamincojr
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxMustafa Ahmed
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 

Recently uploaded (20)

Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docx
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 

Database management concept

  • 2. Relational Algebra  Recalling Relational Model  Defining Relational Algebra  Set Theoretic Operations  Specific Relational Operations
  • 3. Relational Model Relational Model consists of the elements: relations, which are made up of attributes.  A relation is a set of attributes with values for each attribute such that:  Each attribute value must be a single value only (atomic).  All values for a given attribute must be of the same type (or domain).  Each attribute name must be unique.  The order of attributes is insignificant  No two rows (tuples) in a relation can be identical.  The order of the rows (tuples) is insignificant.
  • 4. Defining Relational Algebra  Relational Algebra is a collection of operations on Relations.  Relations are operands and the result of an operation is another relation.  Two main collections of relational operations: 1. Set theory operations: Union, Intersection, Difference and Cartesian product. 2. Specific Relational Operations: Selection, Projection, Join, Division
  • 5. Set Theoretic Operations Relation: R First Last Age Bill Smith 22 Sally Green 28 Mary Keen 23 Tony Jones 32 Relation : S First Last Age Forrest Gump 36 Sally Green 28 DonJuan DeMarco 27 Consider the following relations R and S
  • 6. Set Theoretic Operations Union: R U S Result: Relation with tuples from R and S with duplicates removed. First Last Age Bill Smith 22 Sally Green 28 Mary Keen 23 Tony Jones 32 Forrest Gump 36 DonJuan DeMarco 27 Result of R U S
  • 7. Set Theoretic Operations Difference: R - S Result: Relation with tuples from R but not from S. Result of R - S First Last Age Bill Smith 22 Mary Keen 23 Tony Jones 32
  • 8. Set Theoretic Operations Difference: R ∩ S Result: Relation with tuples that appear in both R and S. Result of R ∩ S First Last Age Sally Green 28
  • 9. Set Theoretic Operations  Cartesian Product: Produce all combinations of tuples from two relations. Relation: R First Last Age Bill Smith 22 Mary Keen 23 Tony Jones 32 Relation: S Dinner Dessert Steak Ice Cream Lobster Cheesecak e Result: R X S First Last Age Dinner Dessert Bill Smith 22 Steak Ice Cream Bill Smith 22 Lobster Cheesecake Mary Keen 23 Steak Ice Cream Mary Keen 23 Lobster Cheesecake Tony Jones 32 Steak Ice Cream Tony Jones 32 Lobster Cheesecake
  • 10. Specific Relational Operations Selection Operators  Selection and Projection are unary operators.  The selection operator is sigma: σ  The selection operation acts like a filter on a relation by returning only a certain number of tuples.  The resulting relation will have the same degree as the original relation.  The resulting relation may have fewer tuples than the original relation.  The tuples to be returned are dependent on a condition that is part of the selection operator.  σ C (R) Returns only those tuples in R that satisfy condition C  A condition C can be made up of any combination of comparison or logical operators that operate on the attributes of R.
  • 11. Specific Relational Operations  Comparison operators: < > ≥ ≤ = ≠  Logical operators: T F T T F F F F Use the Truth tables (memorize these) for logical expressions: T F T T T F T F T F F T
  • 12. Specific Relational Operations  Assume the following relation EMP has the following tuples: Name Office Dept Rank Smith 400 CS Assistant Jones 220 Econ Adjunct Green 160 Econ Assistant Brown 420 CS Associate Smith 500 Fin Associate
  • 13. Specific Relational Operations Select only those Employees in the CS department: Dept = 'CS' (EMP) Result: Name Office Dept Rank Smith 400 CS Assistant Brown 420 CS Associate Selection Examples
  • 14. Specific Relational Operations Selection Examples Select only those Employees with last name Smith who are assistant professors: Name = 'Smith' Rank = 'Assistant' (EMP) Name Office Dept Rank Smith 400 CS Assistant Result
  • 15. Specific Relational Operations Selection Examples Result Select only those Employees who are either Assistant Professors or in the Economics department: Rank = 'Assistant' Dept = 'Econ' (EMP) Name Office Dept Rank Smith 400 CS Assistant Jones 220 Econ Adjunct Green 160 Econ Assistant
  • 16. Specific Relational Operations Selection Examples Result Select only those Employees who are not in the CS department or Adjuncts: (Rank = 'Adjunct' Dept = 'CS') (EMP) Name Office Dept Rank Green 160 Econ Assistant Smith 500 Fin Associate