{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

9 - Relational Algebra Relational Calculus(Lecture...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Relational Algebra & Relational Calculus (Lecture Session-10) Chapter 6 Wed, Feb 10, 2010 1 DLPD, BITS-Pilani. Prepared by Dr.R. Gururaj, Asst.Professor of CS
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Wed, Feb 10, 2010 DLPD, BITS-Pilani. 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
Image of page 2
Wed, Feb 10, 2010 DLPD, BITS-Pilani. 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.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Wed, Feb 10, 2010 DLPD, BITS-Pilani. 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.
Image of page 4
Wed, Feb 10, 2010 DLPD, BITS-Pilani. 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 π
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Wed, Feb 10, 2010 DLPD, BITS-Pilani. 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).
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern