{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec05 - Relational Algebra Chapter 4 EECS 484 Database...

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

View Full Document Right Arrow Icon
1 1/23/11 EECS 484: Database Management Systems, Kristen LeFevre 1 Relational Algebra Chapter 4 1/23/11 EECS 484: Database Management Systems, Kristen LeFevre 2 “Formal” Query Languages Foundation for commercial query languages like SQL Two types Declarative: Relational Calculus Describe what a user wants, rather than how to compute it. Inspired SQL Procedural : Relational Algebra Operations very useful for understanding how DB executes queries. Query Languages != programming languages! QLs not expected to be “Turing complete”. QLs not intended to be used for complex calculations. QLs support easy, efficient access to large data sets. Understanding Relational Algebra and Calculus is important to understanding SQL and query processing!
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
2 1/23/11 EECS 484: Database Management Systems, Kristen LeFevre 3 Relational Algebra Preliminaries Query: Input: Relational instances Output: Relational instances! Specified using the schema May produce different results for different instances But schema of the result is fixed Relational Algebra is “closed” 1/23/11 EECS 484: Database Management Systems, Kristen LeFevre 4 Relational Algebra Basic operations: Selection ( ) Selects a subset of rows from relation. Projection ( ) Deletes unwanted columns from relation. Cross-product ( ) Allows us to combine two relations. Set-difference ( ) Tuples in reln. 1, but not in reln. 2. Union ( ) Tuples in reln. 1 and in reln. 2. Additional operations (constructed from basic ops): Intersection, Join , Division, Renaming Not essential, but (very!) useful. Because algebra is closed, we can compose operators ! ! ! ! U
Image of page 2
3 1/23/11 EECS 484: Database Management Systems, Kristen LeFevre 5 Selection Retrieve rows that satisfy a logical condition Conditions are boolean combinations ( ∧, V, ¬ ) of terms Each term has one of the
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
Image of page 4
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