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.

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 Model Table = relation. Column headers = attributes. Row = tuple Beers Relation schema = name(attributes) + other structure info., e.g., keys,
Chapter 3 : Relational Model
CSC271 Database Systems Lecture # 5. Summary: Previous Lecture  Database languages  Functions of a DBMS  DBMS environment  Data models and their categories.
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
Relational Algebra 1 Chapter 5.1 V3.0 Napier University Dr Gordon Russell.
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Relations The Relational Data Model John Sieg, UMass Lowell.
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: >
Entity PrimaryKey Attribute relationship Cardinality: zero to many Cardinality: one and only one Cardinality: one to many Explanation Entity Relationship.
Thomas Connolly and Carolyn Begg’s
Database Architecture The Relational Database Model.
COURSE REGISTRATION SYSTEM Case study IST2101. Case Study: Course Registration (1) IST2102 You are helping Penn State create a course registration system.
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.
Module Title? DBMS E-R Model to Relational Model.
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
Concepts and Terminology Introduction to Database.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Instructor: Churee Techawut Basic Concepts of Relational Database Chapter 5 CS (204)321 Database System I.
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.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – Relational Model.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
Databases. Not All Tables Are Created Equal Spreadsheets use tables to store data and formulas associated with that data The “meaning” of data is implicit.
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.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model.
Announcements Reading for Monday –4.6 Homework 3 – Due 9/29.
Chapter 2: Intro to Relational Model. 2.2 Example of a Relation attributes (or columns) tuples (or rows)
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.
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. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Howard Paul. Sequential Access Index Files and Data File Random Access.
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
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.
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.
Databases Chapter 16.
Data Base System Lecture 6: Relational Model
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
CS 3630 Database Design and Implementation
The Relational Model Transparencies
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
DATABASE Purpose of database
RELATIONAL DATA MODEL - 1
Presentation transcript:

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  A3  …  An

2 Mapping and Relation R1 = {(1, 2), (1, 5), (2, 5)} = {(x, y) | x is in A, y is in B, x < y and x <= 2} A relationship between A and B

3 How Many Possible Relations/Mappings between A and B A = {1, 2, 3, 4} B = {2, 5} R  A  B

4 Functions Function is a mapping, but not one-to-one! y = f(x) For the same value of x, the value of y always the same. y1 = f(3) u = 2 y2 = f(u + 1) Both y1 and y2 have the same value! It’s NOT one-to-many!

5 Functions (II) But for different values of x, the value of y could be the same. y = f(x) = x 2 f(2) = f(-2) It could be many-to-one.

6 Functions (III) Many-to-One Total / Partial (Total) X1 X2 X3 X4 A2 A4 A6 A8

7 Relation Example Student = {s: s is a student registered at UWP this semester} Course = {c: c is a course offered at UWP this semester}

8 Student Taking Course Student Course S9 S2 S4 S5 C1 C2 C3 C5 Partial or Total?

9 Student Taking Course Student Course S9 S2 S4 S5 C1 C2 C3 C5 Partial

10 Example S = {s | s is a student registered at UWP this semester} C = {c | c is a course offered at UWP this semester} S  C: All possible registrations Registration = {(s, c): (s, c)  S  C and s is taking c} Partial for both S and C Many-to-many It can be updated!

11 Terminology R1 = {(1, 2), (1, 5), (2, 5)} R1  A  B Tuple: (1, 2), (1, 5) and (2, 5) Cardinality: 3 Domain: A for the 1 st component B for the 2 nd component

12 Using Tables for Relations Att1Att2 Att3 15x 510w 42x 35y R = {(1, 5, x), (4, 2, x), (3, 5, y), (5, 10, w)}

13 Database Relations (Tables) Relation (Table) Attribute (Field, column) Tuple (Record, row) Domain for each field Degree (number of fields): 3 Cardinality (number of records): 4 Att1Att2 Att3 15x 510w 42x 35y

14 Table Instance A subset of the Cartesian Product No duplicates Update Tuples can be modified New tuples can be inserted Old tuples can be deleted Different instance after update Student Course S2C2 S3C2 S2C5

15 Relation Schema A named relation defined by a set of attribute and domain pairs. R (Att1:A1, Att2:A2, Att3:A3) R (Att1, Att2, Att3) Domain: Att1: A1 Att2: A2 Att3: A3 The relation schema represents the Cartesian Product A1  A2  A3 Same table schema, different table instances.

16 Relational Model What is a Relational Database? A collection of relations (tables) Relational Database: A collection of normalized relations (tables) with distinct relation/table names.

17 Database Schema Collection of Relation Schemas Database definition

18 Database Instance Relation instances (Tables) Actual records Store Data Update Data Retrieve Data

19 Properties of Relations Each relation has a distinct name (within the database) Each attribute has a distinct name (within the relation) Each tuple is distinct Each cell contains exactly one atomic (single) value The order of attributes has no significance The order of tuples has no significance

20 Database UWP Student(ID, Name, Phone, Address…) Course(ID, Title, Department, Credits…) Faculty(ID, Name, Department, Phone, Address…) Registration (Student, Course) Other possible fields? Schedule (Faculty, Course) Other possible fields? Other tables

Chapter 3 The Relational Model 3.2 Terminology 21