SlideShare a Scribd company logo
1 of 25
Database Systems
CS4011
Dr. Mussadiq Abdul Rahim
Week 4: Relational Data Model
A Logical View of Data
• Relational model
• View data logically rather than physically
• Relational database model is easier to understand than hierarchical
and network models
• Logical view of relational database is based on relation
• Relation thought of as a table
Tables and Their Characteristics
• Table: two-dimensional structure composed of rows and columns
• Persistent representation of logical relation
• Table
• Structural and data independence
• Resembles a file conceptually
• Contains group of related entities (entity set)
Characteristics of a Relational Table
Table Example
Student Classification
Keys
• In the relational model, keys are important because they are used to
ensure that each row in a table is uniquely identifiable.
• They are also used to establish relationships among tables and to
ensure the integrity of the data.
• A key consists of one or more attributes that determine other
attributes.
• For example, an invoice number identifies all of the invoice attributes,
such as the invoice date and the customer name.
Keys
• Each row in a table must be uniquely identifiable
• Key: one or more attributes that determine other attributes
• Key’s role is based on determination
• If you know the value of attribute A, you can determine the value of attribute B
• Functional dependence
• Attribute B is functionally dependent on A if all rows in table that agree in value for A
also agree in value for B
Types of Keys
• Super key
• An attribute or combination of attributes that uniquely identifies each row in a table
• Candidate key
• A minimal (irreducible) super key; a super key that does not contain a subset of
attributes that is itself a super key
• Primary key (PK)
• A candidate key selected to uniquely identify all other attribute values in any given
row; cannot contain null entries.
• Foreign key (FK)
• An attribute or combination of attributes in one table whose values must either
match the primary key in another table or be null.
Types of Keys
• Referential integrity
• FK contains a value that refers to an existing valid tuple (row) in another
relation
• Secondary key
• Key used strictly for data retrieval purposes
Types of Keys
• Entity integrity
• Each row (entity instance) in the table has its own unique identity
• Nulls
• No data entry
• Not permitted in primary key
• Should be avoided in other attributes
Types of Keys
• Can represent:
• An unknown attribute value
• A known, but missing, attribute value
• A “not applicable” condition
• Can create problems when functions such as COUNT, AVERAGE, and
SUM are used
• Can create logical problems when relational tables are linked
Types of Keys
• Controlled redundancy
• Makes the relational database work
• Tables within the database share common attributes
• Enables tables to be linked together
• Multiple occurrences of values not redundant when required to make the
relationship work
• Redundancy exists only when there is unnecessary duplication of attribute
values
Relational Database Keys
Relational Database Example
Relationships within the Relational Database
• 1:M relationship
• Relational modeling ideal
• Should be the norm in any relational database design
• 1:1 relationship
• Should be rare in any relational database design
• M:N relationships
• Cannot be implemented as such in the relational model
• M:N relationships can be changed into 1:M relationships
The 1:M Relationship
• Relational database norm
• Found in any database environment
1:M Relationship Example
The 1:1 Relationship
• One entity related to only one other entity, and vice versa
• Sometimes means that entity components were not defined properly
• Could indicate that two entities actually belong in the same table
• Certain conditions absolutely require their use
1:1 Relationship Example
The M:N Relationship
• Implemented by breaking it up to produce a set of 1:M relationships
• Avoid problems inherent to M:N relationship by creating a composite
entity
• Includes as foreign keys the primary keys of tables to be linked
M:N Relationship Example
M:N Relationship to 1:M Example
M:N Relationship to 1:M Example

More Related Content

Similar to Relational Data Model.pptx

Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03
Jotham Gadot
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
khoahuy82
 

Similar to Relational Data Model.pptx (20)

Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03Fundamentals of Database ppt ch03
Fundamentals of Database ppt ch03
 
ch2-slide Data Models.pptx
ch2-slide Data Models.pptxch2-slide Data Models.pptx
ch2-slide Data Models.pptx
 
Geek Sync | Data Integrity Demystified - Deborah Melkin | IDERA
Geek Sync | Data Integrity Demystified - Deborah Melkin | IDERAGeek Sync | Data Integrity Demystified - Deborah Melkin | IDERA
Geek Sync | Data Integrity Demystified - Deborah Melkin | IDERA
 
Advance database system(part 5)
Advance database system(part 5)Advance database system(part 5)
Advance database system(part 5)
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Relational model
Relational modelRelational model
Relational model
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
DBMS:Relational Modal
DBMS:Relational ModalDBMS:Relational Modal
DBMS:Relational Modal
 
Relational database (Unit 2)
Relational database (Unit 2)Relational database (Unit 2)
Relational database (Unit 2)
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
 
