Relational Data Model. A Brief History of Data Models  1950s file systems, punched cards  1960s hierarchical  IMS  1970s network  CODASYL, IDMS 

Slides:



Advertisements
Similar presentations
Chapter 3 : Relational Model
Advertisements

Keys  SuperKey  a set of attributes whose values together uniquely identify a tuple in a relation  Candidate Key  a superkey for which no proper subset.
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
Relational Model and Relational Algebra Rose-Hulman Institute of Technology Curt Clifton.
1 Minggu 2, Pertemuan 3 The Relational Model Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 04 MODEL RELASIONAL Matakuliah: >/ > Tahun: > Versi: >
Database Architecture The Relational Database Model.
Chapter 5 Relational Model Concepts Dr. Bernard Chen Ph.D. University of Central Arkansas.
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
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.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Data Models Amandeep Kaur Lecturer GPC Khunimajra Call at
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.
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.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 3 Introduction to a First Course in Database Systems.
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 Adapted from Silberschatz, et al. CHECK SLIDE 16.
Chapter 6 The Relational Data Model and the Relational Algebra.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
The Relational Model Pertemuan 03 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Module Coordinator Tan Szu Tak School of Information and Communication Technology, Politeknik Brunei Semester
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of 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 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.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Relational Data Model DeSiaMore Powered by DeSiaMore.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
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.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
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.
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.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
INFO 340 Lecture 3 Relational Databases. Based on the relational model, grounded in mathematic set theories. Three basic elements: Relation, Tuple, and.
RELATION.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
02 - The Relational Database Model
The Relational Model Transparencies
RDBMS RELATIONAL DATABASE MANAGEMENT SYSTEM.
RELATIONAL DATA MODEL - 1
Presentation transcript:

Relational Data Model

A Brief History of Data Models  1950s file systems, punched cards  1960s hierarchical  IMS  1970s network  CODASYL, IDMS  1980s relational  INGRES, ORACLE, DB2, Sybase  Paradox, dBase  1990s object oriented and object relational  O2, GemStone, Ontos

Relational Model  Sets  collections of items of the same type  no order  no duplicates  Mappings domain range 1:many many:1 1:1 many:many

COURSE CoursenoSubjectLecturerMachine CS250ProgrammingLindseySun CS260GraphicsHubboldSun CS270MicrosWoodsPC CS290VerificationBarringerSun

Relational Model Notes  no duplicate tuples in a relation  a relation is a set of tuples  no ordering of tuples in a relation  a relation is a set  attributes of a relation have an implied ordering  but used as functions and referenced by name, not position  every tuple must have attribute values drawn from all of the domains of the relation or the special value NULL  all a domain’s values and hence attribute’s values are atomic.

Comparative Terms  Notation Course (courseno, subject, equipment) Student(studno,name,hons) Enrol(studno,courseno,labmark) FormalOracle Relation schemaTable description RelationTable TupleRow AttributeColumn DomainValue set

Keys  SuperKey  a set of attributes whose values together uniquely identify a tuple in a relation  Candidate Key  a superkey for which no proper subset is a superkey…a key that is minimal.  Can be more than one for a relation  Primary Key  a candidate key chosen to be the main key for the relation.  One for each relation  Keys can be composite

Foreign Key  a set of attributes in a relation that exactly matches a (primary) key in another relation  the names of the attributes don’t have to be the same but must be of the same domain  a foreign key in a relation A matching a primary key in a relation B represents a  many:one relationship between A and B Student(studno,name,tutor,year) Staff(lecturer,roomno,appraiser)

Referential Integrity  Student(studno,name,tutor,year)  Staff(lecturer,roomno,appraiser)  CASCADE  delete all matching foreign key tuples eg. STUDENT  RESTRICT  can’t delete primary key tuple STAFF whilst a foreign key tuple STUDENT matches  NULLIFY  foreign key STUDENT.tutor set to null if the foreign key ids allowed to take on null

Entity Integrity and Nulls No part of a key can be null  Attribute values  Atomic  Known domain  Sometimes can be null THREE categories of null values 1. Not applicable 2. Not known 3. Absent (not recorded) STUDENT

Relational Model  General  Simple  Flexible  Easy to query declaratively without programming  But.....  Good design essential  Integrity essential  Poor semantics  Relationships based on ‘value-matching’

Relational Design

Informal guidelines  Semantics of the attributes  easy to explain relation  doesn’t mix concepts  Reducing the redundant values in tuples  Choosing attribute domains that are atomic  Reducing the null values in tuples  Disallowing spurious tuples

Definitions  Cartesian Product The cartesian product (  ) between n sets is the set of all possible combinations of the elements of those sets.  Domain set of all possible values for an attribute; for attribute A, the domain is represented as dom(A). A domain has a format and a base data type.  Relation Schema denoted by R(A 1, A 2, …, A n ), is made up of relation name R and list of attributes A 1, A 2, …, A n.  Relation a subset of the cartesian product of its domains. Given a relation schema R, a relation on that schema r, a set of attributes A 1..A n for that relation then r(R)  (dom(A 1 )  dom(A 2 ) ...  dom(A n ))  Attribute a function on a domain for each instance of the mapping or tuple  Attribute Value the result of the attribute function. Each instance of the mapping is represented by one attribute value drawn from each domain or a special NULL value. Given a tuple t and an attribute A for a relation r, t[A]--> a, where a is the attribute’s value for that tuple.

 (N)-tuple a set of (n) attribute-value pairs representing a single instance of a relation’s mapping between its domains.  Degree the number of attributes a relation has.  Cardinality a number of tuples a relation has.  Roles several attributes can have the same domain; the attributes indicate different roles in the relation.  Key (SuperKey) a set of attributes whose values together uniquely identify every tuple in a relation. Let t1 and t2 be two tuples on relation r of relation schema R, and sk be a set of attributes whose values are the key for the relation schema R, then t1[sk]  t2[sk].  (Candidate) Key a (super)key that is minimal, i.e. has no proper subsets that still uniquely identify every tuple in a relation. There can be several for one relation.  Primary Key a candidate key chosen to be the main key for the relation. There is only one for each relation.  Foreign Key a candidate key of relation A situated in relation B.  Database a set of relations.