ics321-20091006-relcalc

# ics321-20091006-relcalc - S.b • R.a<>.= constant or...

This preview shows pages 1–5. Sign up to view the full content.

ICS 321 Fall 2009 Relational Calculus Asst. Prof. Lipyeow Lim University of Hawaii at Manoa 10/06/2009 1 Lipyeow Lim -- University of Hawaii at Manoa

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

View Full Document
Relational Calculus (RC) RC is an alternative to RA RC is non-procedural, or declarative: describe what the results of a query should be without specifying how to get the results Two variants: Tuple Relational Calculus Domain Relational Calculus (not covered in ICS321) 10/06/2009 Lipyeow Lim -- University of Hawaii at Manoa 2
Tuple Relational Calculus (TRC) Uses tuple variables : a variable that takes on tuples of a particular relation schema as values. A TRC query is specified using set-theoretic first order logic expressions of the form { T | p(T) } T is a tuple variable and is the only free variable in p p(T) is a formula that describes T Any atomic formula R Rel R.a {<>.=,

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , , } S.b • R.a {<>.=, , , } constant, or constant {<>.=, , , } R.a – p, p q, p q, p q – R( p(R) ), where R is a tuple variable – R( p(R) ), where R is a tuple variable 10/06/2009 Lipyeow Lim -- University of Hawaii at Manoa 3 Q11: Find all sailors with rating above 7 • The TRC expression for this query is { S | S Sailors S.rating > 7 } • Reads: the set of S tuples, such that S is a member of the Sailors relation instance AND S’s rating is greater than 7. 10/06/2009 Lipyeow Lim -- University of Hawaii at Manoa 4 Q12: Find the names and ages of sailors with a rating above 7 • The TRC expression for this query is { P | S Sailors (S.rating > 7 P.name=S.name P.age=S.age ) } 10/06/2009 Lipyeow Lim -- University of Hawaii at Manoa 5...
View Full Document

## This note was uploaded on 11/15/2010 for the course ICS 321 taught by Professor Lim during the Fall '09 term at University of Hawaii, Manoa.

### Page1 / 5

ics321-20091006-relcalc - S.b • R.a<>.= constant or...

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

View Full Document
Ask a homework question - tutors are online