SlideShare uma empresa Scribd logo
1 de 52
Database Systems:
Design, Implementation, and
Management
Ninth Edition
Chapter 3
The Relational Database Model
Database Systems, 9th Edition 2
Objectives
• In this chapter, students will learn:
– That the relational database model offers a
logical view of data
– About the relational model’s basic component:
relations
– That relations are logical constructs composed
of rows (tuples) and columns (attributes)
– That relations are implemented as tables in a
relational DBMS
Database Systems, 9th Edition 3
Objectives (cont’d.)
– About relational database operators, the data
dictionary, and the system catalog
– How data redundancy is handled in the
relational database model
– Why indexing is important
Database Systems, 9th Edition 4
A Logical View of Data
• Relational model
– View data logically rather than physically
• Table
– Structural and data independence
– Resembles a file conceptually
• Relational database model is easier to
understand than hierarchical and network
models
Database Systems, 9th Edition 5
Tables and Their Characteristics
• Logical view of relational database is based on
relation
– Relation thought of as a table
• Table: two-dimensional structure composed of
rows and columns
– Persistent representation of logical relation
• Contains group of related entities (entity set)
Database Systems, 9th Edition 6
Database Systems, 9th Edition 7
Database Systems, 9th Edition 8
Keys
• Each row in a table must be uniquely
identifiable
• Key is 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
Database Systems, 9th Edition 9
Database Systems, 9th Edition 10
Keys (cont’d.)
• Composite key
– Composed of more than one attribute
• Key attribute
– Any attribute that is part of a key
• Superkey
– Any key that uniquely identifies each row
• Candidate key
– A superkey without unnecessary attributes
Database Systems, 9th Edition 11
Keys (cont’d.)
• Nulls
– No data entry
– Not permitted in primary key
– Should be avoided in other attributes
– Can represent:
• An unknown attribute value
• A known, but missing, attribute value
• A “not applicable” condition
Database Systems, 9th Edition 12
Keys (cont’d.)
• Nulls (cont’d.)
– Can create problems when functions such as
COUNT, AVERAGE, and SUM are used
– Can create logical problems when relational tables
are linked
Database Systems, 9th Edition 13
Keys (cont’d.)
• 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
Database Systems, 9th Edition 14
Database Systems, 9th Edition 15
Database Systems, 9th Edition 16
Keys (cont’d.)
• Foreign key (FK)
– An attribute whose values match primary key
values in the related table
• 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
Database Systems, 9th Edition 17
Database Systems, 9th Edition 18
Integrity Rules
• Many RDBMs enforce integrity rules
automatically
• Safer to ensure that application design
conforms to entity and referential integrity rules
• Designers use flags to avoid nulls
– Flags indicate absence of some value
Database Systems, 9th Edition 19
Database Systems, 9th Edition 20
Database Systems, 9th Edition 21
Relational Set Operators
• Relational algebra
– Defines theoretical way of manipulating table
contents using relational operators
– Use of relational algebra operators on existing
relations produces new relations:
• SELECT • DIFFERENCE
• PROJECT • JOIN
• UNION • PRODUCT
• INTERSECT • DIVIDE
Database Systems, 9th Edition 22
Database Systems, 9th Edition 23
Database Systems, 9th Edition 24
Database Systems, 9th Edition 25
Database Systems, 9th Edition 26
Database Systems, 9th Edition 27
Relational Set Operators (cont’d.)
• Natural Join
– Links tables by selecting rows with common
values in common attribute(s)
• Equijoin
– Links tables on the basis of an equality
condition that compares specified columns
• Theta join
– Any other comparison operator is used
• Outer join
– Matched pairs are retained, and any
unmatched values in other table are left null
Database Systems, 9th Edition 28
Database Systems, 9th Edition 29
Database Systems, 9th Edition 30
Database Systems, 9th Edition 31
Database Systems, 9th Edition 32
The Data Dictionary
and System Catalog
• Data dictionary
– Provides detailed accounting of all tables found
within the user/designer-created database
– Contains (at least) all the attribute names and
characteristics for each table in the system
– Contains metadata: data about data
• System catalog
– Contains metadata
– Detailed system data dictionary that describes all
objects within the database
Database Systems, 9th Edition 33
Database Systems, 9th Edition 34
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
Database Systems, 9th Edition 35
Relationships within the Relational
Database (cont’d.)
• M:N relationships
– Cannot be implemented as such in the relational
model
– M:N relationships can be changed into 1:M
relationships
Database Systems, 9th Edition 36
The 1:M Relationship
• Relational database norm
• Found in any database environment
Database Systems, 9th Edition 37
Database Systems, 9th Edition 38
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
Database Systems, 9th Edition 39
Database Systems, 9th Edition 40
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
Database Systems, 9th Edition 41
Database Systems, 9th Edition 42
Database Systems, 9th Edition 43
Database Systems, 9th Edition 44
Database Systems, 9th Edition 45
Database Systems, 9th Edition 46
Data Redundancy Revisited
• Data redundancy leads to data anomalies
– Can destroy the effectiveness of the database
• Foreign keys
– Control data redundancies by using common
attributes shared by tables
– Crucial to exercising data redundancy control
• Sometimes, data redundancy is necessary
Database Systems, 9th Edition 47
Database Systems, 9th Edition 48
Indexes
• Orderly arrangement to logically access rows
in a table
• Index key
– Index’s reference point
– Points to data location identified by the key
• Unique index
– Index in which the index key can have only one
pointer value (row) associated with it
• Each index is associated with only one table
Database Systems, 9th Edition 49
Database Systems, 9th Edition 50
Codd’s Relational Database Rules
• In 1985, Codd published a list of 12 rules to
define a relational database system
– Products marketed as “relational” that did not
meet minimum relational standards
• Even dominant database vendors do not fully
support all 12 rules
Database Systems, 9th Edition 51
Summary
• Tables are basic building blocks of a
relational database
• Keys are central to the use of relational tables
• Keys define functional dependencies
– Superkey
– Candidate key
– Primary key
– Secondary key
– Foreign key
Summary (cont’d.)
• Each table row must have a primary key that
uniquely identifies all attributes
• Tables are linked by common attributes
• The relational model supports relational algebra
functions
– SELECT, PROJECT, JOIN, INTERSECT
UNION, DIFFERENCE, PRODUCT, DIVIDE
• Good design begins by identifying entities,
attributes, and relationships
– 1:1, 1:M, M:N
Database Systems, 9th Edition 52

