SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
The Relational Model
History of Relational Model
1970 Paper by E.F. Codd “A Relational Model of Data for Large
Shared Data Banks” proposed relational model
System R, prototype developed at IBM Research Lab at San
Jose, California – late 1970s
Peterlee Test Vehicle, IBM UK Scientific Lab
INGRES, University of California at Berkeley
System R results used in developing DB2 from IBM and alsoSystem R results used in developing DB2 from IBM and also
Oracle
Early microcomputer based DBMSs were relational - dBase,
R;base, Paradox
Microsoft’s Access, now most popular microcomputer-based
DBMS, is relational
Oracle, DB2, Informix, Sybase, Microsoft’s SQL Server, MySQL
- most popular enterprise DBMSs, all relational
Advantages of Relational Model
• Provides data independence-separates logical from physical level
• Based on mathematical notion of relation
• Can use expressive, exact mathematical notation
• Theory provides tools for improving design
• Basic structure is simple, easy to understand
• Data operations easy to express, using a few powerful commands
• Operations do not require user to know storage structures used
Data Structures
• Relations are represented physically as tables
• Tables are related to one another
• Table holds information about entities (objects)Table holds information about entities (objects)
• Rows (tuples) correspond to individual records
• Columns correspond to attributes
• A column contains values from one domain
Properties of Tables
• Each cell contains at most one value
• Each column has a distinct name, the name of
the attribute it represents
• Values in a column all come from the same• Values in a column all come from the same
domain
• Each tuple is distinct – no duplicate tuples
• Order of tuples is immaterial
Example of Relational Model
• Student table tells facts about students
• Faculty table shows facts about faculty
• Class table shows facts about classes,
including what faculty member teaches eachincluding what faculty member teaches each
• Enroll table relates students to classes
Simple University Database
Student
stuId lastName firstName major credits
S1001 Smith Tom History 90
S1002 Chin Ann Math 36
S1005 Lee Perry History 3
S1010 Burns Edward Art 63
S1013 McCarthy Owen Math 0
S1015 Jones Mary Math 42
S1020 Rivera Jane CSC 15
Figure 4.1(a) The Student Table
Figure 4.1(c) The Class Table
Class
classNumber facId schedule room
ART103A F101 MWF9 H221
CSC201A F105 TuThF10 M110
CSC203A F105 MThF12 M110
HST205A F115 MWF11 H221
MTH101B F110 MTuTh9 H225
MTH103C F110 MWF11 H225
Enroll
Faculty
facId name department rank
F101 Adams Art Professor
F105 Tanaka CSC Instructor
F110 Byrne Math Assistant
F115 Smith History Associate
F221 Smith CSC Professor
Figure 4.1(b) The Faculty Table
Enroll
stuId classNumber grade
S1001 ART103A A
S1001 HST205A C
S1002 ART103A D
S1002 CSC201A F
S1002 MTH103C B
S1010 ART103A
S1010 MTH103C
S1020 CSC201A B
S1020 MTH101B A
Figure 4.1(d) The Enroll Table
• Each row of Student table represents one student
• Each row of Class table represents one class
• Each row of Enroll represents relationship between one student and one class
Properties of Relations
• Degree: the number of attributes
– 2 attributes - binary; 3 attributes - ternary; n
attributes - n-ary
– A property of the intension – does not change
unless database design changesunless database design changes
• Cardinality: the number of tuples
– Changes as tuples are added or deleted
– A property of the extension – changes often
• Keys
• Integrity constraints
Relation Keys
• Relations never have duplicate tuples, you can always tell tuples apart; implies
there is always a key (which may be a composite of all attributes, in worst
case)
• Superkey: set of attributes that uniquely identifies tuples
• Candidate key: superkey such that no proper subset of itself is also a superkey• Candidate key: superkey such that no proper subset of itself is also a superkey
(i.e. it has no unnecessary attributes)
• Primary key: candidate key chosen for unique identification of tuples
• Cannot verify a key by looking at an instance; need to consider semantic
information to ensure uniqueness
• A foreign key is an attribute or combination of attributes that is the primary
key of some relation (called its home relation)
Integrity Constraints
• Integrity: correctness and internal consistency
• Integrity constraints-rules or restrictions that apply to all
instances of the database
• Enforcing integrity constraints ensures only legal states of the
database are created
• Types of constraints• Types of constraints
– Domain constraint - limits set of values for attribute
– Entity integrity: no attribute of a primary key can have a null value
– Referential integrity: each foreign key value must match the primary
key value of some tuple in its home relation or be completely null.
– General constraints or business rules: may be expressed as table
constraints or assertions
Representing Relational Database
Schemas
• Can have any number of relation schemas
• For each relation schema, list name of relation followed by list
of attributes in parentheses
• Underline primary key in each relation schema
• Indicate foreign keys (We use italics – arrows are best)• Indicate foreign keys (We use italics – arrows are best)
• Database schema actually includes domains, views, character
sets, constraints, stored procedures, authorizations, etc.
• Example: University database schema
Student (stuId, lastName, firstName, major, credits)
Class (classNumber, facId, schedule, room)
Faculty (facId, name, department, rank)
Enroll(stuId,classNumber,grade)

