SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Module II: Relational
Database & ER Model
Contents
Relational System, Codd’s Rule, Relational
 Model, Optimization, Tables and Views,
 Entity, Types of Entity, Weak Entity Attributes
 , Entity sets , Entity – Relationship Diagrams.
Relational Model Concepts
• The relational Model of Data is based on the
  concept of a Relation.

• A Relation is a mathematical concept based
  on the ideas of sets.

• The strength of the relational approach to
  data management comes from the formal
  foundation provided by the theory of relations.
INFORMAL DEFINITIONS
• RELATION: A table of values

   – A relation may be thought of as a set of rows.
   – A relation may alternately be though of as a set of columns.
   – Each row represents a fact that corresponds to a real-world
     entity or relationship.
   – Each row has a value of an item or set of items that uniquely
     identifies that row in the table.
   – Sometimes row-ids or sequential numbers are assigned to
     identify the rows in the table.
   – Each column typically is called by its column name or column
     header or attribute name.
FORMAL DEFINITIONS
• A Relation may be defined in multiple ways.
• The Schema of a Relation: R (A1, A2, .....An)
  Relation schema R is defined over attributes A1,
  A2, .....An
  For Example -
      CUSTOMER (Cust-id, Cust-name, Address,
  Phone#)

  Here, CUSTOMER is a relation defined over the four
  attributes Cust-id, Cust-name, Address, Phone#, each
  of which has a domain or a set of valid values. For
  example, the domain of Cust-id is 6 digit numbers.
Example -
Typical DBMS Functionality
• Define a database : in terms of data types,
  structures and constraints
• Construct or Load the Database on a
  secondary storage medium
• Manipulating the database : querying,
  generating reports, insertions, deletions
  and modifications to its content
• Concurrent Processing and Sharing by a
  set of users and programs – yet, keeping all
  data valid and consistent
CODD’S RULES

1 Information Rule
2 Guaranteed Access Rule
3 Systematic Treatment of Nulls Rule
4 Active On-line catalog based on the relational model
5 Comprehensive Data Sub-language Rule
6 View Updating Rule
7 High-Level Insert, Update and Delete
8 Physical Data Independence
9 Logical Data Independence
10 Integrity Independence
11 Distribution Independence
12 No subversion Rule
Definitions
• An entity is an object in the miniworld.
• An attribute of an entity can have a value
  from a value set (domain)
• Each entity belongs to some one entity
  type s.t. entities in one entity type have the
  same attributes (so each entity type is a
  set of similar entities).
Definitions (con’t)
• A key attribute of an entity type is one
  whose value uniquely identifies an entity
  of that type.
• A combination of attributes may form a
  composite key.
• If there is no applicable value for an
  attribute that attribute is set to a null value.
Entity Type / Entity Set

Entity Type (Intension):      EMPLOYEE
Attributes:                   Name, Age, Salary

Entity Set (Extension):    e1 = (John Smith, 55, 80000)
                           e2 = (Joe Doe, 40, 20000)
                           e3 = (Jane Doe, 27, 30000)
                                          .
                                          .
                                          .
Attributes
• Attributes can be
  – composite / simple (atomic)
  – single-valued / multivalued
  – stored / derived
  – key / nonkey.
EMPLOYEE
    Name, SSN, Sex, Address, Salary, Birthdate, Department,
    Supervisor, {Works on ( Project, Hours)}


                       WORKS_FOR
                 N                         1
Name SSN . . .


         EMPLOYEE                      DEPARTMENT




          Relationship instances of WORKS_FOR:
                 {(KV, CS), (Pan, EE), . . .}
ER Diagram for COMPANY Database
Relationship Type
• A relationship type R among n entity types
  E1,…,En is a set of relationship instances
  ri, where each ri associates n entities (e1,
  …,en), s.t. each ej ∈ Ej. Informally, a
  relationship instance is an association of
  entities, with exactly one entity from each
  participating entity type.
Relationship Type (con’t)
• The degree n of a relationship type is the
  number of participating entity types.
• In the ER model relationships are
  explicitly represented.
Entity Roles
• Each entity type in a relationship type
  plays a particular role that is described by
  a role name. Role names are especially
  important in recursive relationship types
  where the same entity participates in
  more than one role:
                          Employee
         Supervisor   1                 N   Supervisee

                          Supervision
Weak Entity Type
• A weak entity type is one without any key
  attributes of its own. Entities belonging to
  a weak entity type are identified by being
  related to another entity type ( called
  identifying owner) through a relationship
  type ( called identifying relationship), in
  combination with values of a set of its own
  attributes (called partial key). A weak entity
  type has total participation constraint w.r.t.
  its identifying relationship.
Relationship Attributes
• Relationship types can have attributes as
  well. in case of 1:1 or 1:N relationships,
  attributes can be migrated to one of the
  participating entity types.
Structural Constraints
• Structural constraints of a relationship
  type:
  – Cardinality ratio: Limits the number of
    relationship instances an entity can participate
    in, eg. 1:1, 1:N, M:N
  – Participation constraint:       If each entity of
    an entity type is required to participate in
    some instance of a relationship type, then that
    participation is total; otherwise, it is partial.
Structural Constraint Min, Max
• A more complete specification of the
  structural constraint on a relationship type
  can be given by the integer pair (min,
  max), which means an entity must
  participate in at least min and at most max
  relationship instances.
A ternary relationship generally represents
more information than 3 binary relationships

Weitere ähnliche Inhalte

Was ist angesagt?

The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship modelyash patel
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship modelJane Garay
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramSiti Ismail
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in DatabaseFatiha Qureshi
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship ModellingBhandari Nawaraj
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
Data Modeling and Database Design 2nd Edition by Umanath Scamell Solution Manual
Data Modeling and Database Design 2nd Edition by Umanath Scamell Solution ManualData Modeling and Database Design 2nd Edition by Umanath Scamell Solution Manual
Data Modeling and Database Design 2nd Edition by Umanath Scamell Solution Manualendokayle
 

Was ist angesagt? (19)

The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
1869495 er diagrams
1869495 er diagrams1869495 er diagrams
1869495 er diagrams
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
E R Diagram
E R DiagramE R Diagram
E R Diagram
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Database design
Database designDatabase design
Database design
 
Er diagram
Er diagramEr diagram
Er diagram
 
enhanced er diagram
enhanced er diagramenhanced er diagram
enhanced er diagram
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in Database
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
Erm
ErmErm
Erm
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Er model
Er modelEr model
Er model
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Data Modeling and Database Design 2nd Edition by Umanath Scamell Solution Manual
Data Modeling and Database Design 2nd Edition by Umanath Scamell Solution ManualData Modeling and Database Design 2nd Edition by Umanath Scamell Solution Manual
Data Modeling and Database Design 2nd Edition by Umanath Scamell Solution Manual
 
ER MODEL
ER MODELER MODEL
ER MODEL
 

Andere mochten auch (18)

VISUAL BASIC
VISUAL BASIC VISUAL BASIC
VISUAL BASIC
 
Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentals
 
SIMPLE SORTING MUKUND
SIMPLE SORTING MUKUNDSIMPLE SORTING MUKUND
SIMPLE SORTING MUKUND
 
Pc presentation
Pc presentationPc presentation
Pc presentation
 
C96e1 session3 c++
C96e1 session3 c++C96e1 session3 c++
C96e1 session3 c++
 
File management
File managementFile management
File management
 
F6dc1 session6 c++
F6dc1 session6 c++F6dc1 session6 c++
F6dc1 session6 c++
 
Ff40fnatural resources (1)
Ff40fnatural resources (1)Ff40fnatural resources (1)
Ff40fnatural resources (1)
 
Operating systems
Operating systemsOperating systems
Operating systems
 
73d32 session1 c++
73d32 session1 c++73d32 session1 c++
73d32 session1 c++
 
106da session5 c++
106da session5 c++106da session5 c++
106da session5 c++
 
9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2
 
C
CC
C
 
9b4c1 vb(pd) (2)
9b4c1 vb(pd) (2)9b4c1 vb(pd) (2)
9b4c1 vb(pd) (2)
 
Process of design
Process of designProcess of design
Process of design
 
MS WORD
MS WORDMS WORD
MS WORD
 
Sad
SadSad
Sad
 
Ponters
PontersPonters
Ponters
 

Ähnlich wie 39f1b9a797dbms chapter2 b.sc2 (1)

Ähnlich wie 39f1b9a797dbms chapter2 b.sc2 (1) (20)

entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
Entityrelationshipmodel
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data Model
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
Database design
Database designDatabase design
Database design
 
chapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfchapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdf
 
Conceptual Data Modeling
Conceptual Data ModelingConceptual Data Modeling
Conceptual Data Modeling
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
 
lecture2.pdf
lecture2.pdflecture2.pdf
lecture2.pdf
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 

Mehr von Mukund Trivedi

Mehr von Mukund Trivedi (20)

System development life cycle (sdlc)
System development life cycle (sdlc)System development life cycle (sdlc)
System development life cycle (sdlc)
 
New file and form 2
New file and form 2New file and form 2
New file and form 2
 
File organisation
File organisationFile organisation
File organisation
 
Evaluation
EvaluationEvaluation
Evaluation
 
Database
DatabaseDatabase
Database
 
Case tools
Case toolsCase tools
Case tools
 
Evaluation
EvaluationEvaluation
Evaluation
 
Dfd final
Dfd finalDfd final
Dfd final
 
C++ file
C++ fileC++ file
C++ file
 
Ff40fnatural resources
Ff40fnatural resourcesFf40fnatural resources
Ff40fnatural resources
 
F58fbnatural resources 2 (1)
F58fbnatural resources 2 (1)F58fbnatural resources 2 (1)
F58fbnatural resources 2 (1)
 
F58fbnatural resources 2
F58fbnatural resources 2F58fbnatural resources 2
F58fbnatural resources 2
 
Ee2fbunit 7
Ee2fbunit 7Ee2fbunit 7
Ee2fbunit 7
 
E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
 
B1ce9 assignmentbsc
B1ce9 assignmentbscB1ce9 assignmentbsc
B1ce9 assignmentbsc
 
Af7ff syllabuslablist
Af7ff syllabuslablistAf7ff syllabuslablist
Af7ff syllabuslablist
 
098ca session7 c++
098ca session7 c++098ca session7 c++
098ca session7 c++
 
85ec7 session2 c++
85ec7 session2 c++85ec7 session2 c++
85ec7 session2 c++
 

Kürzlich hochgeladen

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Kürzlich hochgeladen (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

39f1b9a797dbms chapter2 b.sc2 (1)

  • 2. Contents Relational System, Codd’s Rule, Relational Model, Optimization, Tables and Views, Entity, Types of Entity, Weak Entity Attributes , Entity sets , Entity – Relationship Diagrams.
  • 3. Relational Model Concepts • The relational Model of Data is based on the concept of a Relation. • A Relation is a mathematical concept based on the ideas of sets. • The strength of the relational approach to data management comes from the formal foundation provided by the theory of relations.
  • 4. INFORMAL DEFINITIONS • RELATION: A table of values – A relation may be thought of as a set of rows. – A relation may alternately be though of as a set of columns. – Each row represents a fact that corresponds to a real-world entity or relationship. – Each row has a value of an item or set of items that uniquely identifies that row in the table. – Sometimes row-ids or sequential numbers are assigned to identify the rows in the table. – Each column typically is called by its column name or column header or attribute name.
  • 5. FORMAL DEFINITIONS • A Relation may be defined in multiple ways. • The Schema of a Relation: R (A1, A2, .....An) Relation schema R is defined over attributes A1, A2, .....An For Example - CUSTOMER (Cust-id, Cust-name, Address, Phone#) Here, CUSTOMER is a relation defined over the four attributes Cust-id, Cust-name, Address, Phone#, each of which has a domain or a set of valid values. For example, the domain of Cust-id is 6 digit numbers.
  • 7. Typical DBMS Functionality • Define a database : in terms of data types, structures and constraints • Construct or Load the Database on a secondary storage medium • Manipulating the database : querying, generating reports, insertions, deletions and modifications to its content • Concurrent Processing and Sharing by a set of users and programs – yet, keeping all data valid and consistent
  • 8. CODD’S RULES 1 Information Rule 2 Guaranteed Access Rule 3 Systematic Treatment of Nulls Rule 4 Active On-line catalog based on the relational model 5 Comprehensive Data Sub-language Rule 6 View Updating Rule 7 High-Level Insert, Update and Delete 8 Physical Data Independence 9 Logical Data Independence 10 Integrity Independence 11 Distribution Independence 12 No subversion Rule
  • 9. Definitions • An entity is an object in the miniworld. • An attribute of an entity can have a value from a value set (domain) • Each entity belongs to some one entity type s.t. entities in one entity type have the same attributes (so each entity type is a set of similar entities).
  • 10. Definitions (con’t) • A key attribute of an entity type is one whose value uniquely identifies an entity of that type. • A combination of attributes may form a composite key. • If there is no applicable value for an attribute that attribute is set to a null value.
  • 11. Entity Type / Entity Set Entity Type (Intension): EMPLOYEE Attributes: Name, Age, Salary Entity Set (Extension): e1 = (John Smith, 55, 80000) e2 = (Joe Doe, 40, 20000) e3 = (Jane Doe, 27, 30000) . . .
  • 12. Attributes • Attributes can be – composite / simple (atomic) – single-valued / multivalued – stored / derived – key / nonkey.
  • 13.
  • 14. EMPLOYEE Name, SSN, Sex, Address, Salary, Birthdate, Department, Supervisor, {Works on ( Project, Hours)} WORKS_FOR N 1 Name SSN . . . EMPLOYEE DEPARTMENT Relationship instances of WORKS_FOR: {(KV, CS), (Pan, EE), . . .}
  • 15. ER Diagram for COMPANY Database
  • 16. Relationship Type • A relationship type R among n entity types E1,…,En is a set of relationship instances ri, where each ri associates n entities (e1, …,en), s.t. each ej ∈ Ej. Informally, a relationship instance is an association of entities, with exactly one entity from each participating entity type.
  • 17. Relationship Type (con’t) • The degree n of a relationship type is the number of participating entity types. • In the ER model relationships are explicitly represented.
  • 18. Entity Roles • Each entity type in a relationship type plays a particular role that is described by a role name. Role names are especially important in recursive relationship types where the same entity participates in more than one role: Employee Supervisor 1 N Supervisee Supervision
  • 19. Weak Entity Type • A weak entity type is one without any key attributes of its own. Entities belonging to a weak entity type are identified by being related to another entity type ( called identifying owner) through a relationship type ( called identifying relationship), in combination with values of a set of its own attributes (called partial key). A weak entity type has total participation constraint w.r.t. its identifying relationship.
  • 20. Relationship Attributes • Relationship types can have attributes as well. in case of 1:1 or 1:N relationships, attributes can be migrated to one of the participating entity types.
  • 21. Structural Constraints • Structural constraints of a relationship type: – Cardinality ratio: Limits the number of relationship instances an entity can participate in, eg. 1:1, 1:N, M:N – Participation constraint: If each entity of an entity type is required to participate in some instance of a relationship type, then that participation is total; otherwise, it is partial.
  • 22. Structural Constraint Min, Max • A more complete specification of the structural constraint on a relationship type can be given by the integer pair (min, max), which means an entity must participate in at least min and at most max relationship instances.
  • 23.
  • 24. A ternary relationship generally represents more information than 3 binary relationships

Hinweis der Redaktion

  1. Point out that each e are entity
  2. Point out what each item is
  3. Prepare a discussion