Mais conteúdo relacionado

Mais procurados

Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management SystemAjay Jha
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to databaseemailharmeet
 
1 introduction databases and database users
1 introduction databases and database users1 introduction databases and database users
1 introduction databases and database usersKumar
 
Database Presentation
Database PresentationDatabase Presentation
Database Presentationa9oolq8
 
File systems versus a dbms
File systems versus a dbmsFile systems versus a dbms
File systems versus a dbmsRituBhargava7
 
Database systems
Database systemsDatabase systems
Database systemsDhani Ahmad
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Userssontumax
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to DatabaseSiti Ismail
 
Dbms Introduction and Basics
Dbms Introduction and BasicsDbms Introduction and Basics
Dbms Introduction and BasicsSHIKHA GAUTAM
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 
Object Relational Database Management System(ORDBMS)
Object Relational Database Management System(ORDBMS)Object Relational Database Management System(ORDBMS)
Object Relational Database Management System(ORDBMS)Rabin BK
 
Types of Database Models
Types of Database ModelsTypes of Database Models
Types of Database ModelsMurassa Gillani
 
FDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database UsersFDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database UsersHarsh Verdhan Raj
 

Mais procurados (20)

Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
 
1 introduction databases and database users
1 introduction databases and database users1 introduction databases and database users
1 introduction databases and database users
 
