er-rel

# er-rel - The Relational Data Model and ER Mapping(Ch 5&...

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

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

View Full Document

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

View Full Document

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: The Relational Data Model and ER Mapping (Ch 5 & 7.1) Yi Chen Dept of Computer Science & Engineering Arizona State University CSE 412/598 2 Outline Relational Model Conversion from ER to Relations CSE 412/598 3 Why Relations? Very simple model. Often matches how we think about data. Abstract model that underlies SQL, the most important database language today. CSE 412/598 4 Relational Data Model (I nformal) Informally, a relational database consists of a collection of tables, each of which is assigned a unique name. relation - table tuple - row attribute - column name manf Winterbrew Pete’s Bud Lite Anheuser-Busch Beers Attributes (column headers) Tuples (rows) CSE 412/598 5 Relational Databases (Formal) Let D 1 ,D 2 ,...,D n be sets of atomic values, called domains The Cartesian product of D 1 ,...,D n specifies all possible combinations of values from the underlying domains An n-tuple is an ordered sequence (d 1 ,d 2 ,...,d n ) s.t. d i ∈ D i A relation with n attributes is a set of n-tuples, which is a subset of the Cartesian product of the domains of the attributes D 1 × ... × D n where D i is the domain of the i th attribute The tuples in a relation are unordered . There are no duplicate elements in a set, i.e., each tuple is unique . Let |D i | denote the cardinality (number of values) of domain D i , then the total number of possible distinct tuples is |D 1 | * |D 2 | * ... * |D n | The total number of possible relations is 2 |D1| * |D2| * ... * |Dn| A relational database is a set of relations. CSE 412/598 6 DB Schema & I nstances Relation schema = relation name and attribute list. Optionally: types of attributes. Example: Beers(name, manf) or Beers(name: string, manf: string) A Relational Database Schema S is a set of relation schemas S={R 1 , R 2 , ..., R m } and a set of integrity constraints IC. A Relational Database Instance DB of S is a set of relation instances DB={r 1 , r 2 , ..., r m } s.t. each r i is an instance of R i and the r i 's satisfy IC....
View Full Document

{[ snackBarMessage ]}

### Page1 / 25

er-rel - The Relational Data Model and ER Mapping(Ch 5&...

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

View Full Document
Ask a homework question - tutors are online