DOC PREVIEW
UT Dallas CS 6360 - Ch06

This preview shows page 1-2-3-22-23-24-45-46-47 out of 47 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 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 47 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 47 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 47 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 47 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 47 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 47 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 47 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 47 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

PowerPoint PresentationChapter 6 OutlineChapter 6 Outline (cont’d.)The Relational Algebra and Relational CalculusUnary Relational Operations: SELECT and PROJECTUnary Relational Operations: SELECT and PROJECT (cont’d.)Slide 7The PROJECT OperationSequences of Operations and the RENAME OperationRelational Algebra Operations from Set TheoryRelational Algebra Operations from Set Theory (cont’d.)The CARTESIAN PRODUCT (CROSS PRODUCT) OperationBinary Relational Operations: JOIN and DIVISIONBinary Relational Operations: JOIN and DIVISION (cont’d.)Variations of JOIN: The EQUIJOIN and NATURAL JOINVariations of JOIN: The EQUIJOIN and NATURAL JOIN (cont’d.)A Complete Set of Relational Algebra OperationsThe DIVISION OperationOperations of Relational AlgebraOperations of Relational Algebra (cont’d.)Additional Relational OperationsAdditional Relational Operations (cont’d.)Slide 23Notation for Query TreesSlide 25Examples of Queries in Relational AlgebraSlide 27Examples of Queries in Relational Algebra (cont’d.)Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35The Tuple Relational CalculusTuple Variables and Range RelationsExpressions and Formulas in Tuple Relational CalculusExistential and Universal QuantifiersSample Queries in Tuple Relational CalculusNotation for Query GraphsTransforming the Universal and Existential QuantifiersUsing the Universal Quantifier in QueriesSafe ExpressionsThe Domain Relational CalculusThe Domain Relational Calculus (cont’d.)SummaryCopyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-WesleyChapter 6The Relational Algebra and Relational CalculusCopyright © 2011 Ramez Elmasri and Shamkant NavatheChapter 6 OutlineUnary Relational Operations: SELECT and PROJECTRelational Algebra Operations from Set TheoryBinary Relational Operations: JOIN and DIVISIONAdditional Relational OperationsCopyright © 2011 Ramez Elmasri and Shamkant NavatheChapter 6 Outline (cont’d.)Examples of Queries in Relational AlgebraThe Tuple Relational CalculusThe Domain Relational CalculusCopyright © 2011 Ramez Elmasri and Shamkant NavatheThe Relational Algebra andRelational CalculusRelational algebraBasic set of operations for the relational modelRelational algebra expressionSequence of relational algebra operationsRelational calculus Higher-level declarative language for specifying relational queriesCopyright © 2011 Ramez Elmasri and Shamkant NavatheUnary Relational Operations:SELECT and PROJECTThe SELECT OperationSubset of the tuples from a relation that satisfies a selection condition:•Boolean expression contains clauses of the form <attribute name> <comparison op> <constant value>or•<attribute name> <comparison op> <attribute name>Copyright © 2011 Ramez Elmasri and Shamkant NavatheUnary Relational Operations:SELECT and PROJECT (cont’d.)Example:<selection condition> applied independently to each individual tuple t in RIf condition evaluates to TRUE, tuple selectedBoolean conditions AND, OR, and NOTUnaryApplied to a single relationCopyright © 2011 Ramez Elmasri and Shamkant NavatheUnary Relational Operations:SELECT and PROJECT (cont’d.)SelectivityFraction of tuples selected by a selection conditionSELECT operation commutativeCascade SELECT operations into a single operation with AND conditionCopyright © 2011 Ramez Elmasri and Shamkant NavatheThe PROJECT OperationSelects columns from table and discards the other columns:Degree Number of attributes in <attribute list>Duplicate eliminationResult of PROJECT operation is a set of distinct tuplesCopyright © 2011 Ramez Elmasri and Shamkant NavatheSequences of Operations and the RENAME OperationIn-line expression:Sequence of operations:Rename attributes in intermediate resultsRENAME operationCopyright © 2011 Ramez Elmasri and Shamkant NavatheRelational Algebra Operationsfrom Set TheoryUNION, INTERSECTION, and MINUS Merge the elements of two sets in various waysBinary operationsRelations must have the same type of tuplesUNIONR ∪ SIncludes all tuples that are either in R or in S or in both R and SDuplicate tuples eliminatedCopyright © 2011 Ramez Elmasri and Shamkant NavatheRelational Algebra Operationsfrom Set Theory (cont’d.)INTERSECTIONR ∩ SIncludes all tuples that are in both R and SSET DIFFERENCE (or MINUS)R – SIncludes all tuples that are in R but not in SCopyright © 2011 Ramez Elmasri and Shamkant NavatheThe CARTESIAN PRODUCT (CROSS PRODUCT) OperationCARTESIAN PRODUCT CROSS PRODUCT or CROSS JOINDenoted by ×Binary set operationRelations do not have to be union compatibleUseful when followed by a selection that matches values of attributesCopyright © 2011 Ramez Elmasri and Shamkant NavatheBinary Relational Operations:JOIN and DIVISIONThe JOIN OperationDenoted by Combine related tuples from two relations into single “longer” tuplesGeneral join condition of the form <condition> AND <condition> AND...AND <condition>Example:Copyright © 2011 Ramez Elmasri and Shamkant NavatheBinary Relational Operations:JOIN and DIVISION (cont’d.)THETA JOINEach <condition> of the form Ai θ BjAi is an attribute of RBj is an attribute of SAi and Bj have the same domainθ (theta) is one of the comparison operators:•{=, <, ≤, >, ≥, ≠}Copyright © 2011 Ramez Elmasri and Shamkant NavatheVariations of JOIN: The EQUIJOIN and NATURAL JOINEQUIJOINOnly = comparison operator usedAlways have one or more pairs of attributes that have identical values in every tupleNATURAL JOINDenoted by *Removes second (superfluous) attribute in an EQUIJOIN conditionCopyright © 2011 Ramez Elmasri and Shamkant NavatheVariations of JOIN: The EQUIJOIN and NATURAL JOIN (cont’d.)Join selectivityExpected size of join result divided by the maximum size nR * nSInner joinsType of match and combine operation Defined formally as a combination of CARTESIAN PRODUCT and SELECTIONCopyright © 2011 Ramez Elmasri and Shamkant NavatheA Complete Set of Relational Algebra OperationsSet of relational algebra operations {σ, π, , ρ, –, ×} is a ∪ complete setAny relational algebra operation can be expressed as a sequence of operations from this setCopyright © 2011 Ramez Elmasri and Shamkant NavatheThe DIVISION OperationDenoted by ÷Example: retrieve the names of employees who work on all the


