1 / 8

Relations

Relations. The Relational Data Model. John Sieg, UMass Lowell. A Relation (or Table). attributes (columns). tuples (rows). John Sieg, UMass Lowell. Relational Model: Definitions. domain - a set of scalar values

anne-tate
Download Presentation

Relations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Relations The Relational Data Model John Sieg, UMass Lowell

  2. A Relation (or Table) attributes (columns) tuples (rows) John Sieg, UMass Lowell

  3. Relational Model: Definitions • domain - a set of scalar values • relation on D1,...,Dk (Codd’s definition): a mathematical relation on D1,...,Dk , i.e., a subset of D1 x...x Dk • doesn’t model attribute names John Sieg, UMass Lowell

  4. Definitions, cont’d • scheme - a set S of objects called attribute names or attributes. • Each attribute has a domain, i.e., there is a function dom: S -> {domains} • tuple t on scheme S = {A1, ... , An} - mapping from S to values that are in the appropriate domains, i.e., t(Ai) is in dom(Ai) John Sieg, UMass Lowell

  5. Definitions, cont’d • Relation on scheme S - a set of tuples on S • cardinality, degree • Properties of relations (Date): • There are no duplicate tuples. • Tuples are unordered. • Attributes are unordered. • Attribute values are atomic. • A database is a set of named relations. John Sieg, UMass Lowell

  6. Candidate Keys • candidate key of a relation R - a subset K of R’s scheme having the properties that • (Uniqueness property) No two distinct tuples have the same value(s) for K • No proper subset of K has the uniqueness property. • True over all time! • Every relation has at least one candidate key. John Sieg, UMass Lowell

  7. Primary & Foreign Keys • One of a relation’s candidate key’s is designated to be a primary key. • A foreign key in a relation refers to the primary key of some relation. John Sieg, UMass Lowell

  8. Integrity and Keys (C. J. Date) • The entity integrity rule - No component of a primary key is allowed to accept nulls. • The referential integrity rule - The database must not contain any unmatched foreign key values. John Sieg, UMass Lowell

More Related