SlideShare a Scribd company logo
Relational
Model
Chapter 3 - Objectives
• Terminology of relational model.
• How tables are used to represent data.
• Connection between mathematical relations
and relations in the relational model.
• Properties of database relations.
• How to identify candidate, primary, and foreign
keys.
• Meaning of entity integrity and referential
integrity.
• Purpose and advantages of views.
2
Relational Model Terminology
• A relation is a table with columns and rows.
– Only applies to logical structure of the database, not
the physical structure.
• Attribute is a named column of a relation.
• Domain is the set of allowable values for one or
more attributes.
3
Relational Model Terminology
• Tuple is a row of a relation.
• Degree is the number of attributes in a relation.
• Cardinality is the number of tuples in a relation.
• Relational Database is a collection of normalized
relations with distinct relation names.
4
Instances of Branch and Staff (part)
Relations
5
Examples of Attribute Domains
6
Alternative Terminology for Relational
Model
7
Database Relations
• Relation schema
– Named relation defined by a set of attribute
and domain name pairs.
• Relational database schema
– Set of relation schemas, each with a distinct
name.
8
Properties of Relations
• Relation name is distinct from all other relation
names in relational schema.
• Each cell of relation contains exactly one atomic
(single) value.
• Each attribute has a distinct name.
• Values of an attribute are all from the same
domain.
9
Properties of Relations
• Each tuple is distinct; there are no duplicate
tuples.
• Order of attributes has no significance.
• Order of tuples has no significance,
theoretically.
10
Relational Keys
• Superkey
– An attribute, or a set of attributes, that uniquely
identifies a tuple within a relation.
• Candidate Key
– Superkey (K) such that no proper subset is a superkey
within the relation.
– In each tuple of R, values of K uniquely identify that tuple
(uniqueness).
– No proper subset of K has the uniqueness property
(irreducibility).
11
Relational Keys
• Primary Key
• Candidate key selected to identify tuples
uniquely within relation.
• Alternate Keys
• Candidate keys that are not selected to be
primary key.
• Foreign Key
• Attribute, or set of attributes, within one
relation that matches candidate key of some
(possibly same) relation.
12
Relational Integrity
• Null
– Represents value for an attribute that is
currently unknown or not applicable for tuple.
– Deals with incomplete or exceptional data.
– Represents the absence of a value and is not the
same as zero or spaces, which are values.
13
Relational Integrity
• Entity Integrity
– In a base relation, no attribute of a primary key can
be null.
• Referential Integrity
– If foreign key exists in a relation, either foreign key
value must match a candidate key value of some
tuple in its home relation or foreign key value must
be wholly null.
14
Relational Integrity
• Enterprise Constraints
– Additional rules specified by users or
database administrators.
15
Views
• Base Relation
– Named relation corresponding to an entity in
conceptual schema, whose tuples are physically
stored in database.
• View
– Dynamic result of one or more relational operations
operating on base relations to produce another
relation.
16
Views
• A virtual relation that does not necessarily
actually exist in the database but is produced
upon request, at time of request.
• Contents of a view are defined as a query on one
or more base relations.
• Views are dynamic, meaning that changes made
to base relations that affect view attributes are
immediately reflected in the view.
17
Purpose of Views
• Provides powerful and flexible security
mechanism by hiding parts of database from
certain users.
• Permits users to access data in a customized
way, so that same data can be seen by different
users in different ways, at same time.
• Can simplify complex operations on base
relations.
18
Updating Views
• All updates to a base relation should be
immediately reflected in all views that
reference that base relation.
• If view is updated, underlying base
relation should reflect change.
19
Updating Views
• There are restrictions on types of modifications
that can be made through views:
- Updates are allowed if query involves a single base
relation and contains a candidate key of base
relation.
- Updates are not allowed involving multiple base
relations.
- Updates are not allowed involving aggregation or
grouping operations.
20

More Related Content

What's hot

