CSC271 Database Systems Lecture # 5. Summary: Previous Lecture  Database languages  Functions of a DBMS  DBMS environment  Data models and their categories.

Slides:



Advertisements
Similar presentations
Chapter IV Relational Data Model Pemrograman Sistem Basis Data.
Advertisements

The Relational Model Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
RELATIONAL DATABASES. Relational data Structure RELATION: Table with columns and rows ATTRIBUTE: Column of a relation DOMAIN: Set of allowable values.
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.
Lesson II The Relational Model © Pearson Education Limited 1995, 2005.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
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: >
Thomas Connolly and Carolyn Begg’s
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Database Architecture The Relational Database Model.
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
Relational Model & Relational Algebra. 2 Relational Model u Terminology of relational model. u How tables are used to represent data. u Connection between.
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.
Relational Model Session 6 Course Name: Database System Year : 2012.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
Module 3: The Relational Model.  Overview Terminology Relational Data Structure Mathematical Relations Database Relations Relational Keys Relational.
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.
Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
1 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An = {(x1, x2, x3, …, xn): xi  Ai} R  A1  A2.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
The Relational Model Pertemuan 03 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
Relational Database. Database Management System (DBMS)
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Chapter 2: Intro to Relational Model. 2.2 Example of a Relation attributes (or columns) tuples (or rows)
12/2/2015CPSC , CPSC , Lecture 41 Relational Model.
WXGE 6101 DATABASE CONCEPTS & IMPLEMENTATIONS. Lesson Overview The Relational Model Terminology of relational model. Properties of database relations.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Introduction.
L8-2-S1 Misc Topics © M.E. Fayad SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
CSC271 Database Systems Lecture # 7. Summary: Previous Lecture  Relational keys  Integrity constraints  Views.
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,
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
CSCI 6315 Applied Database Systems Review for Midterm Exam I Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Chapter 4 The Relational Model Pearson Education © 2009.
Teacher Workshop Database Design Pearson Education © 2014.
Relational Model Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 3.
Relational Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany)
Chapter 2: Relational Model
Chapter 2: Intro to Relational Model
Chapter 3: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
The Relational Database Model
Data Base System Lecture 6: Relational Model
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
DATABASE SYSTEM.
Chapter 4 The Relational Model Pearson Education © 2009.
The Relational Model Transparencies
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 2: Intro to Relational Model
Example of a Relation attributes (or columns) tuples (or rows)
Design tools and techniques for a relational database system
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 4 The Relational Model Pearson Education © 2009.
Presentation transcript:

CSC271 Database Systems Lecture # 5

Summary: Previous Lecture  Database languages  Functions of a DBMS  DBMS environment  Data models and their categories

The Relational Model Chapter 3

History of Relational Model  Proposed by E.F. Codd in 1970  “ A relational model of data for large shared data banks”  Objectives of relational model  High degree of data independence  Dealing with issues e.g. data semantics, consistencies, and redundancy  To enable the expansion of set-oriented data manipulation languages

Examples of RDBMSs  Oracle  Microsoft SQLServer  Microsoft Access  Visual FoxPro  InterBase  JDataStore  R:Base

Relational Model  Based on mathematical concept of a relation  Which is physically represented as a table  Codd, a trained mathematician, used terminology taken from mathematics, principally set theory and predicate logic

Relational Model Terminology  A relation is a table with columns and rows  Only applies to logical structure of the database (external and conceptual level of ANSI-SPARC architecture), not the physical structure  Attribute is a named column of a relation  Domain is the set of allowable values for one or more attributes

Relational Model Terminology..  Tuple is a row of a relation  Degree is the number of attributes in a relation  Cardinality is the number of tuples in a relation  Relational Database is a collection of normalized relations with distinct relation names

Instances of Sample Relations

Examples of Attribute Domains

Alternative Terminology

Mathematical Relations  Consider two sets, D1 & D2,  Where D1 = {2, 4} and D2 = {1, 3, 5}  Cartesian product, D1 x D2 is,  Set of all ordered pairs, where first element is member of D1 and second element is member of D2  D1 x D2 = {(2, 1), (2, 3), (2, 5), (4, 1), (4, 3), (4, 5)}  Alternative way is to find all combinations of elements with first from D1 and second from D2

Mathematical Relations..  Any subset of Cartesian product is a relation; e.g.  R = {(2, 1), (4, 1)}  May specify which pairs are in relation using some condition for selection; e.g.  Second element is 1:  R = {(x, y) | x  D1, y  D2, and y = 1}  First element is always twice the second:  S = {(x, y) | x  D1, y  D2, and x = 2y}

Mathematical Relations..  Relating with database relations  Consider Branch relation in the example where branchNo = {B002,B003} city = {London, Glasgow}  Cartesian product, branchNo x city is, {(B002, London), (B002, Glasgow), (B003, London), (B003, Glasgow)}  Any subset of Cartesian product is a relation

Mathematical Relations..  Consider three sets D1, D2, D3 with Cartesian Product D1 x D2 x D3, e.g.  D1 = {1, 3}D2 = {2, 4}D3 = {5, 6}  D1 x D2 x D3 = {(1,2,5), (1,2,6), (1,4,5), (1,4,6), (3,2,5), (3,2,6), (3,4,5), (3,4,6)}  Any subset of these ordered triples is a relation

Mathematical Relations..  Cartesian product of n sets (D1, D2,…, Dn) is:  D1 x D2 x... x Dn = {(d1, d2,..., dn) | d1  D1, d2  D2,..., dn  Dn}  Usually written as: n X Di i = 1  Any set of n-tuples from this Cartesian product is a relation on the n sets

Database Relations  Relation schema  Named relation defined by a set of attribute and domain name pairs  Let A1, A2,...,An be attributes with domains D1, D2,..., Dn  Then the set {A1:D1, A2:D2,..., An:Dn} is a relation schema  A relation R defined by a relation schema S is a set of mappings from the attribute names to their corresponding domains. Thus, relation R is a set of n-tuples:  (A1:d1, A2:d2,..., An:dn) such that  d1 ∈ D1, d2 ∈ D2,..., dn ∈ Dn

Database Relations  Relation schema  Named relation defined by a set of attribute and domain name pairs  Let A1, A2,...,An be attributes with domains D1, D2,..., Dn  Then the set {A1:D1, A2:D2,..., An:Dn} is a relation schema  A relation R defined by a relation schema S is a set of mappings from the attribute names to their corresponding domains. Thus, relation R is a set of n-tuples:  (A1:d1, A2:d2,..., An:dn) such that  d1 ∈ D1, d2 ∈ D2,..., dn ∈ Dn

Database Relations..  Branch relation schema  Branch = {branchNo:BranchNumbers, street: StreetNames, city: CityNames, postcode:PostCodes}  Tuple of a Branch relation {branchNo:B005, street: 22 Deer Rd, city: London, postcode:SW1 4EH}

Relational Database Schema  If R1, R2,..., Rn are a set of relation schemas, then we can write the relational database schema, or simply relational schema, R, as: R= {R1, R2,..., Rn}

Properties of Relations  Relation name is distinct from all other relation names in relational schema  Each cell of relation contains exactly one atomic (single) value  Each attribute has a distinct name  Values of an attribute are all from the same domain

Properties of Relations..  Each tuple is distinct; there are no duplicate tuples  Order of attributes has no significance  Order of tuples has no significance, theoretically

Summary  Relational model terminology  Mathematical relations  Database relations  Properties of a relation

References  All the material (slides, diagrams etc.) presented in this lecture is taken (with modifications) from the Pearson Education website : 