SlideShare a Scribd company logo
1 of 33
Download to read offline
Advance Database Systems
Overview of Data Modeling
Contents
• Data Dictionary
• Relational Schema Diagram
Data Dictionary
• A data dictionary is a collection of descriptions of the data objects or
items in a data model for the benefit of programmers and others who
need to refer to them.
Relational Schema Diagram
• A relational schema diagram is
the skeleton structure that
represents the conceptual
view(transformed ERD) of the
entire database.
• It defines how the data is
organized and how the relations
among them are associated.
• It expresses about the
constraints/checks that are to be
applied on the data.
ERD Reading
Logical Data Modeling/Transformation into
Relations (Tables)
Relation
• Rows or Record or Tuples or
Instances of an ENTITY
• Columns or Fields or Labels or
Attributes in ERD
• Keys (Primary and Foreign Keys)
• Constraints / Restrictions /
Limitations/ Check
Rows or Record or Tuples or Instances of an ENTITY
• A record contains all the information about a single ‘member’ of a
table.
• It is a collection of attributes values.
• Records are also known as tuples.
Relation (Table)
• A relation is a named, two-dimensional table of data. A Table consists of rows
(tuples or records) and columns (attributes or fields)
Requirements for a table to qualify as a relation
• Table must have a Unique Name in same Database
• Primary Key must be assigned; each record must be uniquely identified
• There are no repeating groups: two columns do not store similar information in
the same table
• Every attribute value must be atomic (no multivalued attributes are allowed)
• Every Record in row must store unique values (can’t have two rows with exactly
the same values against all their fields/columns)
• Attributes (columns) in tables must have unique names
• The order of the columns can be irrelevant/un-ordered
• The order of the rows can be irrelevant/un-ordered
Key Fields
• Keys are special fields that serve two main purposes:
• Primary keys are Unique Identifiers of the relation(table) with not
null constraint/check/limitation. Examples include person Cnic
Number. This is how we can guarantee that all rows(tuples/record)
are unique and having some value against the attribute.
• Foreign keys are attribute in a relation (table) of a database that
serves in a child relation (table) connecting parent relation (table) in
the same database.
• Keys can be simple(a single field) or composite(more than one fields)
• Keys usually are used as Indexes to speed up the response to user
queries
(Primary Key)
(Foreign Key)
(Combined, these are a
composite primary key)
Integrity Constraints/Limitations/Check/Restrictions
1) Domain Constraints:
• Allowable values for an Attribute (Data Type of a
Label/Column/Attribute). See Table 5-1 on next slide.
2) Entity Integrity:
• No primary key attribute have null value. All primary key fields must
contain Unique data.
3) Referential Integrity:
• This rule states that any foreign key value(on the relation/table of the many
side) MUST match a primary key value in the relation/table of the one side
in one_to_many type of relationship. (Foreign key may store a null value
but not Primary key)
• For example: Update/Delete/Restrict Rules
• Restrict: don’t allow update or delete of parent side records(P.K) if related
records that exists independent side/child table(F.K)
• Cascade: automatically update or delete dependent side/child table
records(F.K) that relates with the parent side records(P.K)
• Set-to-Null: the foreign key (F.K) in the dependent side set to null if
deleting from the parent side (P.K)
SQL table definitions
Referential
integrity
constraints are
implemented
with foreign key
to primary key
references
Well Structured Relation :
Insertion Anomaly/Irregularity/Inconsistency:
• Suppose that we need to add a new employee to the table shown in
next slide. The primary key for this relation is the combination of
Emp_ID and Course_Title. There fore, to insert a new record, the user
must supply values for both Emp_ID and Course_Title(because
primary key values can not be null or non existent). This is an
anomaly. Because the user should not be able to enter only employee
data without supplying course data.
Example of an Insertion, Deletion & Modification Anomaly/Irregularity/Inconsistency
EMPLOYEE_to_COURSE:
• An EMPLOYEE must studies at least one COURSE. A COURSE must be
studied by one or more than one EMPLOYEE's(MANY_to_MANY type
of Relationship).
EMPLOYEE_to_DEPARTMENT:
• An EMPLOYEE must do his/her job in at most one DEPARTMENT. In a
DEPARTMENT at most one EMPLOYEE must do his/her
job(ONE_to_ONE type of Relationship).
Transforming/Mapping ENTITIES into Relations
(Tables)
• Mapping Regular Entities to Relations
1.Simple Attributes: E-R attributes map directly onto the relation
2.Composite Attributes: Use only their simple, component attributes
3.Multivalued Attribute: Becomes a separate relation with a foreign
key taken from the superior entity.
Mapping a Regular Entity
(a) CUSTOMER entity type with
simple attributes
(b) CUSTOMER Relation
(b) CUSTOMER relation
with address detail
(a) CUSTOMER entity type
with composite attribute
Removing Multivalued Attributes from Tables
a) Table with Repeating Groups:
EMPLOYEE 2 Relation:
Mapping an Entity with a Multivalued Attribute
• Multivalued attribute becomes a separate relation with foreign key
• One–to–Many relationship between original entity and new relation
Mapping Weak Entities into Relation (Tables)
• Becomes a separate relation with a foreign key taken from the
superior entity
Primary Key composed of:
• Primary Key of identifying relation (Strong Entity)
Example of Mapping a Weak Entity
Strong and Weak Entity Type Symbol of
Representation
Transforming/Mapping Unary Relationship into
Relations (Tables)
• One-to-Many–Recursive foreign key in the same relation
• Many-to-Many–Two relations:
• One for the entity type
• One for an associative relation in which the primary key has two
attributes, both taken from the primary key of the entity
• Mapping a unary 1:N relationship
(b) EMPLOYEE relation
with recursive foreign key
(a) EMPLOYEE entity
with unary relationship
Mapping a unary M:N relationship
(a) Bill-of-materials
relationships (M:N):
(b) ITEM and
COMPONENT
relations
Transforming/Mapping Binary Relationship
into Relations (Tables)
• One-to-Many:
• Primary key on the one side becomes a foreign key on the many side.
• Many-to-Many:
• Create a new relation named as Associative/Junction Table with the
primary keys of the two entities as its primary key in Binary Degree of
Relationship.
• One-to-One:
• Primary key on the Strong/Independent side becomes a foreign key
on the Weak/Dependent side.
Transforming/Mapping Ternary Relationship
into Relations (Tables)
• One relation for each entity and one for the Associative entity
• Associative/Junction entity has foreign keys to each entity in the
relationship