Basic DBMS ppt
Basic DBMS pptBasic DBMS ppt
Basic DBMS ppt
 
Database Presentation
Database PresentationDatabase Presentation
Database Presentation
 
File systems versus a dbms
File systems versus a dbmsFile systems versus a dbms
File systems versus a dbms
 
database
databasedatabase
database
 
Database systems
Database systemsDatabase systems
Database systems
 
Database Chapter 3
Database Chapter 3Database Chapter 3
Database Chapter 3
 
Database design
Database designDatabase design
Database design
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Users
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Dbms Introduction and Basics
Dbms Introduction and BasicsDbms Introduction and Basics
Dbms Introduction and Basics
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Object Relational Database Management System(ORDBMS)
Object Relational Database Management System(ORDBMS)Object Relational Database Management System(ORDBMS)
Object Relational Database Management System(ORDBMS)
 
Types of Database Models
Types of Database ModelsTypes of Database Models
Types of Database Models
 
FDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database UsersFDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database Users
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 
Elmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 pptElmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 ppt
 

Destaque

Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemEddyzulham Mahluzydde
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentationsameerraaj
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
introduction to database
 introduction to database introduction to database
introduction to databaseAkif shexi
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Vidyasagar Mundroy
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraintsNikhil Deswal
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersAbdul Rahman Sherzad
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)welcometofacebook
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
 
Database content creation and development
Database content creation and developmentDatabase content creation and development
Database content creation and developmentNAGASHREE C
 

Destaque (11)

Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management System
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
introduction to database
 introduction to database introduction to database
introduction to database
 
Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)Database Systems - Introduction (Chapter 1)
Database Systems - Introduction (Chapter 1)
 
Database Systems Concepts, 5th Ed
Database Systems Concepts, 5th EdDatabase Systems Concepts, 5th Ed
Database Systems Concepts, 5th Ed
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Database content creation and development
Database content creation and developmentDatabase content creation and development
Database content creation and development
 

Semelhante a Fundamentals of Database ppt ch03

Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdfchandiruirene
 
02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04ams1ams1
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modelingDhani Ahmad
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Jotham Gadot
 
02010 ppt ch02
02010 ppt ch0202010 ppt ch02
02010 ppt ch02Hpong Js
 
chapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdfchapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdfAxmedMaxamuud6
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLEDrkhanchanaR
 
Advanced data modeling
Advanced data modelingAdvanced data modeling
Advanced data modelingDhani Ahmad
 
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.pdfTamiratDejene1
 
Mc leod9e ch06 database management systems
Mc leod9e ch06 database management systemsMc leod9e ch06 database management systems
Mc leod9e ch06 database management systemssellyhood
 
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 ManagementAxmedMaxamuudYoonis
 
Relational Database.pptx
Relational Database.pptxRelational Database.pptx
Relational Database.pptxSubhamSarkar64
 
IS740 Chapter 05
IS740 Chapter 05IS740 Chapter 05
IS740 Chapter 05iDocs
 
database management system
database management systemdatabase management system
database management systemNivetha Ganesan
 

Semelhante a Fundamentals of Database ppt ch03 (20)

Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdf
 
02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modeling
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02
 
02010 ppt ch02
02010 ppt ch0202010 ppt ch02
02010 ppt ch02
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
 
Data models
Data modelsData models
Data models
 
chapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdfchapter09-120827115409-phpapp01.pdf
chapter09-120827115409-phpapp01.pdf
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
Advanced data modeling
Advanced data modelingAdvanced data modeling
Advanced data modeling
 
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
 
ITE 101 - Week 7
ITE 101 - Week 7ITE 101 - Week 7
ITE 101 - Week 7
 
Mc leod9e ch06 database management systems
Mc leod9e ch06 database management systemsMc leod9e ch06 database management systems
Mc leod9e ch06 database management systems
 
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
 
