cs411-03-rel - 1 CS411 Database Systems 03 Relational Model...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 CS411 Database Systems 03: Relational Model 2 Why Do We Learn This? 2 3 Motivations & Comparison 4 Database Modeling & Implementation Database Model (E/R, ODL) Ideas Physical storage Diagrams (E/R) Tables: column names: attributes rows: tuples Complex file organization and index structures. Relational Schema 5 ER Model vs. Relational Model • Both are used to model data • ER model has many concepts – entities, relations, attributes, etc. – well-suited for capturing the app. requirements – not well-suited for computer implementation – (does not even have operations on its structures) • Relational model – has just a single concept: relation – world is represented with a collection of tables – well-suited for efficient manipulations on computers 6 The Basics 7 An Example of a Relation Name Price Category Manufacturer gizmo $19.99 gadgets GizmoWorks Power gizmo $29.99 gadgets GizmoWorks SingleTouch $149.99 photography Canon MultiTouch $203.99 household Hitachi tuples Attribute names Table name Products: 8 Domains • Each attribute has a type • Must be atomic type (why? see later) • Called domain • Examples: – Integer – String – Real – … 9 Schemas vs. Instances 10 Schemas The Schema of a Relation: – Relation name plus attribute names – E.g. Product(Name, Price, Category, Manufacturer) – In practice we add the domain for each attribute The Schema of a Database – A set of relation schemas – E.g. Product(Name, Price, Category, Manufacturer), Vendor(Name, Address, Phone), . . . . . . . 11 Instances • Relational schema = R(A1,…,Ak): Instance = relation with k attributes (of “type” R) – values of corresponding domains • Database schema = R1(…), R2(…), …, Rn(…) Instance = n relations, of types R1, R2, ..., Rn 12 Example Name Price Category Manufacturer gizmo $19.99 gadgets GizmoWorks Power gizmo $29.99 gadgets GizmoWorks SingleTouch $149.99 photography Canon MultiTouch $203.99 household Hitachi Relational schema: Product(Name, Price, Category, Manufacturer) Instance: 13 Updates The database maintains a current database state. Updates to the data: 1) add a tuple 2) delete a tuple 3) modify an attribute in a tuple Updates to the data happen very frequently. Updates to the schema: relatively rare. Rather painful. Why ? 14 Q: Schema vs. Instances • Think of it as columns vs. rows Think of an example, answer following: For Schema: • When do you determine a schema? • How often do you change your mind? For Instance: • When do you determine an instance? • How often do you change your mind? 15 15 Behind the Scene: Database Turing Awards? 1966 A.J. Perlis 1967 Maurice V. Wilkes 1968 Richard Hamming 1969 Marvin Minsky 1970 J.H. Wilkinson 1971 John McCarthy 1972 E.W. Dijkstra 1973 Charles W. Bachman 1974 Donald E. Knuth 1975 Allen Newell 1975 Herbert A. Simon 1976 Michael O. Rabin 1977 John Backus 1978 Robert W. Floyd 1979 Kenneth E. Iverson 1980 C. Antony R. Hoare 1981 Edgar F. Codd 1982 Stephen A. CookStephen A....
View Full Document

Page1 / 63

cs411-03-rel - 1 CS411 Database Systems 03 Relational Model...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online