Lecture9 - ECS 165B Database System Implementation Lecture...

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

View Full Document Right Arrow Icon
ECS 165B: Database System Implementation Lecture 9 UC Davis April 16, 2010
Image of page 1

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

View Full Document Right Arrow Icon
Announcements Several reminders: 1. DavisDB Part 1 due Sunday at 11:59pm 2. Don’t forget about the writeup ( writeup.txt ) when submitting your code 3. Comment your code (but don’t go overboard) 4. Style counts! Keep your code clean, simple, readable . . . 5. Late policy (as per course web page): I 5% penalty per hour late; no credit after 20 hours I But, 48 “free late hours” for entire course We’ll have “code review” meetings next week (stay tuned for email) DavisDB Part 2 (Index Manager) will be handed out Monday; due Sunday, 5/2 at 11:59pm
Image of page 2
Agenda I Last time - A taste of database theory, Part 1: relational algebra, relational calculus, and first-order logic I Today - A taste of database theory, Part 2: containment and equivalence of conjunctive queries I Reading: none
Image of page 3

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

View Full Document Right Arrow Icon
Recall from last time: relational calculus (RC) I Database query language based on first-order logic I Syntax: expressions of the form { ( x 1 , . . . , x n ) | ϕ ( x 1 , . . . , x n ) } where ϕ ( x 1 , . . . , x n ) is a first-order formula with free variables x 1 , . . . , x n . I Semantics: return all tuples ( a 1 , . . . , a n ) such that ϕ ( a 1 , . . . , a n ) is true in the database.
Image of page 4
Example: relational calculus queries Database with three relations: Class (classId, className, roomNo); Student (studentId, studentName); and Takes (studentId, classId). I “Find all students taking a class meeting in Wellman 1” { ( x ) | ∃ s c n Student ( s , x ) Takes ( s , c ) Class ( c , n , ”Wellman 1”) } I “Find all pairs of students not taking a class together” { ( x , y ) | ∃ s s 0 Student ( s , x ) Student ( s 0 , y ) ¬∃ c ( Takes ( s , c ) Takes ( s 0 , c )) }
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
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