Relational Model E.F. Codd at IBM 1970 Chapter 3 (ed. 7 – Chap. 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

Chapter 3 : Relational Model
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Relations The Relational Data Model John Sieg, UMass Lowell.
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.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
- relation schema, relations - database schema, database state
Relational Model and Relational Algebra Rose-Hulman Institute of Technology Curt Clifton.
Chapter 3: The relational data Model, Relational Constraints Csci455 Hassan Reza, PhD. Copyright ©
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.
The Relational Model Codd (1970): based on set theory Relational model: represents the database as a collection of relations (a table of values --> file)
Thomas Connolly and Carolyn Begg’s
Relational Data Model Sept. 2014Yangjun Chen ACS Outline: Relational Data Model Relational Data Model -relation schema, relations -database schema,
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)
Chapter 3 Relational Model Chapter 4 in Textbook.
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Relational Model & Relational Algebra. 2 Relational Model u Terminology of relational model. u How tables are used to represent data. u Connection between.
Chapter 4 The Relational Model Pearson Education © 2014.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
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.
1 Introduction to modeling Relational modelling Slides for this part are based on Chapters 11 from Halpin, T. & Morgan, T. 2008, Information Modeling and.
Chapter 4 Rational data model. Chapter 5 Rational data model Chapter 4 Rational data model.
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints.
Data Modeling Using the Entity-Relationship
Chapter 3: Relational Model I Structure of Relational Databases Structure of Relational Databases Convert a ER Design to a Relational Database Convert.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
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.
10/9/20151 The Relational Data Model TCU Database Systems Last update: September 2004 Reference: Elmasri 4 th edition, chapter 5.
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.
METU Department of Computer Eng Ceng 302 Introduction to DBMS The Relational Data Model and Relational Database Constraints by Pinar Senkul resources:
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 5 The Relational Data Model and Relational Database Constraints.
Chapter 6 The Relational Data Model and the Relational Algebra.
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
1 Functional Dependencies and Normalization Chapter 15.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Relational Data Model DeSiaMore Powered by DeSiaMore.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
1Fundamentals of Database Systems 기본키에 밑줄을 그은 COMPANY 관계 데이타베이스 스키마 FNAMEMINITLNAMESSNBDATEADDRESSSEXSALARYSUPERSSNDNO EMPLOYEE DNAMEDNUMBERMGRSSNMGRSTARTDATE.
Lecture 03 Constraints. Example Schema CONSTRAINTS.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
The relational model1 The relational model Mathematical basis for relational databases.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
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.
Chapter 71 The Relational Data Model, Relational Constraints & The Relational Algebra.
Entity Relationship Model
Relational Model Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 3.
The Relational Data Model and Relational Database Constraints
Database Design The Relational Model Text Ch5
376a. Database Design Dept. of Computer Science Vassar College
The Relational Data Model
Outline: Relational Data Model
Joining Tables ضم الجداول وإستخراج مناظر views منها الهدف : 1- استخراج المعلومات من جدولين أو اكثر بالإستفادة من الرابط بينهما وبإستخدام SQL 2- شروط قواعد.
Design tools and techniques for a relational database system
RELATIONAL DATA MODEL - 1
Presentation transcript:

Relational Model E.F. Codd at IBM 1970 Chapter 3 (ed. 7 – Chap. 5)

Relational Model “A relational model of data for large shared data banks” Most popular simplest most uniform data structures most formal files + mathematical foundation

Example of a information in a database?

EMPLOYEEFNAMEMINITLNAMESSNBDATEADDRESSSEXSALARYSUPERSSNDNO John B Smith Fondren, Houston, TXM Franklin T Wong Voss, Houston, TXM Alicia J Zelaya Castle, Spring, TXF Jennifer S Wallace Berry, Bellaire, TXF Ramesh K Narayan Fire Oak, Humble, TXM Joyce A English Rice, Houston, TXF Ahmad V Jabbar Dallas, Houston, TXM James E Borg Stone, Houston, TXM55000null 1 DEPARTMENTDNAMEDNUMBERMGRSSNMGRSTARTDATE Research Administration Headquarters