More Related Content

What's hot

The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 
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
 
Unit 5 composite datatypes
Unit 5  composite datatypesUnit 5  composite datatypes
Unit 5 composite datatypesDrkhanchanaR
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal waghharshalkwagh999
 
Referential integrity
Referential integrityReferential integrity
Referential integrityJubin Raju
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Eddyzulham Mahluzydde
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - NormalizationMudasir Qazi
 
Sql server ___________session2-data_modeling
Sql server  ___________session2-data_modelingSql server  ___________session2-data_modeling
Sql server ___________session2-data_modelingEhtisham Ali
 
Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)Vidyasagar Mundroy
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
 
Database management system
Database management systemDatabase management system
Database management systemyash patel
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management systememailharmeet
 
Ch 6 Logical D B Design
Ch 6  Logical D B  DesignCh 6  Logical D B  Design
Ch 6 Logical D B Designguest8fdbdd
 
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationLearn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationEduonix Learning Solutions
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraintssontumax
 
Ch 12 O O D B Dvlpt
Ch 12  O O  D B  DvlptCh 12  O O  D B  Dvlpt
Ch 12 O O D B Dvlptguest8fdbdd
 

What's hot (20)

Dbms relational data model and sql queries
Dbms relational data model and sql queries Dbms relational data model and sql queries
Dbms relational data model and sql queries
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
ER diagram
ER diagramER diagram
ER diagram
 
Year 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st TermYear 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st Term
 
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)
 
Unit 5 composite datatypes
Unit 5  composite datatypesUnit 5  composite datatypes
Unit 5 composite datatypes
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
 
Referential integrity
Referential integrityReferential integrity
Referential integrity
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
Sql server ___________session2-data_modeling
Sql server  ___________session2-data_modelingSql server  ___________session2-data_modeling
Sql server ___________session2-data_modeling
 
Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)Database Systems - Relational Data Model (Chapter 2)
Database Systems - Relational Data Model (Chapter 2)
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
 
SQL Constraints
SQL ConstraintsSQL Constraints
SQL Constraints
 
Database management system
Database management systemDatabase management system
Database management system
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 
Ch 6 Logical D B Design
Ch 6  Logical D B  DesignCh 6  Logical D B  Design
Ch 6 Logical D B Design
 
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationLearn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
 