ER-MODEL WITH DBMS.pptx
ER-MODEL WITH DBMS.pptxER-MODEL WITH DBMS.pptx
ER-MODEL WITH DBMS.pptx
Komal Komal
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
Kunal Anand
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
Bhandari Nawaraj
 
Object persistence
Object persistenceObject persistence
Object persistenceVlad Vega
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
DBMS Bascis
DBMS BascisDBMS Bascis
Database Systems Concepts, 5th Ed
Database Systems Concepts, 5th EdDatabase Systems Concepts, 5th Ed
Database Systems Concepts, 5th Ed
Daniel Francisco Tamayo
 
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
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
Dhani Ahmad
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
Ram Kedem
 
Unidad 3 Modelamiento De Datos Conceptual
Unidad 3 Modelamiento De Datos ConceptualUnidad 3 Modelamiento De Datos Conceptual
Unidad 3 Modelamiento De Datos Conceptual
Sergio Sanchez
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Rakhi Mukherji
 
Database and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health InformaticsDatabase and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health Informatics
Zulfiquer Ahmed Amin
 
Data Warehouse Design Considerations
Data Warehouse Design ConsiderationsData Warehouse Design Considerations
Data Warehouse Design Considerations
Ram Kedem
 
El modelo relacional
El modelo relacionalEl modelo relacional
El modelo relacionalLuis Jherry
 
The relational database model
The relational database modelThe relational database model
The relational database model
Dhani Ahmad
 
12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt
12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt
12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt
venkatapranaykumarGa
 
Normalization
NormalizationNormalization
Normalization
Wangu Thupa
 
Diferencias entre base de datos relacional y no relacional
Diferencias entre base de datos relacional y no relacionalDiferencias entre base de datos relacional y no relacional
Diferencias entre base de datos relacional y no relacional
UPCI
 

What's hot (20)

ER-MODEL WITH DBMS.pptx
ER-MODEL WITH DBMS.pptxER-MODEL WITH DBMS.pptx
ER-MODEL WITH DBMS.pptx
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Object persistence
Object persistenceObject persistence
Object persistence
 
Relational model
Relational modelRelational model
Relational model
 
DBMS Bascis
DBMS BascisDBMS Bascis
DBMS Bascis
 
Database Systems Concepts, 5th Ed
Database Systems Concepts, 5th EdDatabase Systems Concepts, 5th Ed
Database Systems Concepts, 5th Ed
 
Data models
Data modelsData models
Data models
 
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)
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Unidad 3 Modelamiento De Datos Conceptual
Unidad 3 Modelamiento De Datos ConceptualUnidad 3 Modelamiento De Datos Conceptual
Unidad 3 Modelamiento De Datos Conceptual
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Database and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health InformaticsDatabase and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health Informatics
 
Data Warehouse Design Considerations
Data Warehouse Design ConsiderationsData Warehouse Design Considerations
Data Warehouse Design Considerations
 
El modelo relacional
El modelo relacionalEl modelo relacional
El modelo relacional
 
The relational database model
The relational database modelThe relational database model
The relational database model
 
12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt
12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt
12-Syntax Directed Definition – Evaluation Order-09-06-2023.ppt
 
Normalization
NormalizationNormalization
Normalization
 
Diferencias entre base de datos relacional y no relacional
Diferencias entre base de datos relacional y no relacionalDiferencias entre base de datos relacional y no relacional
Diferencias entre base de datos relacional y no relacional
 

Similar to Relational model

database-model group presentation.pptx
database-model group   presentation.pptxdatabase-model group   presentation.pptx
database-model group presentation.pptx
RuksanKarki
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
Rajeev Srivastava
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Jotham Gadot
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
MaryJoseph79
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modeling
Dhani 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.pdf
TamiratDejene1
 
02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04
ams1ams1
 
Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdf
chandiruirene
 
database management system
database management systemdatabase management system
database management system
Nivetha Ganesan
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
Ahmed Magdy
 
Unit 4 Design_a system analysis and design Designing Database.pdf
Unit 4 Design_a system analysis and design  Designing Database.pdfUnit 4 Design_a system analysis and design  Designing Database.pdf
Unit 4 Design_a system analysis and design Designing Database.pdf
SuryaBasnet3
 