Más contenido relacionado

La actualidad más candente

All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
Naresh Kumar
 
Unit 4 rdbms study_material
Unit 4  rdbms study_materialUnit 4  rdbms study_material
Unit 4 rdbms study_material
gayaramesh
 

La actualidad más candente (19)

DBMS OF DATA MODEL Deepika 2
DBMS OF DATA MODEL  Deepika 2DBMS OF DATA MODEL  Deepika 2
DBMS OF DATA MODEL Deepika 2
 
Types of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal GulatiTypes of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal Gulati
 
Database management system chapter5
Database management system chapter5Database management system chapter5
Database management system chapter5
 
Relational databases
Relational databasesRelational databases
Relational databases
 
An hour with Database and SQL
An hour with Database and SQLAn hour with Database and SQL
An hour with Database and SQL
 
Data Models In Database Management System
Data Models In Database Management SystemData Models In Database Management System
Data Models In Database Management System
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
Database Engineering: Part one
Database Engineering: Part oneDatabase Engineering: Part one
Database Engineering: Part one
 
Database Management & Models
Database Management & ModelsDatabase Management & Models
Database Management & Models
 
Chapter-2 Database System Concepts and Architecture
Chapter-2 Database System Concepts and ArchitectureChapter-2 Database System Concepts and Architecture
Chapter-2 Database System Concepts and Architecture
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Four Types of Data Models
Four Types of Data ModelsFour Types of Data Models
Four Types of Data Models
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1
 
DATA BASE MODEL Rohini
DATA BASE MODEL RohiniDATA BASE MODEL Rohini
DATA BASE MODEL Rohini
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Unit 4 rdbms study_material
Unit 4  rdbms study_materialUnit 4  rdbms study_material
Unit 4 rdbms study_material
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-converted
 
Chapter 6 Database SC025 2017/2018
Chapter 6 Database SC025 2017/2018Chapter 6 Database SC025 2017/2018
Chapter 6 Database SC025 2017/2018
 
Database
DatabaseDatabase
Database
 

Similar a RDBMS Model

Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
NurulIzrin
 
Lecture-8-The-GIS-Database-Part-1.ppt
Lecture-8-The-GIS-Database-Part-1.pptLecture-8-The-GIS-Database-Part-1.ppt
Lecture-8-The-GIS-Database-Part-1.ppt
Prabin Pandit
 

Similar a RDBMS Model (20)

Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
Database intro
Database introDatabase intro
Database intro
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
DBMS:Relational Modal
DBMS:Relational ModalDBMS:Relational Modal
DBMS:Relational Modal
 