Ch 12 O O D B Dvlpt
Ch 12  O O  D B  DvlptCh 12  O O  D B  Dvlpt
Ch 12 O O D B Dvlpt
 

Similar to Advance database system(part 5)

Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdfCynthiaAdzornu
 
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxAB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxbartholomeocoombs
 
5. relational structure
5. relational structure5. relational structure
5. relational structurekhoahuy82
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).pptIshuIswarya3
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptxThangamaniR3
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012Akshit R Shah
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Database normalization
Database normalizationDatabase normalization
Database normalizationEdward Blurock
 
4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdfLPhct2
 
Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdfchandiruirene
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraintsNikhil Deswal
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Relational model
Relational modelRelational model
Relational modelRUpaliLohar
 
Database Engineering: Part one
Database Engineering: Part oneDatabase Engineering: Part one
Database Engineering: Part oneChristoph Becher
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- FundamentalsMohammed El Hedhly
 

Similar to Advance database system(part 5) (20)

Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdf
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxAB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
 
DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
 
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
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
DB2 on Mainframe
DB2 on MainframeDB2 on Mainframe
DB2 on Mainframe
 
4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf4_RelationalDataModelAndRelationalMapping.pdf
4_RelationalDataModelAndRelationalMapping.pdf
 
Relational databases.pdf
Relational databases.pdfRelational databases.pdf
Relational databases.pdf
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Relational model
Relational modelRelational model
Relational model
 
Database Engineering: Part one
Database Engineering: Part oneDatabase Engineering: Part one
Database Engineering: Part one
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- Fundamentals
 

More from Abdullah Khosa

Chanel and H&M Brand Comparison.pdf
Chanel and H&M Brand Comparison.pdfChanel and H&M Brand Comparison.pdf
Chanel and H&M Brand Comparison.pdfAbdullah Khosa
 
Policy directives of federal government of pakistan for Enterprise Architecture
Policy directives of federal government of pakistan for Enterprise ArchitecturePolicy directives of federal government of pakistan for Enterprise Architecture
Policy directives of federal government of pakistan for Enterprise ArchitectureAbdullah Khosa
 
Face to Face Communication and Text Based Communication in HCI
Face to Face Communication and Text Based Communication in HCIFace to Face Communication and Text Based Communication in HCI
Face to Face Communication and Text Based Communication in HCIAbdullah Khosa
 
Cloud Artificial Intelligence services
Cloud Artificial Intelligence servicesCloud Artificial Intelligence services
Cloud Artificial Intelligence servicesAbdullah Khosa
 
Digital centralization
Digital centralizationDigital centralization
Digital centralizationAbdullah Khosa
 
Diamond water-paradox (A Theory)
Diamond water-paradox (A Theory)Diamond water-paradox (A Theory)
Diamond water-paradox (A Theory)Abdullah Khosa
 
The 5th generation (5G)
The 5th generation (5G)The 5th generation (5G)
The 5th generation (5G)Abdullah Khosa
 
Report of database of list of Pakistan international cricket stadiums
Report of database of list of Pakistan international cricket stadiumsReport of database of list of Pakistan international cricket stadiums
Report of database of list of Pakistan international cricket stadiumsAbdullah Khosa
 
Database of list of Pakistan international cricket stadiums
Database of list of Pakistan international cricket stadiumsDatabase of list of Pakistan international cricket stadiums
Database of list of Pakistan international cricket stadiumsAbdullah Khosa
 
Benefits of Search engine optimization
Benefits of Search engine optimizationBenefits of Search engine optimization
Benefits of Search engine optimizationAbdullah Khosa
 
Physical Database Design & Performance
Physical Database Design & PerformancePhysical Database Design & Performance
Physical Database Design & PerformanceAbdullah Khosa
 
Advanced Normalization
Advanced NormalizationAdvanced Normalization
Advanced NormalizationAbdullah Khosa
 
Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & CalculusAbdullah Khosa
 
Advance database system(part 8)
Advance database system(part 8)Advance database system(part 8)
Advance database system(part 8)Abdullah Khosa
 
Advance database system(part 7)
Advance database system(part 7)Advance database system(part 7)
Advance database system(part 7)Abdullah Khosa
 

More from Abdullah Khosa (20)

Chanel and H&M Brand Comparison.pdf
Chanel and H&M Brand Comparison.pdfChanel and H&M Brand Comparison.pdf
Chanel and H&M Brand Comparison.pdf
 
