This preview shows pages 1–7. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Relational Algebra & Relational Calculus (Lecture Session10) Chapter 6 Wed, Feb 10, 2010 1 DLPD, BITSPilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS Wed, Feb 10, 2010 DLPD, BITSPilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS 2 1. Relational Algebra Relational operations Set operations Join operations 2. Relational calculus Tuple Relational Calculus Contents Wed, Feb 10, 2010 DLPD, BITSPilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS 3 Relation Algebra Querying means extracting data from the database for the purpose of processing it. Every data model should have some formal query language to manipulate data. Relational Algebra is a formal query language for relational data model. A basic set of relational model operations constitute the relational algebra. These operations enable the user to specify basic data retrieval requests. The result of a relational algebra query is also a new relation which may have been formed from one or more relations. A sequence of relational algebraic operations forms a relational algebraic expression , whose result is also a relation. Wed, Feb 10, 2010 DLPD, BITSPilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS 4 Relational Algebra Operators A.Set Operations o Union, o Intersection, o Difference, o Cartesian product. A.Relational Operations o Select, o Project, o join, o Division etc. Wed, Feb 10, 2010 DLPD, BITSPilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS 5 Select Operation : is to select subset of tuples that satisfy some selection condition. Symbol used is σ (sigma) Ex: (EMP) The above expression selects all tuples from EMP table, where the value of the column ‘ dno ’ is 4. The general form of ‘ select ’ clause is Projection Operation: Selects certain columns Symbol is π ( pi) (EMP) Selects columns name, age, dno for all tuples from the table EMP 4 dno σ = <select condition> ( ) R σ name, age, dno π Wed, Feb 10, 2010 DLPD, BITSPilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS 6 Note: We can apply the expressions in sequence or we can nest them in single expression. Ex.: The above expression selects name and age of employees working with dno 5. The above query can also be written as R 1 & R 2 are the names given to intermediate results(relations)....
View
Full
Document
This note was uploaded on 03/14/2010 for the course CSE IS ZC332 taught by Professor Shailendrasshekhawat during the Summer '10 term at Birla Institute of Technology & Science.
 Summer '10
 ShailendraSShekhawat

Click to edit the document details