Data_base.pptx
Data_base.pptxData_base.pptx
Data_base.pptx
 
Dbms relational data model and sql queries
Dbms relational data model and sql queries Dbms relational data model and sql queries
Dbms relational data model and sql queries
 
Database_Introduction.pdf
Database_Introduction.pdfDatabase_Introduction.pdf
Database_Introduction.pdf
 
relational database
relational databaserelational database
relational database
 
PPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptxPPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptx
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
 
Lecture-8-The-GIS-Database-Part-1.ppt
Lecture-8-The-GIS-Database-Part-1.pptLecture-8-The-GIS-Database-Part-1.ppt
Lecture-8-The-GIS-Database-Part-1.ppt
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
Chapter – 3 Database Design P-I.pdf
Chapter – 3 Database Design P-I.pdfChapter – 3 Database Design P-I.pdf
Chapter – 3 Database Design P-I.pdf
 
oracle
oracle oracle
oracle
 
19IS305_U2_LP4_LM4-22-23.pdf
19IS305_U2_LP4_LM4-22-23.pdf19IS305_U2_LP4_LM4-22-23.pdf
19IS305_U2_LP4_LM4-22-23.pdf
 
603s129
603s129603s129
603s129
 
Chapter 9 Data Design .pptxInformation Technology Project Management
Chapter 9 Data Design .pptxInformation Technology Project ManagementChapter 9 Data Design .pptxInformation Technology Project Management
Chapter 9 Data Design .pptxInformation Technology Project Management
 

Más de Sarmad Ali

RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 Relational
Sarmad Ali
 
RDBMS ERD Examples
RDBMS ERD ExamplesRDBMS ERD Examples
RDBMS ERD Examples
Sarmad Ali
 

Más de Sarmad Ali (12)

Network Engineer Interview Questions with Answers
Network Engineer Interview Questions with Answers Network Engineer Interview Questions with Answers
Network Engineer Interview Questions with Answers
 
RDBMS Algebra
RDBMS AlgebraRDBMS Algebra
RDBMS Algebra
 
RDBMS ERD
RDBMS ERDRDBMS ERD
RDBMS ERD
 
RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 Relational
 
RDBMS ERD Examples
RDBMS ERD ExamplesRDBMS ERD Examples
RDBMS ERD Examples
 
Management Information System-MIS
Management Information System-MISManagement Information System-MIS
Management Information System-MIS
 
Classification of Compilers
Classification of CompilersClassification of Compilers
Classification of Compilers
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction
 
Introduction to RDBMS
Introduction to RDBMSIntroduction to RDBMS
Introduction to RDBMS
 
About Data Base
About Data BaseAbout Data Base
About Data Base
 
Management information system-MIS
Management information system-MISManagement information system-MIS
Management information system-MIS
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