Mycin presentation
Mycin presentationMycin presentation
Mycin presentation
 
Policy directives of federal government of pakistan for Enterprise Architecture
Policy directives of federal government of pakistan for Enterprise ArchitecturePolicy directives of federal government of pakistan for Enterprise Architecture
Policy directives of federal government of pakistan for Enterprise Architecture
 
Face to Face Communication and Text Based Communication in HCI
Face to Face Communication and Text Based Communication in HCIFace to Face Communication and Text Based Communication in HCI
Face to Face Communication and Text Based Communication in HCI
 
STRATEGIC PAY PLANS
STRATEGIC PAY PLANSSTRATEGIC PAY PLANS
STRATEGIC PAY PLANS
 
AI services in google
AI services in googleAI services in google
AI services in google
 
Cloud Artificial Intelligence services
Cloud Artificial Intelligence servicesCloud Artificial Intelligence services
Cloud Artificial Intelligence services
 
Digital centralization
Digital centralizationDigital centralization
Digital centralization
 
Diamond water-paradox (A Theory)
Diamond water-paradox (A Theory)Diamond water-paradox (A Theory)
Diamond water-paradox (A Theory)
 
The 5th generation (5G)
The 5th generation (5G)The 5th generation (5G)
The 5th generation (5G)
 
Report of database of list of Pakistan international cricket stadiums
Report of database of list of Pakistan international cricket stadiumsReport of database of list of Pakistan international cricket stadiums
Report of database of list of Pakistan international cricket stadiums
 
Database of list of Pakistan international cricket stadiums
Database of list of Pakistan international cricket stadiumsDatabase of list of Pakistan international cricket stadiums
Database of list of Pakistan international cricket stadiums
 
Attitude and behavior
Attitude and behaviorAttitude and behavior
Attitude and behavior
 
Digital signature
Digital signatureDigital signature
Digital signature
 
Benefits of Search engine optimization
Benefits of Search engine optimizationBenefits of Search engine optimization
Benefits of Search engine optimization
 
Physical Database Design & Performance
Physical Database Design & PerformancePhysical Database Design & Performance
Physical Database Design & Performance
 
Advanced Normalization
Advanced NormalizationAdvanced Normalization
Advanced Normalization
 
Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & Calculus
 
Advance database system(part 8)
Advance database system(part 8)Advance database system(part 8)
Advance database system(part 8)
 
Advance database system(part 7)
Advance database system(part 7)Advance database system(part 7)
Advance database system(part 7)
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 

