10/9/20151 The Relational Data Model TCU Database Systems Last update: September 2004 Reference: Elmasri 4 th edition, chapter 5.

Slides:



Advertisements
Similar presentations
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Advertisements

Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
The Relational Model Class 2 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) (From ER to Relational)
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 28 Database Systems I The Relational Data Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1.
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
The Relational Model Lecture 3 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) From ER to Relational.
Chapter 5 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
Database Systems Chapter 5 ITM 354. Chapter Outline Relational Model Concepts Relational Model Constraints and Relational Database Schemas Update Operations.
Chapter 5 The Relational Data Model and Relational Database Constraints.
CONSTRAINTS AND UPDATES CHAPTER 3 (6/E) CHAPTER 5 (5/E) 1.
Database Architecture The Relational Database Model.
Chapter 5 Relational Model Concepts Dr. Bernard Chen Ph.D. University of Central Arkansas.
CS 380 Introduction to Database Systems (Chapter 5: The Relational Data Model and Relational Database Constraints)
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Chapter 4 The Relational Model Pearson Education © 2014.
The Relational Model These slides are based on the slides of your text book.
1 Lecture 04 The relational data Model, Relational Constraints 1.
Relational Model Session 6 Course Name: Database System Year : 2012.
1 The Relational Data Model, Relational Constraints, and The Relational Algebra.
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
Relational Data Model, R. Ramakrishnan and J. Gehrke with Dr. Eick’s additions 1 The Relational Model Chapter 3.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints.
THE RELATIONAL DATA MODEL CHAPTER 3 (6/E) CHAPTER 5 (5/E) 1.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
1 The Relational Model Instructor: Mohamed Eltabakh
CG084&085 / / 1 The Relational Data Model Properties of Relations Keys and Constraints.
Topic 5 The Relational Data Model and Relational Database Constraints Faculty of Information Science and Technology Mahanakorn University of Technology.
Instructor: Churee Techawut Basic Concepts of Relational Database Chapter 5 CS (204)321 Database System I.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 5 The Relational Data Model.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1 Week4 Relational Model and Relational Database Constraints Relational Model Concepts.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 5 The Relational Data Model and Relational Database Constraints.
Chapter 3 The Relational Model. 2 Chapter 3 - Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between.
1 CSE 480: Database Systems Lecture 5: Relational Data Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
METU Department of Computer Eng Ceng 302 Introduction to DBMS The Relational Data Model and Relational Database Constraints by Pinar Senkul resources:
Chapter 6 The Relational Data Model and the Relational Algebra.
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ICOM 5016 – Introduction.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Chapter 2 Introduction to Relational Model. Example of a Relation attributes (or columns) tuples (or rows) Introduction to Relational Model 2.
Chapter 2: Intro to Relational Model. 2.2 Example of a Relation attributes (or columns) tuples (or rows)
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Relational Model E.F. Codd at IBM 1970 Chapter 3 (ed. 7 – Chap. 5)
Chapter 5 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
CS34311 The Relational Model. cs34312 Why Relational Model? Currently the most widely used Vendors: Oracle, Microsoft, IBM Older models still used IBM’s.
Lecture 03 Constraints. Example Schema CONSTRAINTS.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Chapter 3 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
Copyright © 2004 Pearson Education, Inc.
Relational Model Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 3.
4/20/2018.
The Relational Data Model
12/7/2018.
The Relational Data Model and Relational Database Constraints
4/8/2019.
5/12/2019.
Copyright © 2004 Pearson Education, Inc.
Presentation transcript:

10/9/20151 The Relational Data Model TCU Database Systems Last update: September 2004 Reference: Elmasri 4 th edition, chapter 5

10/9/20152 Introduction u Codd (1970) u Theoretical (mathematical) foundation u Concepts –relation data structure –integrity constraints u Operations –relational algebra and extensions

10/9/20153 Definitions u Figure 5.1 (informal definitions) u Domain D: a set of atomic (indivisible) values –{Names}, {valid GPA’s}, {valid grades} –must specify a data type {char(30)}, {[0.0,4.0]},{A,B,C,D,F} –dom(A i )=data type

10/9/20154 Definition: Relation Schema u think of as template or a Prolog predicate u R(A 1, A 2,...,A n ) where –R = relation name –A i =attribute –n = degree of relation R –example: PET(Name, Type, Breed, Birthdate, Weight)

10/9/20155 Definition: Relation u r(R): a relation r of the relation schema R(A 1,A 2,...,A n ) u set of n-tuples r={t 1, t 2,...,t m } –each n-tuple t is an ordered list, t=, where »v i is an element of dom(A i ) or null (unknown/D.N.E.) u More formally –a relation r(R) is a subset of the Cartesian product of the domains that define R u Max size (assuming finite domains):

10/9/20156 Definition: Relational DB Schema u Set of relation schemas AND integrity constraints u Figure 5.5 u A relational DB instance is a set of relation instances that satisfy the integrity constraints u Figure 5.6

10/9/20157 Characteristics of Relations u Row order (ordering of tuples) is insignificant –formally, but for performance it may be u Column order is insignificant –given a unique name or a fixed order u All values are atomic - can’t be subdivided –called the first normal form assumption –no composite attributes (e.g., address) –no multivalued attributes (e.g., car colors)

10/9/20158 Relational Model Constraints u Domain u Key u Entity Integrity u Referential Integrity u Others in section and later in normalization u Generally no ability to declaratively specify –semantic integrity constraints (max hours all projects<56; salary<boss) –heuristics (folks usually weigh more than their age)

10/9/20159 Domain Constraint u attribute value is an atomic value from domain u Example domains (from Oracle) –number(l,d): l=length, d=decimal digits –char(size): fixed length –varchar(size): variable length char string –date –long: up to 2 GB –many allow subranges and enumerated data types

10/9/ Key Constraint u Each tuple in r is unique (a set) u superkey: any subset of attributes for which the values are unique in all valid DB states u key: a minimal superkey u candidate key: multiple keys may be possible u primary key: the candidate key selected –prefer integer key or key with fewest attributes u Figure 5.4

10/9/ Integrity Constraints u Entity Integrity –no primary key value can be null u Referential Integrity –foreign key »same domain as p.k. attribute of referenced schema »value equals an existing referenced attribute or is null (if not part of a p.k.) –Figures 5.6, 5.7

10/9/ u DBMS must enforce integrity constraints u Insert –can violate all 4 I.C.’s »DBMS rejects or asks for correction u Delete –can only violate referential integrity »reject/cascade/modify referencing attribute value (null, default or another tuple value) u Modify »can violate all 4 if p.k. or f.k. »else domain constraint only Updates examples pp