RDBMS Model

  • 2. History of Relational Model 1970 Paper by E.F. Codd “A Relational Model of Data for Large Shared Data Banks” proposed relational model System R, prototype developed at IBM Research Lab at San Jose, California – late 1970s Peterlee Test Vehicle, IBM UK Scientific Lab INGRES, University of California at Berkeley System R results used in developing DB2 from IBM and alsoSystem R results used in developing DB2 from IBM and also Oracle Early microcomputer based DBMSs were relational - dBase, R;base, Paradox Microsoft’s Access, now most popular microcomputer-based DBMS, is relational Oracle, DB2, Informix, Sybase, Microsoft’s SQL Server, MySQL - most popular enterprise DBMSs, all relational
  • 3. Advantages of Relational Model • Provides data independence-separates logical from physical level • Based on mathematical notion of relation • Can use expressive, exact mathematical notation • Theory provides tools for improving design • Basic structure is simple, easy to understand • Data operations easy to express, using a few powerful commands • Operations do not require user to know storage structures used
  • 4. Data Structures • Relations are represented physically as tables • Tables are related to one another • Table holds information about entities (objects)Table holds information about entities (objects) • Rows (tuples) correspond to individual records • Columns correspond to attributes • A column contains values from one domain
  • 5. Properties of Tables • Each cell contains at most one value • Each column has a distinct name, the name of the attribute it represents • Values in a column all come from the same• Values in a column all come from the same domain • Each tuple is distinct – no duplicate tuples • Order of tuples is immaterial
  • 6. Example of Relational Model • Student table tells facts about students • Faculty table shows facts about faculty • Class table shows facts about classes, including what faculty member teaches eachincluding what faculty member teaches each • Enroll table relates students to classes
  • 7. Simple University Database Student stuId lastName firstName major credits S1001 Smith Tom History 90 S1002 Chin Ann Math 36 S1005 Lee Perry History 3 S1010 Burns Edward Art 63 S1013 McCarthy Owen Math 0 S1015 Jones Mary Math 42 S1020 Rivera Jane CSC 15 Figure 4.1(a) The Student Table Figure 4.1(c) The Class Table Class classNumber facId schedule room ART103A F101 MWF9 H221 CSC201A F105 TuThF10 M110 CSC203A F105 MThF12 M110 HST205A F115 MWF11 H221 MTH101B F110 MTuTh9 H225 MTH103C F110 MWF11 H225 Enroll Faculty facId name department rank F101 Adams Art Professor F105 Tanaka CSC Instructor F110 Byrne Math Assistant F115 Smith History Associate F221 Smith CSC Professor Figure 4.1(b) The Faculty Table Enroll stuId classNumber grade S1001 ART103A A S1001 HST205A C S1002 ART103A D S1002 CSC201A F S1002 MTH103C B S1010 ART103A S1010 MTH103C S1020 CSC201A B S1020 MTH101B A Figure 4.1(d) The Enroll Table • Each row of Student table represents one student • Each row of Class table represents one class • Each row of Enroll represents relationship between one student and one class
  • 8. Properties of Relations • Degree: the number of attributes – 2 attributes - binary; 3 attributes - ternary; n attributes - n-ary – A property of the intension – does not change unless database design changesunless database design changes • Cardinality: the number of tuples – Changes as tuples are added or deleted – A property of the extension – changes often • Keys • Integrity constraints
  • 9. Relation Keys • Relations never have duplicate tuples, you can always tell tuples apart; implies there is always a key (which may be a composite of all attributes, in worst case) • Superkey: set of attributes that uniquely identifies tuples • Candidate key: superkey such that no proper subset of itself is also a superkey• Candidate key: superkey such that no proper subset of itself is also a superkey (i.e. it has no unnecessary attributes) • Primary key: candidate key chosen for unique identification of tuples • Cannot verify a key by looking at an instance; need to consider semantic information to ensure uniqueness • A foreign key is an attribute or combination of attributes that is the primary key of some relation (called its home relation)
  • 10. Integrity Constraints • Integrity: correctness and internal consistency • Integrity constraints-rules or restrictions that apply to all instances of the database • Enforcing integrity constraints ensures only legal states of the database are created • Types of constraints• Types of constraints – Domain constraint - limits set of values for attribute – Entity integrity: no attribute of a primary key can have a null value – Referential integrity: each foreign key value must match the primary key value of some tuple in its home relation or be completely null. – General constraints or business rules: may be expressed as table constraints or assertions
  • 11. Representing Relational Database Schemas • Can have any number of relation schemas • For each relation schema, list name of relation followed by list of attributes in parentheses • Underline primary key in each relation schema • Indicate foreign keys (We use italics – arrows are best)• Indicate foreign keys (We use italics – arrows are best) • Database schema actually includes domains, views, character sets, constraints, stored procedures, authorizations, etc. • Example: University database schema Student (stuId, lastName, firstName, major, credits) Class (classNumber, facId, schedule, room) Faculty (facId, name, department, rank) Enroll(stuId,classNumber,grade)