# slides3 - Schedule Today Jan 10(TH x x Relational Model...

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

Winter 2002 Arthur Keller – CS 180 3–1 Schedule Today: Jan. 10 (TH) Relational Model, Functional Dependencies. Read Sections 3.1-3.5. Jan. 15 (T) Normal Forms, Multivalued Dependencies. Read Sections 3.6-3.7. Assignment 1 due. Jan. 17 (TH) Relational Algebra. Read Chapter 5. Project Part 1 due. Jan. 22 (T) SQL Queries. Read Sections 6.1-6.2. Assignment 2 due.

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

View Full Document
Winter 2002 Arthur Keller – CS 180 3–2 Relational Model Table = relation . Column headers = attributes . Row = tuple Beers Relation schema = name(attributes) + other structure info., e.g., keys, other constraints. Example: Beers(name, manf) Order of attributes is arbitrary, but in practice we need to assume the order given in the relation schema. Relation instance is current set of rows for a relation schema. Database schema = collection of relation schemas. name manf WinterBrew Pete’s BudLite A.B.
Winter 2002 Arthur Keller – CS 180 3–3 A1 A2 A3 . .. An a1 a2 a3 an b1 b2 a3 cn a1 c3 b3 bn . . . x1 v2 d3 wn Relational Data Model Set theoretic Domain — set of values like a data type Cartesian product (or product) D1 × D2 × ... × Dn n-tuples (V1,V2,. ..,Vn) s.t., V1 D1, V2 D2,. ..,Vn Dn Relation-subset of cartesian product of one or more domains FINITE only; empty set allowed Tuples = members of a relation inst. Arity = number of domains Components = values in a tuple Domains — corresp. with attributes Cardinality = number of tuples Relation as table Rows = tuples Columns = components Names of columns = attributes Set of attribute names = schema REL (A1,A2,. ..,An) Arity C a r d i n a l i t y Attributes Component Tuple

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

View Full Document
Winter 2002 Arthur Keller – CS 180 3–4 Name address tel # 5 3 7 Cardinality of domain Domains N A T N1 A1 T1 N2 A2 T2 N3 A3 T3 N4 T4 N5 T5 T6 T7 Relation: Example Domain of Relation N A T N1 A1 T1 N1 A1 T2 N1 A1 T3 . . . N1 A1 T7 N1 A2 T1 N1 A3 T1 N2 A1 T1 Arity 3 Cardinality <=5x3x7 of relation Tuple μ Domain Component Attribute
Winter 2002 Arthur Keller – CS 180 3–5 Relation Instance Name Address Telephone Bob 123 Main St 555-1234 Bob 128 Main St 555-1235 Pat 123 Main St 555-1235 Harry 456 Main St 555-2221 Sally 456 Main St 555-2221 Sally 456 Main St 555-2223 Pat 12 State St 555-1235

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

View Full Document
Winter 2002 Arthur Keller – CS 180 3–6 About Relational Model Order of tuples not important Order of attributes not important (in theory) Collection of relation schemas (intension) Relational database schema Corresponding relation instances (extension) Relational database intension vs. extension schema vs. data metadata includes schema
Winter 2002 Arthur Keller – CS 180 3–7 Why Relations? Very simple model. Often a good match for the way we think about our data. Abstract model that underlies SQL, the most important language in DBMS’s today. But SQL uses “bags” while the abstract relational model is set-oriented.

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

View Full Document
Winter 2002 Arthur Keller – CS 180 3–8 Relational Design Simplest approach (not always best): convert each E.S. to a relation and each relationship to a relation.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 34

slides3 - Schedule Today Jan 10(TH x x Relational Model...

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

View Full Document
Ask a homework question - tutors are online