Advance database system(part 5)

  • 2. Contents • Data Dictionary • Relational Schema Diagram
  • 3. Data Dictionary • A data dictionary is a collection of descriptions of the data objects or items in a data model for the benefit of programmers and others who need to refer to them.
  • 4. Relational Schema Diagram • A relational schema diagram is the skeleton structure that represents the conceptual view(transformed ERD) of the entire database. • It defines how the data is organized and how the relations among them are associated. • It expresses about the constraints/checks that are to be applied on the data.
  • 6.
  • 7. Logical Data Modeling/Transformation into Relations (Tables) Relation • Rows or Record or Tuples or Instances of an ENTITY • Columns or Fields or Labels or Attributes in ERD • Keys (Primary and Foreign Keys) • Constraints / Restrictions / Limitations/ Check
  • 8. Rows or Record or Tuples or Instances of an ENTITY • A record contains all the information about a single ‘member’ of a table. • It is a collection of attributes values. • Records are also known as tuples.
  • 9. Relation (Table) • A relation is a named, two-dimensional table of data. A Table consists of rows (tuples or records) and columns (attributes or fields) Requirements for a table to qualify as a relation • Table must have a Unique Name in same Database • Primary Key must be assigned; each record must be uniquely identified • There are no repeating groups: two columns do not store similar information in the same table • Every attribute value must be atomic (no multivalued attributes are allowed) • Every Record in row must store unique values (can’t have two rows with exactly the same values against all their fields/columns) • Attributes (columns) in tables must have unique names • The order of the columns can be irrelevant/un-ordered • The order of the rows can be irrelevant/un-ordered
  • 10. Key Fields • Keys are special fields that serve two main purposes: • Primary keys are Unique Identifiers of the relation(table) with not null constraint/check/limitation. Examples include person Cnic Number. This is how we can guarantee that all rows(tuples/record) are unique and having some value against the attribute. • Foreign keys are attribute in a relation (table) of a database that serves in a child relation (table) connecting parent relation (table) in the same database. • Keys can be simple(a single field) or composite(more than one fields) • Keys usually are used as Indexes to speed up the response to user queries
  • 11. (Primary Key) (Foreign Key) (Combined, these are a composite primary key)
  • 12.
  • 13. Integrity Constraints/Limitations/Check/Restrictions 1) Domain Constraints: • Allowable values for an Attribute (Data Type of a Label/Column/Attribute). See Table 5-1 on next slide. 2) Entity Integrity: • No primary key attribute have null value. All primary key fields must contain Unique data.
  • 14. 3) Referential Integrity: • This rule states that any foreign key value(on the relation/table of the many side) MUST match a primary key value in the relation/table of the one side in one_to_many type of relationship. (Foreign key may store a null value but not Primary key) • For example: Update/Delete/Restrict Rules • Restrict: don’t allow update or delete of parent side records(P.K) if related records that exists independent side/child table(F.K) • Cascade: automatically update or delete dependent side/child table records(F.K) that relates with the parent side records(P.K) • Set-to-Null: the foreign key (F.K) in the dependent side set to null if deleting from the parent side (P.K)
  • 15. SQL table definitions Referential integrity constraints are implemented with foreign key to primary key references
  • 16.
  • 18. Insertion Anomaly/Irregularity/Inconsistency: • Suppose that we need to add a new employee to the table shown in next slide. The primary key for this relation is the combination of Emp_ID and Course_Title. There fore, to insert a new record, the user must supply values for both Emp_ID and Course_Title(because primary key values can not be null or non existent). This is an anomaly. Because the user should not be able to enter only employee data without supplying course data.
  • 19. Example of an Insertion, Deletion & Modification Anomaly/Irregularity/Inconsistency
  • 20. EMPLOYEE_to_COURSE: • An EMPLOYEE must studies at least one COURSE. A COURSE must be studied by one or more than one EMPLOYEE's(MANY_to_MANY type of Relationship).
  • 21. EMPLOYEE_to_DEPARTMENT: • An EMPLOYEE must do his/her job in at most one DEPARTMENT. In a DEPARTMENT at most one EMPLOYEE must do his/her job(ONE_to_ONE type of Relationship).
  • 22.
  • 23. Transforming/Mapping ENTITIES into Relations (Tables) • Mapping Regular Entities to Relations 1.Simple Attributes: E-R attributes map directly onto the relation 2.Composite Attributes: Use only their simple, component attributes 3.Multivalued Attribute: Becomes a separate relation with a foreign key taken from the superior entity. Mapping a Regular Entity (a) CUSTOMER entity type with simple attributes (b) CUSTOMER Relation
  • 24. (b) CUSTOMER relation with address detail (a) CUSTOMER entity type with composite attribute
  • 26. a) Table with Repeating Groups: EMPLOYEE 2 Relation:
  • 27. Mapping an Entity with a Multivalued Attribute • Multivalued attribute becomes a separate relation with foreign key • One–to–Many relationship between original entity and new relation
  • 28. Mapping Weak Entities into Relation (Tables) • Becomes a separate relation with a foreign key taken from the superior entity Primary Key composed of: • Primary Key of identifying relation (Strong Entity) Example of Mapping a Weak Entity
  • 29. Strong and Weak Entity Type Symbol of Representation
  • 30. Transforming/Mapping Unary Relationship into Relations (Tables) • One-to-Many–Recursive foreign key in the same relation • Many-to-Many–Two relations: • One for the entity type • One for an associative relation in which the primary key has two attributes, both taken from the primary key of the entity • Mapping a unary 1:N relationship (b) EMPLOYEE relation with recursive foreign key (a) EMPLOYEE entity with unary relationship
  • 31. Mapping a unary M:N relationship (a) Bill-of-materials relationships (M:N): (b) ITEM and COMPONENT relations
  • 32. Transforming/Mapping Binary Relationship into Relations (Tables) • One-to-Many: • Primary key on the one side becomes a foreign key on the many side. • Many-to-Many: • Create a new relation named as Associative/Junction Table with the primary keys of the two entities as its primary key in Binary Degree of Relationship. • One-to-One: • Primary key on the Strong/Independent side becomes a foreign key on the Weak/Dependent side.
  • 33. Transforming/Mapping Ternary Relationship into Relations (Tables) • One relation for each entity and one for the Associative entity • Associative/Junction entity has foreign keys to each entity in the relationship