ER diagram
ER diagramER diagram
ER diagram
 
Database management book slides.ppt
Database management book slides.pptDatabase management book slides.ppt
Database management book slides.ppt
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
 
Four Types of Data Models
Four Types of Data ModelsFour Types of Data Models
Four Types of Data Models
 

Recently uploaded

一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
q6pzkpark
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
23050636
 
bams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptxbams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptx
JocylDuran
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Stephen266013
 
sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444
saurabvyas476
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh +966572737505 get cytotec
 

Recently uploaded (20)

Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
jll-asia-pacific-capital-tracker-1q24.pdf
jll-asia-pacific-capital-tracker-1q24.pdfjll-asia-pacific-capital-tracker-1q24.pdf
jll-asia-pacific-capital-tracker-1q24.pdf
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
 
bams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptxbams-3rd-case-presentation-scabies-12-05-2020.pptx
bams-3rd-case-presentation-scabies-12-05-2020.pptx
 
Solution manual for managerial accounting 8th edition by john wild ken shaw b...
Solution manual for managerial accounting 8th edition by john wild ken shaw b...Solution manual for managerial accounting 8th edition by john wild ken shaw b...
Solution manual for managerial accounting 8th edition by john wild ken shaw b...
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
 
Introduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxIntroduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptx
 
sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444sourabh vyas1222222222222222222244444444
sourabh vyas1222222222222222222244444444
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
 

Relational Data Model.pptx

  • 2. Week 4: Relational Data Model
  • 3. A Logical View of Data • Relational model • View data logically rather than physically • Relational database model is easier to understand than hierarchical and network models • Logical view of relational database is based on relation • Relation thought of as a table
  • 4. Tables and Their Characteristics • Table: two-dimensional structure composed of rows and columns • Persistent representation of logical relation • Table • Structural and data independence • Resembles a file conceptually • Contains group of related entities (entity set)
  • 5. Characteristics of a Relational Table
  • 8. Keys • In the relational model, keys are important because they are used to ensure that each row in a table is uniquely identifiable. • They are also used to establish relationships among tables and to ensure the integrity of the data. • A key consists of one or more attributes that determine other attributes. • For example, an invoice number identifies all of the invoice attributes, such as the invoice date and the customer name.
  • 9. Keys • Each row in a table must be uniquely identifiable • Key: one or more attributes that determine other attributes • Key’s role is based on determination • If you know the value of attribute A, you can determine the value of attribute B • Functional dependence • Attribute B is functionally dependent on A if all rows in table that agree in value for A also agree in value for B
  • 10. Types of Keys • Super key • An attribute or combination of attributes that uniquely identifies each row in a table • Candidate key • A minimal (irreducible) super key; a super key that does not contain a subset of attributes that is itself a super key • Primary key (PK) • A candidate key selected to uniquely identify all other attribute values in any given row; cannot contain null entries. • Foreign key (FK) • An attribute or combination of attributes in one table whose values must either match the primary key in another table or be null.
  • 11. Types of Keys • Referential integrity • FK contains a value that refers to an existing valid tuple (row) in another relation • Secondary key • Key used strictly for data retrieval purposes
  • 12. Types of Keys • Entity integrity • Each row (entity instance) in the table has its own unique identity • Nulls • No data entry • Not permitted in primary key • Should be avoided in other attributes
  • 13. Types of Keys • Can represent: • An unknown attribute value • A known, but missing, attribute value • A “not applicable” condition • Can create problems when functions such as COUNT, AVERAGE, and SUM are used • Can create logical problems when relational tables are linked
  • 14. Types of Keys • Controlled redundancy • Makes the relational database work • Tables within the database share common attributes • Enables tables to be linked together • Multiple occurrences of values not redundant when required to make the relationship work • Redundancy exists only when there is unnecessary duplication of attribute values
  • 17. Relationships within the Relational Database • 1:M relationship • Relational modeling ideal • Should be the norm in any relational database design • 1:1 relationship • Should be rare in any relational database design • M:N relationships • Cannot be implemented as such in the relational model • M:N relationships can be changed into 1:M relationships
  • 18. The 1:M Relationship • Relational database norm • Found in any database environment
  • 20. The 1:1 Relationship • One entity related to only one other entity, and vice versa • Sometimes means that entity components were not defined properly • Could indicate that two entities actually belong in the same table • Certain conditions absolutely require their use
  • 22. The M:N Relationship • Implemented by breaking it up to produce a set of 1:M relationships • Avoid problems inherent to M:N relationship by creating a composite entity • Includes as foreign keys the primary keys of tables to be linked
  • 24. M:N Relationship to 1:M Example
  • 25. M:N Relationship to 1:M Example