relational database
relational databaserelational database
relational database
Surya Swaroop
 
Relational database (Unit 2)
Relational database (Unit 2)Relational database (Unit 2)
Relational database (Unit 2)
Ismail Mukiibi
 
ch2-slide Data Models.pptx
ch2-slide Data Models.pptxch2-slide Data Models.pptx
ch2-slide Data Models.pptx
TamiratDejene1
 
Advanced data modeling
Advanced data modelingAdvanced data modeling
Advanced data modeling
Dhani Ahmad
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
TamiratDejene1
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
IshuIswarya3
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
ThangamaniR3
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 

Similar to Relational model (20)

database-model group presentation.pptx
database-model group   presentation.pptxdatabase-model group   presentation.pptx
database-model group presentation.pptx
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) 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
 
02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04
 
Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdf
 
database management system
database management systemdatabase management system
database management system
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Unit 4 Design_a system analysis and design Designing Database.pdf
Unit 4 Design_a system analysis and design  Designing Database.pdfUnit 4 Design_a system analysis and design  Designing Database.pdf
Unit 4 Design_a system analysis and design Designing Database.pdf
 
relational database
relational databaserelational database
relational database
 
Relational database (Unit 2)
Relational database (Unit 2)Relational database (Unit 2)
Relational database (Unit 2)
 
ch2-slide Data Models.pptx
ch2-slide Data Models.pptxch2-slide Data Models.pptx
ch2-slide Data Models.pptx
 
Advanced data modeling
Advanced data modelingAdvanced data modeling
Advanced data modeling
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
DATA MODELS.pptx
DATA MODELS.pptxDATA MODELS.pptx
DATA MODELS.pptx
 

More from WBUTTUTORIALS

Software testing-and-analysis
Software testing-and-analysisSoftware testing-and-analysis
Software testing-and-analysis
WBUTTUTORIALS
 
Query optimisation
Query optimisationQuery optimisation
Query optimisation
WBUTTUTORIALS
 
Fuzzy logic-introduction
Fuzzy logic-introductionFuzzy logic-introduction
Fuzzy logic-introduction
WBUTTUTORIALS
 
Failure mode-and-effects-analysis
Failure mode-and-effects-analysisFailure mode-and-effects-analysis
Failure mode-and-effects-analysis
WBUTTUTORIALS
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
WBUTTUTORIALS
 
Cost volume-profit-relationships
Cost volume-profit-relationshipsCost volume-profit-relationships
Cost volume-profit-relationships
WBUTTUTORIALS
 
Control unit-implementation
Control unit-implementationControl unit-implementation
Control unit-implementation
WBUTTUTORIALS
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
WBUTTUTORIALS
 
Data communications-concepts
Data communications-conceptsData communications-concepts
Data communications-concepts
WBUTTUTORIALS
 
Ajax workshop
Ajax workshopAjax workshop
Ajax workshop
WBUTTUTORIALS
 
Ajax toolkit-framework
Ajax toolkit-frameworkAjax toolkit-framework
Ajax toolkit-framework
WBUTTUTORIALS
 

More from WBUTTUTORIALS (12)

Software testing-and-analysis
Software testing-and-analysisSoftware testing-and-analysis
Software testing-and-analysis
 
Query optimisation
Query optimisationQuery optimisation
Query optimisation
 
Fuzzy logic-introduction
Fuzzy logic-introductionFuzzy logic-introduction
Fuzzy logic-introduction
 
Failure mode-and-effects-analysis
Failure mode-and-effects-analysisFailure mode-and-effects-analysis
Failure mode-and-effects-analysis
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Cost volume-profit-relationships
Cost volume-profit-relationshipsCost volume-profit-relationships
Cost volume-profit-relationships
 
Control unit-implementation
Control unit-implementationControl unit-implementation
Control unit-implementation
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Data communications-concepts
Data communications-conceptsData communications-concepts
Data communications-concepts
 
