336_Chapter4_B

336_Chapter4_B - Relational Calculus Chapter 4 Part B...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Relational Calculus Chapter 4, Part B Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 2 Relational Calculus Comes in two flavors: Tuple relational calculus (TRC) and Domain relational calculus (DRC). Calculus has variables, constants, comparison ops , logical connectives and quantifiers . TRC : Variables range over (i.e., get bound to) tuples . DRC : Variables range over domain elements (= field values). Both TRC and DRC are simple subsets of first-order logic. Expressions in the calculus are called formulas . An answer tuple is essentially an assignment of constants to variables that make the formula evaluate to true . Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 3 Domain Relational Calculus Query has the form: x x xn p x x xn 1 2 1 2 , ,..., | , ,..., Answer includes all tuples that make the formula be true . x x xn 1 2 , ,..., p x x xn 1 2 , ,..., Formula is recursively defined, starting with simple atomic formulas (getting tuples from relations or making comparisons of values), and building bigger and better formulas using the logical connectives .
Background image of page 1

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

View Full DocumentRight Arrow Icon
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 4 DRC Formulas Atomic formula: , or X op Y, or X op constant op is one of
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/03/2008 for the course CS 336 taught by Professor Zhang during the Spring '08 term at Rutgers.

Page1 / 4

336_Chapter4_B - Relational Calculus Chapter 4 Part B...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online