Relational Database.pptx
Relational Database.pptxRelational Database.pptx
Relational Database.pptx
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
IS740 Chapter 05
IS740 Chapter 05IS740 Chapter 05
IS740 Chapter 05
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
database management system
database management systemdatabase management system
database management system
 
Relational model
Relational modelRelational model
Relational model
 

Mais de Jotham Gadot

Mais de Jotham Gadot (9)

Research gadot
Research gadotResearch gadot
Research gadot
 
Auto cad manual
Auto cad manualAuto cad manual
Auto cad manual
 
Database using oracle 10g
Database using oracle 10gDatabase using oracle 10g
Database using oracle 10g
 
Case study 2
Case study 2Case study 2
Case study 2
 
Chap01
Chap01Chap01
Chap01
 
C++ beginner's guide ch08
C++ beginner's guide ch08C++ beginner's guide ch08
C++ beginner's guide ch08
 
Chap02
Chap02Chap02
Chap02
 
01 introduction-to-computers
01 introduction-to-computers01 introduction-to-computers
01 introduction-to-computers
 
Opeating system programs
Opeating system programsOpeating system programs
Opeating system programs
 

Último

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Fundamentals of Database ppt ch03

  • 1. Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model
  • 2. Database Systems, 9th Edition 2 Objectives • In this chapter, students will learn: – That the relational database model offers a logical view of data – About the relational model’s basic component: relations – That relations are logical constructs composed of rows (tuples) and columns (attributes) – That relations are implemented as tables in a relational DBMS
  • 3. Database Systems, 9th Edition 3 Objectives (cont’d.) – About relational database operators, the data dictionary, and the system catalog – How data redundancy is handled in the relational database model – Why indexing is important
  • 4. Database Systems, 9th Edition 4 A Logical View of Data • Relational model – View data logically rather than physically • Table – Structural and data independence – Resembles a file conceptually • Relational database model is easier to understand than hierarchical and network models
  • 5. Database Systems, 9th Edition 5 Tables and Their Characteristics • Logical view of relational database is based on relation – Relation thought of as a table • Table: two-dimensional structure composed of rows and columns – Persistent representation of logical relation • Contains group of related entities (entity set)
  • 8. Database Systems, 9th Edition 8 Keys • Each row in a table must be uniquely identifiable • Key is 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. Database Systems, 9th Edition 10 Keys (cont’d.) • Composite key – Composed of more than one attribute • Key attribute – Any attribute that is part of a key • Superkey – Any key that uniquely identifies each row • Candidate key – A superkey without unnecessary attributes
  • 11. Database Systems, 9th Edition 11 Keys (cont’d.) • Nulls – No data entry – Not permitted in primary key – Should be avoided in other attributes – Can represent: • An unknown attribute value • A known, but missing, attribute value • A “not applicable” condition
  • 12. Database Systems, 9th Edition 12 Keys (cont’d.) • Nulls (cont’d.) – Can create problems when functions such as COUNT, AVERAGE, and SUM are used – Can create logical problems when relational tables are linked
  • 13. Database Systems, 9th Edition 13 Keys (cont’d.) • 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
  • 14. Database Systems, 9th Edition 14
  • 15. Database Systems, 9th Edition 15
  • 16. Database Systems, 9th Edition 16 Keys (cont’d.) • Foreign key (FK) – An attribute whose values match primary key values in the related table • 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
  • 17. Database Systems, 9th Edition 17
  • 18. Database Systems, 9th Edition 18 Integrity Rules • Many RDBMs enforce integrity rules automatically • Safer to ensure that application design conforms to entity and referential integrity rules • Designers use flags to avoid nulls – Flags indicate absence of some value
  • 19. Database Systems, 9th Edition 19
  • 20. Database Systems, 9th Edition 20
  • 21. Database Systems, 9th Edition 21 Relational Set Operators • Relational algebra – Defines theoretical way of manipulating table contents using relational operators – Use of relational algebra operators on existing relations produces new relations: • SELECT • DIFFERENCE • PROJECT • JOIN • UNION • PRODUCT • INTERSECT • DIVIDE
  • 22. Database Systems, 9th Edition 22
  • 23. Database Systems, 9th Edition 23
  • 24. Database Systems, 9th Edition 24
  • 25. Database Systems, 9th Edition 25
  • 26. Database Systems, 9th Edition 26
  • 27. Database Systems, 9th Edition 27 Relational Set Operators (cont’d.) • Natural Join – Links tables by selecting rows with common values in common attribute(s) • Equijoin – Links tables on the basis of an equality condition that compares specified columns • Theta join – Any other comparison operator is used • Outer join – Matched pairs are retained, and any unmatched values in other table are left null
  • 28. Database Systems, 9th Edition 28
  • 29. Database Systems, 9th Edition 29
  • 30. Database Systems, 9th Edition 30
  • 31. Database Systems, 9th Edition 31
  • 32. Database Systems, 9th Edition 32 The Data Dictionary and System Catalog • Data dictionary – Provides detailed accounting of all tables found within the user/designer-created database – Contains (at least) all the attribute names and characteristics for each table in the system – Contains metadata: data about data • System catalog – Contains metadata – Detailed system data dictionary that describes all objects within the database
  • 33. Database Systems, 9th Edition 33
  • 34. Database Systems, 9th Edition 34 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
  • 35. Database Systems, 9th Edition 35 Relationships within the Relational Database (cont’d.) • M:N relationships – Cannot be implemented as such in the relational model – M:N relationships can be changed into 1:M relationships
  • 36. Database Systems, 9th Edition 36 The 1:M Relationship • Relational database norm • Found in any database environment
  • 37. Database Systems, 9th Edition 37
  • 38. Database Systems, 9th Edition 38 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
  • 39. Database Systems, 9th Edition 39
  • 40. Database Systems, 9th Edition 40 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
  • 41. Database Systems, 9th Edition 41
  • 42. Database Systems, 9th Edition 42
  • 43. Database Systems, 9th Edition 43
  • 44. Database Systems, 9th Edition 44
  • 45. Database Systems, 9th Edition 45
  • 46. Database Systems, 9th Edition 46 Data Redundancy Revisited • Data redundancy leads to data anomalies – Can destroy the effectiveness of the database • Foreign keys – Control data redundancies by using common attributes shared by tables – Crucial to exercising data redundancy control • Sometimes, data redundancy is necessary
  • 47. Database Systems, 9th Edition 47
  • 48. Database Systems, 9th Edition 48 Indexes • Orderly arrangement to logically access rows in a table • Index key – Index’s reference point – Points to data location identified by the key • Unique index – Index in which the index key can have only one pointer value (row) associated with it • Each index is associated with only one table
  • 49. Database Systems, 9th Edition 49
  • 50. Database Systems, 9th Edition 50 Codd’s Relational Database Rules • In 1985, Codd published a list of 12 rules to define a relational database system – Products marketed as “relational” that did not meet minimum relational standards • Even dominant database vendors do not fully support all 12 rules
  • 51. Database Systems, 9th Edition 51 Summary • Tables are basic building blocks of a relational database • Keys are central to the use of relational tables • Keys define functional dependencies – Superkey – Candidate key – Primary key – Secondary key – Foreign key
  • 52. Summary (cont’d.) • Each table row must have a primary key that uniquely identifies all attributes • Tables are linked by common attributes • The relational model supports relational algebra functions – SELECT, PROJECT, JOIN, INTERSECT UNION, DIFFERENCE, PRODUCT, DIVIDE • Good design begins by identifying entities, attributes, and relationships – 1:1, 1:M, M:N Database Systems, 9th Edition 52