Ajax workshop
Ajax workshopAjax workshop
Ajax workshop
 
Ajax toolkit-framework
Ajax toolkit-frameworkAjax toolkit-framework
Ajax toolkit-framework
 
Ajax
AjaxAjax
Ajax
 

Recently uploaded

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

Relational model

  • 2. Chapter 3 - Objectives • Terminology of relational model. • How tables are used to represent data. • Connection between mathematical relations and relations in the relational model. • Properties of database relations. • How to identify candidate, primary, and foreign keys. • Meaning of entity integrity and referential integrity. • Purpose and advantages of views. 2
  • 3. Relational Model Terminology • A relation is a table with columns and rows. – Only applies to logical structure of the database, not the physical structure. • Attribute is a named column of a relation. • Domain is the set of allowable values for one or more attributes. 3
  • 4. Relational Model Terminology • Tuple is a row of a relation. • Degree is the number of attributes in a relation. • Cardinality is the number of tuples in a relation. • Relational Database is a collection of normalized relations with distinct relation names. 4
  • 5. Instances of Branch and Staff (part) Relations 5
  • 7. Alternative Terminology for Relational Model 7
  • 8. Database Relations • Relation schema – Named relation defined by a set of attribute and domain name pairs. • Relational database schema – Set of relation schemas, each with a distinct name. 8
  • 9. Properties of Relations • Relation name is distinct from all other relation names in relational schema. • Each cell of relation contains exactly one atomic (single) value. • Each attribute has a distinct name. • Values of an attribute are all from the same domain. 9
  • 10. Properties of Relations • Each tuple is distinct; there are no duplicate tuples. • Order of attributes has no significance. • Order of tuples has no significance, theoretically. 10
  • 11. Relational Keys • Superkey – An attribute, or a set of attributes, that uniquely identifies a tuple within a relation. • Candidate Key – Superkey (K) such that no proper subset is a superkey within the relation. – In each tuple of R, values of K uniquely identify that tuple (uniqueness). – No proper subset of K has the uniqueness property (irreducibility). 11
  • 12. Relational Keys • Primary Key • Candidate key selected to identify tuples uniquely within relation. • Alternate Keys • Candidate keys that are not selected to be primary key. • Foreign Key • Attribute, or set of attributes, within one relation that matches candidate key of some (possibly same) relation. 12
  • 13. Relational Integrity • Null – Represents value for an attribute that is currently unknown or not applicable for tuple. – Deals with incomplete or exceptional data. – Represents the absence of a value and is not the same as zero or spaces, which are values. 13
  • 14. Relational Integrity • Entity Integrity – In a base relation, no attribute of a primary key can be null. • Referential Integrity – If foreign key exists in a relation, either foreign key value must match a candidate key value of some tuple in its home relation or foreign key value must be wholly null. 14
  • 15. Relational Integrity • Enterprise Constraints – Additional rules specified by users or database administrators. 15
  • 16. Views • Base Relation – Named relation corresponding to an entity in conceptual schema, whose tuples are physically stored in database. • View – Dynamic result of one or more relational operations operating on base relations to produce another relation. 16
  • 17. Views • A virtual relation that does not necessarily actually exist in the database but is produced upon request, at time of request. • Contents of a view are defined as a query on one or more base relations. • Views are dynamic, meaning that changes made to base relations that affect view attributes are immediately reflected in the view. 17
  • 18. Purpose of Views • Provides powerful and flexible security mechanism by hiding parts of database from certain users. • Permits users to access data in a customized way, so that same data can be seen by different users in different ways, at same time. • Can simplify complex operations on base relations. 18
  • 19. Updating Views • All updates to a base relation should be immediately reflected in all views that reference that base relation. • If view is updated, underlying base relation should reflect change. 19
  • 20. Updating Views • There are restrictions on types of modifications that can be made through views: - Updates are allowed if query involves a single base relation and contains a candidate key of base relation. - Updates are not allowed involving multiple base relations. - Updates are not allowed involving aggregation or grouping operations. 20