DOC PREVIEW
UT Dallas CS 6360 - Ch03

This preview shows page 1-2-3-20-21-40-41-42 out of 42 pages.

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

Unformatted text preview:

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database ConstraintsCopyright © 2011 Ramez Elmasri and Shamkant Navathe Chapter 3 Outline  The Relational Data Model and Relational Database Constraints  Relational Model Constraints and Relational Database Schemas  Update Operations, Transactions, and Dealing with Constraint ViolationsCopyright © 2011 Ramez Elmasri and Shamkant Navathe The Relational Data Model and Relational Database Constraints  Relational model  First commercial implementations available in early 1980s  Has been implemented in a large number of commercial system  Hierarchical and network models  Preceded the relational modelCopyright © 2011 Ramez Elmasri and Shamkant Navathe Relational Model Concepts  Represents data as a collection of relations  Table of values  Row • Represents a collection of related data values • Fact that typically corresponds to a real-world entity or relationship • Tuple  Table name and column names • Interpret the meaning of the values in each row attributeCopyright © 2011 Ramez Elmasri and Shamkant Navathe Relational Model Concepts (cont’d.)Copyright © 2011 Ramez Elmasri and Shamkant Navathe Domains, Attributes, Tuples, and Relations  Domain D  Set of atomic values  Atomic  Each value indivisible  Specifying a domain  Data type specified for each domainCopyright © 2011 Ramez Elmasri and Shamkant Navathe Domains, Attributes, Tuples, and Relations (cont’d.)  Relation schema R  Denoted by R(A1, A2, ...,An)  Made up of a relation name R and a list of attributes, A1, A2, ..., An  Attribute Ai  Name of a role played by some domain D in the relation schema R  Degree (or arity) of a relation  Number of attributes n of its relation schemaCopyright © 2011 Ramez Elmasri and Shamkant Navathe Domains, Attributes, Tuples, and Relations (cont’d.)  Relation (or relation state)  Set of n-tuples r = {t1, t2, ..., tm}  Each n-tuple t • Ordered list of n values t =<v1, v2, ..., vn • Each value vi, 1 ≤ i ≤ n, is an element of dom(Ai) or is a special NULL valueCopyright © 2011 Ramez Elmasri and Shamkant Navathe Domains, Attributes, Tuples, and Relations (cont’d.)  Relation (or relation state) r(R)  Mathematical relation of degree n on the domains dom(A1), dom(A2), ..., dom(An)  Subset of the Cartesian product of the domains that define R: • r(R) ⊆ (dom(A1) × dom(A2) × ... × dom(An))Copyright © 2011 Ramez Elmasri and Shamkant Navathe Domains, Attributes, Tuples, and Relations (cont’d.)  Cardinality  Total number of values in domain  Current relation state  Relation state at a given time  Reflects only the valid tuples that represent a particular state of the real world  Attribute names  Indicate different roles, or interpretations, for the domainCopyright © 2011 Ramez Elmasri and Shamkant Navathe Characteristics of Relations  Ordering of tuples in a relation  Relation defined as a set of tuples  Elements have no order among them  Ordering of values within a tuple and an alternative definition of a relation  Order of attributes and values is not that important  As long as correspondence between attributes and values maintainedCopyright © 2011 Ramez Elmasri and Shamkant Navathe Characteristics of Relations (cont’d.)  Alternative definition of a relation  Tuple considered as a set of (<attribute>, <value>) pairs  Each pair gives the value of the mapping from an attribute Ai to a value vi from dom(Ai)  Use the first definition of relation  Attributes and the values within tuples are ordered  Simpler notationCopyright © 2011 Ramez Elmasri and Shamkant Navathe Characteristics of Relations (cont’d.)Copyright © 2011 Ramez Elmasri and Shamkant Navathe Characteristics of Relations (cont’d.)  Values and NULLs in tuples  Each value in a tuple is atomic  Flat relational model • Composite and multivalued attributes not allowed • First normal form assumption  Multivalued attributes • Must be represented by separate relations  Composite attributes • Represented only by simple component attributes in basic relational modelCopyright © 2011 Ramez Elmasri and Shamkant Navathe Characteristics of Relations (cont’d.)  NULL values  Represent the values of attributes that may be unknown or may not apply to a tuple  Meanings for NULL values • Value unknown • Value exists but is not available • Attribute does not apply to this tuple (also known as value undefined)Copyright © 2011 Ramez Elmasri and Shamkant Navathe Characteristics of Relations (cont’d.)  Interpretation (meaning) of a relation  Assertion • Each tuple in the relation is a fact or a particular instance of the assertion  Predicate • Values in each tuple interpreted as values that satisfy predicateCopyright © 2011 Ramez Elmasri and Shamkant Navathe Relational Model Notation  Relation schema R of degree n  Denoted by R(A1, A2, ..., An)  Uppercase letters Q, R, S  Denote relation names  Lowercase letters q, r, s  Denote relation states  Letters t, u, v  Denote tuplesCopyright © 2011 Ramez Elmasri and Shamkant Navathe Relational Model Notation  Name of a relation schema: STUDENT  Indicates the current set of tuples in that relation  Notation: STUDENT(Name, Ssn, ...)  Refers only to relation schema  Attribute A can be qualified with the relation name R to which it belongs  Using the dot notation R.ACopyright © 2011 Ramez Elmasri and Shamkant Navathe Relational Model Notation  n-tuple t in a relation r(R)  Denoted by t = <v1, v2, ..., vn>  vi is the value corresponding to attribute Ai  Component values of tuples:  t[Ai] and t.Ai refer to the value vi in t for attribute Ai  t[Au, Aw, ..., Az] and t.(Au, Aw, ..., Az) refer to the subtuple of values <vu, vw, ..., vz> from t corresponding to the attributes specified in the listCopyright © 2011 Ramez Elmasri and Shamkant Navathe Relational Model Constraints  Constraints


View Full Document

UT Dallas CS 6360 - Ch03

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

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

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

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 Ch03
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 Ch03 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 Ch03 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?