View Full Document

UT Dallas CS 6360 - Ch06

Documents in this Course
Ch22(1)

Ch22(1)

44 pages

Ch21

Ch21

38 pages

Ch19

Ch19

46 pages

Ch18

Ch18

25 pages

Ch17

Ch17

21 pages

Ch15

Ch15

42 pages

Ch09

Ch09

42 pages

Ch05

Ch05

34 pages

Ch22

Ch22

45 pages

Ch21

Ch21

38 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch16

Ch16

17 pages

Ch15

Ch15

42 pages

Ch09

Ch09

42 pages

Ch08

Ch08

39 pages

Ch07

Ch07

34 pages

Ch06

Ch06

43 pages

Ch05

Ch05

34 pages

Ch04

Ch04

39 pages

Ch03(2)

Ch03(2)

36 pages

Ch02

Ch02

33 pages

Ch08

Ch08

28 pages

Ch07

Ch07

31 pages

Ch06

Ch06

43 pages

Ch05

Ch05

39 pages

Ch04(1)

Ch04(1)

39 pages

Ch03(1)

Ch03(1)

38 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch24

Ch24

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch03(1)

Ch03(1)

38 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch24

Ch24

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch08

Ch08

28 pages

Ch07

Ch07

31 pages

Ch06

Ch06

43 pages

Ch05

Ch05

39 pages

Ch04(1)

Ch04(1)

39 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

lab-manual

lab-manual

215 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch17

Ch17

25 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch04(1)

Ch04(1)

43 pages

Ch07

Ch07

40 pages

Ch03

Ch03

42 pages

Ch01

Ch01

36 pages

Ch02

Ch02

38 pages

Ch05

Ch05

41 pages

Ch06

Ch06

47 pages

Ch08

Ch08

39 pages

Ch17

Ch17

25 pages

Ch18

Ch18

24 pages

Ch09

Ch09

42 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

Ch09

Ch09

42 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04(1)

Ch04(1)

43 pages

Ch03

Ch03

42 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Load more
Download Ch06
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 Ch06 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 Ch06 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?