SlideShare a Scribd company logo
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

More Related Content

What's hot

Data base management system
Data base management systemData base management system
Data base management systemNavneet Jingar
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Characteristic of dabase approach
Characteristic of dabase approachCharacteristic of dabase approach
Characteristic of dabase approachLuina Pani
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Vijayananda Ratnam Ch
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Jotham Gadot
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Jotham Gadot
 
Lesson 1: Introduction to DBMS
Lesson 1: Introduction to DBMSLesson 1: Introduction to DBMS
Lesson 1: Introduction to DBMSAmrit Kaur
 
Database systems
Database systemsDatabase systems
Database systemsDhani Ahmad
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architectureKumar
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbmssethu pm
 
Database management systems
Database management systemsDatabase management systems
Database management systemsJoel Briza
 

What's hot (20)

Data base management system
Data base management systemData base management system
Data base management system
 
Database concepts
Database conceptsDatabase concepts
Database concepts
 
Data models
Data modelsData models
Data models
 
Data models
Data modelsData models
Data models
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Characteristic of dabase approach
Characteristic of dabase approachCharacteristic of dabase approach
Characteristic of dabase approach
 
Database design
Database designDatabase design
Database design
 
Data Base Management System
Data Base Management SystemData Base Management System
Data Base Management System
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
 
Database systems introduction
Database systems introductionDatabase systems introduction
Database systems introduction
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
 
Elmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 pptElmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 ppt
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02
 
Lesson 1: Introduction to DBMS
Lesson 1: Introduction to DBMSLesson 1: Introduction to DBMS
Lesson 1: Introduction to DBMS
 
Types of databases
Types of databases   Types of databases
Types of databases
 
Database systems
Database systemsDatabase systems
Database systems
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
 
Database management systems
Database management systemsDatabase management systems
Database management systems
 

Viewers also liked

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
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database systemphilipsinter
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentationsameerraaj
 
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
 

Viewers also liked (12)

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
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database system
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
 
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
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 
Database content creation and development
Database content creation and developmentDatabase content creation and development
Database content creation and development
 

Similar to Fundamentals of Database ppt ch03

The relational database model
The relational database modelThe relational database model
The relational database modelDhani Ahmad
 
Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdfchandiruirene
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Jotham Gadot
 
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
 
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
 

Similar to Fundamentals of Database ppt ch03 (20)

The relational database model
The relational database modelThe relational database model
The relational database model
 
Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdf
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04
 
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
 
02010 ppt ch02
02010 ppt ch0202010 ppt ch02
02010 ppt ch02
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
 
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
 

More from Jotham Gadot

More from 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
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfalexjohnson7307
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKUXDXConf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backElena Simperl
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineUXDXConf
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 

Recently uploaded (20)

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at Priceline
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 

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