DOC PREVIEW
UW CSE 444 - Relational Calculus and QBE

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Relational Calculus and QBEThe Relational CalculusTuple Relational CalculusJoin ExampleRelational Calculus vs. Predicate CalculusDomain Relational CalculusDomain R.C. Join ExampleNot so abstract, really...10/26/97 I-1Relational Calculus and QBEChapter 8 (skim)10/26/97 I-2The Relational Calculus•Like the Relational Algebra...–An abstract DB language–No aggregate operators–R.A. and R.C. can accomplish the same results•"relationally complete"•"Queries" describe sets { | } with desired properties–More declarative than RA: no operations!•Two flavors: "tuple" and "domain"10/26/97 I-3Tuple Relational Calculus•Set elements are tuples from relations•'Find employees named John'{t | EMPLOYEE (t) and t.FNAME = "John"}–Read as: "The set of all t such that t is an element (member) of the relation EMPLOYEE, and the NAME attribute of t has the value John."•QUEL (Ingres) and to some extent SQL are base on tuple R.C. model10/26/97 I-4Join Example•"Find names of employees who work for the Research department"{e.FNAME, e.LNAME | EMPLOYEE (e) and (( d) (DEPARTMENT(d) and e.DNO = d.DNUMBER and d.DNAME = "Research") )}10/26/97 I-5Relational Calculus vs. Predicate Calculus•Both flavors of R.C. are extensions of the predicate calculus•Can give formal definitions of terms, formulas, scoping and binding of variables, etc.–can build a model theory with TRUE, FALSE•P.C. quantifiers like , and operators like  (not) can be used–Care must be taken with  and 10/26/97 I-6Domain Relational Calculus•The variables represent individual domain values (rather than whole tuples)"Find employees whose pay is over $25,000"{f,n | ( p) EMPLOYEE (f,m,n,s,b,a,x,p,u,d) and p > 25000}•This is already a shorthand: should say f exists and belongs to the domain "string", etc. etc. for each variable.10/26/97 I-7Domain R.C. Join Example•"Find employees of the Research dept. whose pay is over $25,000"{fn,ln | ( p) ( d1) (EMPLOYEE (fn,m,ln,s,b,a,x,p,u,d1) and p > 25000) and ( d2) ( dn) DEPARTMENT (dn,d2,mg,ms) and d1= d2 and dn="Research"}Many of the variables are just placeholders. In Prolog you could use "anonymous variables" (_).10/26/97 I-8Not so abstract, really...•"Query by Example" uses this framework•User see 2-dimensional layout of schema•Can select which tables are involved, which columns (variables) appear in output (i.e., what vars are to the left of |), what conditions apply between columns, etc. etc.•This is the predominant paradigm in direct end-user query systems (e.g. Microsoft


View Full Document

UW CSE 444 - Relational Calculus and QBE

Documents in this Course
XML

XML

48 pages

SQL

SQL

25 pages

SQL

SQL

42 pages

Recovery

Recovery

30 pages

SQL

SQL

36 pages

Indexes

Indexes

35 pages

Security

Security

36 pages

Wrap-up

Wrap-up

6 pages

SQL

SQL

37 pages

More SQL

More SQL

48 pages

SQL

SQL

35 pages

XML

XML

46 pages

Triggers

Triggers

26 pages

Load more
Download Relational Calculus and QBE
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Relational Calculus and QBE and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Relational Calculus and QBE 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?