Database Object, instance, entity Relationships The relational model captures all of this in a table

Relational Model a table is composed of rows and columns row - a collection of related data values – describing an entity or relationship instance column – same attribute for different entities Relation is a table of values Database is a collection of relations

Glossary of terms: Table -> RELATION Row -> TUPLE Column header -> ATTRIBUTE Data type of a column -> DOMAIN

Glossary Cont’d DOMAIN D – specify data type, format for each domain – is of data-type (or format) – set of atomic values (relational model requirement) TUPLE – no composite values (all values are atomic) – no multivalued attributes (First Normal Form)

Relations RELATION Characteristics – Set of tuples - not ordered – Values within tuples are ordered ATTRIBUTES – A i is an attribute with a domain dom(A i ) – degree of a relation - the number of attributes RELATION SCHEMA: R(A 1, A 2,...,A n ): – includes relation name R and list (set) of attributes A i

DB Schema – 2 notations EMPLOYEE(Fname, Minit, Lname, SSN, Bdate, Address, Sex, Salary) EMPLOYEE Fname Minit Lname SSN Bdate Address Sex Salary

Relations RELATION (instance) r( R ) – current relation state – set of n-tuples (where n is a number of attributes) – r = {t 1, t 2,...,t m } each n-tuple t is an ordered list on n values – t = where v i is an element of dom(A i ) or null – t j [A i ] is the value v i for attribute A i of tuple t j – the tuples themselves are not ordered

r( R ) is a subset of what? (use domains of attributes) dom(A 1 ) X dom(A 2 ) X...X dom(A n )

Relations relation intension refers to the schema relation extension to the state all tuples within a relation are distinct

Constraints 1.DOMAIN CONSTRAINTS: – 1st normal form 1NF value of each attribute must be an atomic (single) value from the domain for that attribute no composite attributes

Constraints 2. KEY CONSTRAINTS: – All elements are distinct no two tuples can have the same combination of values for all their values (uniqueness constraint). Therefore, all elements are distinct. How can this be enforced? superkey sk – any set of attributes with property: no two tuples from the relation have the same combination of values for those attributes – t 1 [sk] != t 2 [sk] – every relation has at least one superkey, what is it?

Constraints cont’d key is a minimal superkey if – we cannot remove any attribute and still have uniqueness constraint hold – (city, state, zip) – Tuscaloosa has > 1 zip, same zip for Cottondale, Coaling candidate key is any one of the keys primary key PK is designated candidate key – underlined in both relation and ER models EMPLOYEE(Fname, Minit, Lname, SSN, Bdate, Address, Sex, Salary)

Constraints 3. ENTITY INTEGRITY CONSTRAINTS: – no primary key value can be null

Referential Constraint - Relationships 4. REFERENTIAL INTEGRITY CONSTRAINTS – a tuple in one relation that refers to another relation must refer to an existing tuple in that relation Student(Name, SSN, HomePhone, Address, OfficePhone, Age, GPA) Department(Name, DeptHead, Location, College) Students have a major To Student relation add?

Referential Constraint - Relationships Student(Name, SSN, HomePhone, Address, OfficePhone, Age, GPA, Major) Department(Name, DeptHead, Location, College)

Constraints 4. REFERENTIAL INTEGRITY CONSTRAINTS – a tuple in one relation that refers to another relation must refer to an existing tuple in that relation specified between two relations maintain the consistency among tuples in two relations if one relation refers another, then the primary key of the referred relation is a foreign key FK in the referring relation. t 1 [PK] = t 2 [FK] Can a foreign key can be null? Yes, for example if an employee does not have a supervisor

Referential Constraint - Relationships Student(Name, SSN, HomePhone, Address, OfficePhone, Age, GPA, Major) Department(Name, DeptHead, Location, College)

Referential Constraint Name SSN HomePhone Address OfficePhone Age GPA Major Name DeptHead Location College

Relations RELATIONAL DATABASE SCHEMA – a set of relation schemas and a set of referential integrity constraints S = {R 1, R 2,..., R m } and a set of integrity constraints IC RELATIONAL DATABASE INSTANCE DB – DB = {r 1, r 2,...r m }