SlideShare a Scribd company logo
Er. Nawaraj Bhandari
Database Design &
Development
Topic 2 & 3:
Enhancing Design
Logical Design & Conceptual
Design
Some Key Concepts
• Entity integrity
• Referential integrity(Relational Integrity)
• General constraints
• Nulls
Question
• Why cannot any part of a primary key be null?
?
Answer
• Because a null value, being unknown, might be the same as the value in the
primary key of another tuple.
Properties of a Relation
• Relation Named
• Atomic values in cells
• Attribute Named
• Attribute value drawn from a domain
• No duplicate tuples (rows)
• No significance to order of tuples
• No significance to order of attributes
Class Record (Is This a Relation? )
Class Code Instrument Taught Teachers No of Instruments
Rented
2 Saxophone Marcus Smith 10
6 Trumpet Ajay Singh
Sonny Muller
20
7 Guitar Farhad Khan 10
9 Guitar Farhad Khan
Tommy Jones
23
1 Drums Tommy Jones 5
Activity - Is This a Relation?
• It has a name which is unique within the relational schema - Yes
• Each cell of a relation contains exactly one value - No
• Each attribute has a name – YES
• Each tuple is unique - YES
• The order of attributes is insignificant – YES
• The order of tuples is insignificant - YES
Class Record – A Relation
Class Code Instrument Taught Teachers No of Instruments
Rented
2 Saxophone Marcus Smith 10
6 Trumpet Ajay Singh 20
6 Trumpet Sonny Muller 20
7 Guitar Farhad Khan 10
9 Guitar Farhad Khan 23
9 Guitar Tommy Jones 23
1 Drums Tommy Jones 5
Activity - Is This a Relation?
Student Name Modules Course
Guy Smith Med1 Medieval History 1
Med2 Medieval History 2
TCE Twentieth Century
History
Sarah Anusiem
12 New Street, Lagos
OS Operating Systems
NET Networks
Computing
Activity - Is This a Relation?
• It has a name which is unique within the relational schema - No
• Each cell of a relation contains exactly one value - No
• Each attribute has a name – YES
• Each tuple is unique - YES
• The order of attributes is insignificant – YES
• The order of tuples is insignificant - YES
Now a Relation
Student Name Address Modules Course
Guy Smith Med1 Medieval History 1 History
Guy Smith Med2 Medieval History 2 History
Guy Smith TCE Twentieth Century History
Sarah Anusiem 12 New Street,
Lagos
OS Operating Systems Computing
Sarah Anusiem 12 New Street,
Lagos
NET Networks Computing
Functional Dependency
Student ID First Name Surname
9901 John Dacus
9902 Satpal Singh
9922 Jagpal Singh
9911 John Smith
Students
• For any Student ID, there is one first name and one surname, So, First Name
and Surname are functionally dependent on Student ID. We can also say
Student ID functionally determines First Name and Surname.
• Student ID -> First Name, but not the reverse
• Student ID -> Surname
Partial Dependency
• When an non-key attribute is determined by a part, but not the whole,
of a composite primary key. This kind of functional dependency is
known as partial dependency.
• There are two non-key fields : marks and subject_name.
• If you know just student_id, can you determine marks?
• If you know just subject_id, can you determine marks?
• So, marks is partially dependent on student_id and subject_id.
student_id subject_id marks subject_name
1 1 80 Database
2 1 70 Database
1 2 90 Java
Transitive Dependency
3NF
Anomalies
1. Insert Anomalies
2. Update Anomalies
3. Delete Anomalies
Activity: Delete Anomalies
Student ID Student Name Activity Fee
9901 Binay Basketball 200
9902 Shyam Football 300
9922 Sitaram Cricket 500
9811 Prashant Football 300
• What information do we lose if Binay quits Basketball?
• We would lose the price of ‘Basketball’.
• This is the deletion anomaly that occur when relations are not fully
normalized.
• When you delete some information and lose valuable related information
at the same time.
Insert Anomalies
• If we want to record a new activity, but no one has yet taken it. Can
we insert this information?
• We cannot do so; we need a student ID because the student ID is part
of the primary key and therefore cannot be null.
• This is an insert anomaly.
Update Anomalies
• If we wanted to change the cost of football to ‘500’, we would have to
do it for every tuple where someone was playing football .
• Any change made to your data will require you to scan all records to
make the change. This is called the update anomaly.
Customer Order Sheet for an Art Supplier
Customer Number: 37
Customer Name: Jagpal Singh
Customer Type Code: RC
Customer Type Description: Retail Customer
Item Number Item Name Supplier ID Price Supplier Name Quantity
099 Basic Paint Set S1 £3 Smith and Co 1
0100 Sable Brush Set S2 £3.50 Acro 1
0101 Extended Colour
Set
S1 £3.75 Smith and Co 3
098 Metallic Paint Set S1 £3.99 Smith and Co 1
078 Mixed Brush Set S2 £3.99 Acro 2
Customer Order Sheet for Art Supply
Shop
UNF Lev
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Item Number
Item Name
Supplier ID
Price
Supplier Name
Quantity
1
1
1
1
2
2
2
2
2
• Un-normalised Form. Identify repeating groups
First Step
UNF Lev 1NF
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Item Number
Item Name
Supplier ID
Price
Supplier Name
Quantity
1
1
1
1
2
2
2
2
2
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Customer Number*
Item Number
Item Name
Supplier ID
Price
Supplier Name
Quantity
First Normal Form (1NF)
(Separate Repeating and Non-repeating group)
1NF 2NF
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Customer Number*
Item Number
Item Name
Supplier ID
Price
Supplier Name
Quantity
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Customer Number*
Item Number*
Quantity
Item Number
Item Name
Supplier ID
Price
Supplier ID
Supplier Name
Second Normal Form (2NF)
(Remove Partial Dependency)
2NF 3NF
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Customer Number*
Item Number*
Quantity
Item Number
Item Name
Supplier ID
Price
Supplier ID
Supplier Name
Customer Number
Customer Name
Customer Type
Code
Customer Type
Name
Customer Number*
Item Number*
Quantity
Item Number
Item Name
Supplier ID*
Price
Supplier ID
Supplier Name
Third Normal Form (3NF)
(Remove Non-Key Dependency)
2NF 3NF
Customer Number
Customer Name
Customer Type Code
Customer Type Name
Customer Number*
Item Number*
Quantity
Item Number
Item Name
Supplier ID
Price
Supplier ID
Supplier Name
Customer Number
Customer Name
Customer Type
Code
Customer Type
Name
Customer Number*
Item Number*
Quantity
Item Number
Item Name
Supplier ID*
Price
Supplier ID
Supplier Name
Customer
CustomerItem
Item
Supplier
Third Normal Form (3NF) to Deriving Entities
Customer CustomerItem Item
Supplier
1 1
1
0...*
0...* 0...*
The Entity Relationship Diagram
Normalisation and Semantics - 1
• Normalisation depends on understanding the meaning of the
data.
• For example the price of an item depends on just the item. If the
same item could be supplied by different suppliers at different
prices then the normalisation would look different. How?
Normalisation and Semantics - 2
• Answer: there would be a separate group of attributes with the primary key
of Supplier Number and Item Number. Price would be functionally dependent
on both of these attributes and would therefore be an attribute of this entity.
Extended Example
• To be used throughout the course
• Lots of different documents might be examined e.g.
• Customer records
• Sales sheets
• Receipts and invoices
Marlowe Interiors - 2
Marlowe Interiors
1 Newington Green Road
London
N1 TYY
020 7888 1234
Job: Kitchen Makeover
Customer: Ivan Jones, 2 Digby Mansions. Highbury Park
Area: London North
Date: 02/03/00
Parts
1 sink, tin @ 130.00 including VAT.
1 u-pipe @ 20.00 ditto
3 x assorted plumbing fittings @ 33.00 total including VAT
1 thermostat @ 100.00 including VAT
Labour
Plumber 3 hours £150
Labourer 3 hours £60
Electrician 1 hour £50 (to fit thermostat)
TOTAL PARTS £283.00 TOTAL
LABOUR £260.00
TOTAL £543.00
Job Customer Area Date Part Labour
Kitchen
Makeover
Ivan Jones, 2
Digby
Mansions.
Highbury Park
North London 02/03/00 1 sink, tin @
130.00
Plumber 3
hours £150
Kitchen
Makeover
Ivan Jones, 2
Digby
Mansions.
Highbury Park
North London 02/03/00 1 u-pipe @
20.00
Labourer 3
hours £60
Kitchen
Makeover
Ivan Jones, 2
Digby
Mansions.
Highbury Park
North London 02/03/00 3 x assorted
plumbing
fittings
Kitchen
Makeover
Ivan Jones, 2
Digby
Mansions.
Highbury Park
North London 02/03/00 1 thermostat
@ 100.00
Electrician 1
hour £50 (to
fit
thermostat)
Logical Design
• Step One: Create and check ER model
• Step Two: Map ER Model to tables
Iterative
• Discussed as a series of steps but...
• Iterative
• Step-wise refinement
• Revisiting steps
• User involvement
Logical Design Step One - 1
• Step One: Create and check ER mode
• 1.1 Identify entities
• 1.2 Identify relationships
• 1.3 Identify and associate attributes with entities
• 1.4 Determine attribute domains
• 1.5 Determine candidate, primary and alternative key attributes
Logical Design Step One - 2
• Step One: Create and check ER mode
• 1.6 Specialise/Generalise entities (optional step, not covered here)
• 1.7 Check model for redundancy
• 1.8 Check model supports user transactions
• 1.9 Review model with user
Identifying Entities
• Examine user requirements
• Look for nouns
• Look for objects that exist in their own right e.g. Customers,
staff,
• Be aware of synonyms and homonyms
Art Suppliers Example Revisited - 1
• From an interview with the manager:
• “We get our goods from various suppliers. Generally we have
one supplier for each item. Customers order from us. They
usually order in bulk and we fill in an order form. We usually
group orders in the same are into a delivery. We have three
delivery vans.”
Art Suppliers Example Revisited - 2
• From an interview with the manager:
• “We get our goods from various suppliers. Generally we have
one supplier for each item. Customers order from us. They
usually order in bulk and we fill in an order form. We usually
group orders in the same are into a delivery. We have three
delivery vans.”
Art Suppliers – Some Possible Entities
• Manager
• Goods
• Suppliers
• Item
• Customers
• Order
• Order form
• Delivery
• Vans
Examining Entities more Closely
• Manager – one of a number of types of Staff
• Suppliers – yes probably an entity
• Item aka Goods
• Customers - yes
• Order – yes so we don’t need a separate entity for order form
• Delivery - yes
• Vans – yes in order to allocate to a delivery
Step 1.2 Identify Relationships
• Look for verbs e.g. Items are supplied by Suppliers
• Draw up a table with relationships between entities.
Cross Reference Entities for Relationships
Entity Relationship Entity
Items Have Suppliers
Orders Contain Items
Add Multiplicity
Entity Multiplicit
y
Relationship Multiplicit
y
Entity
Items 1 Have 0...* Suppliers
Orders 1...* Contain 0...* Items
Step 1.3 Identify Attributes
• Ask the question ‘what information are we to hold about that
particular entity?’
• Are they simple or composite attributes.
• Activity: What attributes do we need for a ‘Customer’?
Step 1.4 Determine Attribute Domains
• What are the possible values of an attribute?
Attribute Description Data type Domain
CustomerID Unique ID for
customer
Char First character will be
letter ‘C’ followed by a
sequential number
CustomerSurname Customer’s surname Char
CustomerType Specifies if customer
is private or a
company
Char Will be letter ‘P’ for
Private or ‘C’ for
company
CustomerSex Customer’s sex Char Will be ‘M’ or ‘F’
Step 1.5 Determine Candidate, Primary and
Alternate Keys
• Candidate key is an attribute or group of attributes capable of
uniquely identifying a row.
CustomerID OrderItemNo Date Time
1 1 13/01/11 9.55
1 2 13/01/11 9.56
3 1 13/01/11 10.01
Possible candidate keys?
• Candidate key is an attribute or group of attributes capable of
uniquely identifying a row.
CustomerID OrderItemNo Date Time
1 1 13/01/11 9.55
1 2 13/01/11 9.56
3 1 13/01/11 10.01
Possible candidate keys?
1. CustomerID, OrderItemNo, Date, Time
2. CustomerID, OrderItemNo, Date
3. CustoemrID, OrderItemNo, Time
Chose the Primary Key by Choosing
• The candidate key with the minimal set of attributes
• The candidate key that is less likely to have its values changed
• The candidate key that is less likely to lose uniqueness over time
• The candidate key with fewest characters or numbers
• The candidate key that is easiest to use for users
• Candidate key is an attribute or group of attributes capable of
uniquely identifying a row.
CustomerID OrderItemNo Date Time
1 1 13/01/11 9.55
1 2 13/01/11 9.56
3 1 13/01/11 10.01
Possible candidate keys?
1. CustomerID, OrderItemNo, Date, Time
2. CustomerID, OrderItemNo, Date
3. CustomerID, OrderItemNo, Time
Candidate 2 is best
choice
Step 1.7 Check Model for Redundancy
• Re-examine one-to-one relationships
• Remove redundant relationships
• Consider time dimension when assessing redundancy
Remove Redundant Relationships
Video
Rental Customer
is part of
takes out
rents
Take out this
relationship
Step 1.8 Check Model Supports User
Transactions
• Describe and document transactions
• Example
1. Create, update and delete a customers details
2. Create and update an order
3. Retrieve details for customers and the orders they make
Documenting Transactions
Transaction/Table Customer Order
1 C U D
2 C U
3 R R
Step 1.9 Review Model with User
Step 2.1 Create Tables
• Move from entities to tables.
• Most entities will have a one-to-one mapping of entity to table.
• Document in a data dictionary
Entities to Tables - 1
• Decompose any ‘many to many’ relationships
Order Item
An order is for many items and
an item might be on many
orders
Order ItemOrderItem
Entities to Tables - 2
• Some domains will become separate tables
• If a ‘type’ attributes has many values and these are dynamic then a look-up
table to support the domain should be added.
• Product_Type, Student_Type
Step 2.2 Check Table Structure using
Normalisation
• Use the normalisation techniques discussed in the previous
lecture to check the tables
• Do the tables you have from the top-down method match those
from the bottom-up (normalisation) method?
Step 2.3 Check Tables Support user
Transactions
• As the CRUD matrix checked that the ER supported the transactions a similar
check should now be made for the tables.
Step 2.4 Check Business Rules
• This begins the process of check integrity rules and other constraints.
• Check required data
• Column domain constraints
• Entity integrity
• Multiplicity
• Referential intgrity
Step 2.5 Review Logical Design with Users
•This is vital!
References
• Connolly, T. and Begg, C. (2004). Database Systems: A Practical Approach to
Design, Implementation, and Management, 4th Edition. Addison Wesley –
Chapters 9 and 10

More Related Content

What's hot

state modeling In UML
state modeling In UMLstate modeling In UML
state modeling In UML
Kumar
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
 
Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9
koolkampus
 
Shell sort
Shell sortShell sort
Shell sort
Rajendran
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
DrkhanchanaR
 
Online Examination System Report
Online Examination System ReportOnline Examination System Report
Online Examination System Report
Ankan Banerjee
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
Hossain Md Shakhawat
 
Chap 8 graph
Chap 8 graphChap 8 graph
Chap 8 graph
Raj Sarode
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
Muhammad Wajahat Bajwa
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
Rahul Pola
 
Employee management system Project
Employee management system ProjectEmployee management system Project
Employee management system Project
FaizanAnsari89
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
bit allahabad
 
Airline Database Design
Airline Database DesignAirline Database Design
Airline Database Design
Abhishek Jaisingh
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
anooppjoseph
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Oum Saokosal
 
College Management System project srs 2015
College Management System project srs 2015College Management System project srs 2015
College Management System project srs 2015
Surendra Mahala
 
Merge sort
Merge sortMerge sort
Merge sort
Vidushi Pathak
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 

What's hot (20)

state modeling In UML
state modeling In UMLstate modeling In UML
state modeling In UML
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9
 
Shell sort
Shell sortShell sort
Shell sort
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
 
Online Examination System Report
Online Examination System ReportOnline Examination System Report
Online Examination System Report
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Chap 8 graph
Chap 8 graphChap 8 graph
Chap 8 graph
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
Employee management system Project
Employee management system ProjectEmployee management system Project
Employee management system Project
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Airline Database Design
Airline Database DesignAirline Database Design
Airline Database Design
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
College Management System project srs 2015
College Management System project srs 2015College Management System project srs 2015
College Management System project srs 2015
 
Merge sort
Merge sortMerge sort
Merge sort
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 

Similar to Logical Design and Conceptual Database Design

Normalization
NormalizationNormalization
Normalization
Ahmed Farag
 
Programming in Java: Object and Classes
Programming in Java: Object and ClassesProgramming in Java: Object and Classes
Programming in Java: Object and Classes
Martin Chapman
 
Lecture 2 - Relational Model and Terminology.pptx
Lecture 2 - Relational Model and Terminology.pptxLecture 2 - Relational Model and Terminology.pptx
Lecture 2 - Relational Model and Terminology.pptx
MohamedShamil11
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
 
Data Retrival
Data RetrivalData Retrival
Data Retrival
Er. Nawaraj Bhandari
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
Harsiddhi Thakkar
 
ER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdf
SadiaSharmin40
 
Value Analysis and Value Engineering -Function & Evaluation of Function
Value Analysis and Value Engineering -Function & Evaluation of FunctionValue Analysis and Value Engineering -Function & Evaluation of Function
Value Analysis and Value Engineering -Function & Evaluation of Function
Jayaprakash Manickaraj
 
COMMERCIAL CORRESPONDENCE
COMMERCIAL CORRESPONDENCE COMMERCIAL CORRESPONDENCE
COMMERCIAL CORRESPONDENCE
Việt Hoàng Dương
 
The 30-Month Migration
The 30-Month MigrationThe 30-Month Migration
The 30-Month Migration
glvdb
 
Customer Feedback: the missing piece of the Agile puzzle
Customer Feedback: the missing piece of the Agile puzzleCustomer Feedback: the missing piece of the Agile puzzle
Customer Feedback: the missing piece of the Agile puzzle
skierkowski
 
03 machine learning workflow v2
03 machine learning workflow v203 machine learning workflow v2
03 machine learning workflow v2
Anne Starr
 
10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution
Pardot
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
BUSHRASHAIKH804312
 
Lecture7.pptx
Lecture7.pptxLecture7.pptx
Lecture7.pptx
HarpreetHeer1
 
Normalisation revision
Normalisation revisionNormalisation revision
Normalisation revision
Dr. Ramkumar Lakshminarayanan
 
Lecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptxLecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptx
GracePeter10
 
Database management systems 3 - Data Modelling
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data Modelling
Nickkisha Farrell
 
Ifi7184 lesson7
Ifi7184 lesson7Ifi7184 lesson7
Ifi7184 lesson7
Sónia
 
chapter no 4 data integrity and normalization
chapter no 4 data integrity and normalizationchapter no 4 data integrity and normalization
chapter no 4 data integrity and normalization
AqibMehmood43
 

Similar to Logical Design and Conceptual Database Design (20)

Normalization
NormalizationNormalization
Normalization
 
Programming in Java: Object and Classes
Programming in Java: Object and ClassesProgramming in Java: Object and Classes
Programming in Java: Object and Classes
 
Lecture 2 - Relational Model and Terminology.pptx
Lecture 2 - Relational Model and Terminology.pptxLecture 2 - Relational Model and Terminology.pptx
Lecture 2 - Relational Model and Terminology.pptx
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
 
Data Retrival
Data RetrivalData Retrival
Data Retrival
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
 
ER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdf
 
Value Analysis and Value Engineering -Function & Evaluation of Function
Value Analysis and Value Engineering -Function & Evaluation of FunctionValue Analysis and Value Engineering -Function & Evaluation of Function
Value Analysis and Value Engineering -Function & Evaluation of Function
 
COMMERCIAL CORRESPONDENCE
COMMERCIAL CORRESPONDENCE COMMERCIAL CORRESPONDENCE
COMMERCIAL CORRESPONDENCE
 
The 30-Month Migration
The 30-Month MigrationThe 30-Month Migration
The 30-Month Migration
 
Customer Feedback: the missing piece of the Agile puzzle
Customer Feedback: the missing piece of the Agile puzzleCustomer Feedback: the missing piece of the Agile puzzle
Customer Feedback: the missing piece of the Agile puzzle
 
03 machine learning workflow v2
03 machine learning workflow v203 machine learning workflow v2
03 machine learning workflow v2
 
10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
 
Lecture7.pptx
Lecture7.pptxLecture7.pptx
Lecture7.pptx
 
Normalisation revision
Normalisation revisionNormalisation revision
Normalisation revision
 
Lecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptxLecture_four-_Requirements_Modeling (1).pptx
Lecture_four-_Requirements_Modeling (1).pptx
 
Database management systems 3 - Data Modelling
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data Modelling
 
Ifi7184 lesson7
Ifi7184 lesson7Ifi7184 lesson7
Ifi7184 lesson7
 
chapter no 4 data integrity and normalization
chapter no 4 data integrity and normalizationchapter no 4 data integrity and normalization
chapter no 4 data integrity and normalization
 

More from Er. Nawaraj Bhandari

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methods
Er. Nawaraj Bhandari
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data mining
Er. Nawaraj Bhandari
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large Database
Er. Nawaraj Bhandari
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousing
Er. Nawaraj Bhandari
 
Data warehouse testing
Data warehouse testingData warehouse testing
Data warehouse testing
Er. Nawaraj Bhandari
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
Er. Nawaraj Bhandari
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
Er. Nawaraj Bhandari
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
Er. Nawaraj Bhandari
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
Er. Nawaraj Bhandari
 
Chapter 6: Sequential Logic
Chapter 6: Sequential LogicChapter 6: Sequential Logic
Chapter 6: Sequential Logic
Er. Nawaraj Bhandari
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
Er. Nawaraj Bhandari
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
Er. Nawaraj Bhandari
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
Er. Nawaraj Bhandari
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic Commerce
Er. Nawaraj Bhandari
 
Evaluating software development
Evaluating software developmentEvaluating software development
Evaluating software development
Er. Nawaraj Bhandari
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2
Er. Nawaraj Bhandari
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1
Er. Nawaraj Bhandari
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
Er. Nawaraj Bhandari
 
Testing software development
Testing software developmentTesting software development
Testing software development
Er. Nawaraj Bhandari
 

More from Er. Nawaraj Bhandari (20)

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methods
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data mining
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large Database
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousing
 
Data warehouse testing
Data warehouse testingData warehouse testing
Data warehouse testing
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
 
Chapter 6: Sequential Logic
Chapter 6: Sequential LogicChapter 6: Sequential Logic
Chapter 6: Sequential Logic
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic Commerce
 
Evaluating software development
Evaluating software developmentEvaluating software development
Evaluating software development
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
 
Testing software development
Testing software developmentTesting software development
Testing software development
 

Recently uploaded

一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
wyddcwye1
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
ElizabethGarrettChri
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
VyNguyen709676
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
a9qfiubqu
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
sameer shah
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
SaffaIbrahim1
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Kaxil Naik
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
y3i0qsdzb
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 

Recently uploaded (20)

一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 

Logical Design and Conceptual Database Design

  • 1. Er. Nawaraj Bhandari Database Design & Development Topic 2 & 3: Enhancing Design Logical Design & Conceptual Design
  • 2. Some Key Concepts • Entity integrity • Referential integrity(Relational Integrity) • General constraints • Nulls
  • 3. Question • Why cannot any part of a primary key be null? ?
  • 4. Answer • Because a null value, being unknown, might be the same as the value in the primary key of another tuple.
  • 5. Properties of a Relation • Relation Named • Atomic values in cells • Attribute Named • Attribute value drawn from a domain • No duplicate tuples (rows) • No significance to order of tuples • No significance to order of attributes
  • 6. Class Record (Is This a Relation? ) Class Code Instrument Taught Teachers No of Instruments Rented 2 Saxophone Marcus Smith 10 6 Trumpet Ajay Singh Sonny Muller 20 7 Guitar Farhad Khan 10 9 Guitar Farhad Khan Tommy Jones 23 1 Drums Tommy Jones 5
  • 7. Activity - Is This a Relation? • It has a name which is unique within the relational schema - Yes • Each cell of a relation contains exactly one value - No • Each attribute has a name – YES • Each tuple is unique - YES • The order of attributes is insignificant – YES • The order of tuples is insignificant - YES
  • 8. Class Record – A Relation Class Code Instrument Taught Teachers No of Instruments Rented 2 Saxophone Marcus Smith 10 6 Trumpet Ajay Singh 20 6 Trumpet Sonny Muller 20 7 Guitar Farhad Khan 10 9 Guitar Farhad Khan 23 9 Guitar Tommy Jones 23 1 Drums Tommy Jones 5
  • 9. Activity - Is This a Relation? Student Name Modules Course Guy Smith Med1 Medieval History 1 Med2 Medieval History 2 TCE Twentieth Century History Sarah Anusiem 12 New Street, Lagos OS Operating Systems NET Networks Computing
  • 10. Activity - Is This a Relation? • It has a name which is unique within the relational schema - No • Each cell of a relation contains exactly one value - No • Each attribute has a name – YES • Each tuple is unique - YES • The order of attributes is insignificant – YES • The order of tuples is insignificant - YES
  • 11. Now a Relation Student Name Address Modules Course Guy Smith Med1 Medieval History 1 History Guy Smith Med2 Medieval History 2 History Guy Smith TCE Twentieth Century History Sarah Anusiem 12 New Street, Lagos OS Operating Systems Computing Sarah Anusiem 12 New Street, Lagos NET Networks Computing
  • 12. Functional Dependency Student ID First Name Surname 9901 John Dacus 9902 Satpal Singh 9922 Jagpal Singh 9911 John Smith Students • For any Student ID, there is one first name and one surname, So, First Name and Surname are functionally dependent on Student ID. We can also say Student ID functionally determines First Name and Surname. • Student ID -> First Name, but not the reverse • Student ID -> Surname
  • 13. Partial Dependency • When an non-key attribute is determined by a part, but not the whole, of a composite primary key. This kind of functional dependency is known as partial dependency. • There are two non-key fields : marks and subject_name. • If you know just student_id, can you determine marks? • If you know just subject_id, can you determine marks? • So, marks is partially dependent on student_id and subject_id. student_id subject_id marks subject_name 1 1 80 Database 2 1 70 Database 1 2 90 Java
  • 15. 3NF
  • 16. Anomalies 1. Insert Anomalies 2. Update Anomalies 3. Delete Anomalies
  • 17. Activity: Delete Anomalies Student ID Student Name Activity Fee 9901 Binay Basketball 200 9902 Shyam Football 300 9922 Sitaram Cricket 500 9811 Prashant Football 300 • What information do we lose if Binay quits Basketball? • We would lose the price of ‘Basketball’. • This is the deletion anomaly that occur when relations are not fully normalized. • When you delete some information and lose valuable related information at the same time.
  • 18. Insert Anomalies • If we want to record a new activity, but no one has yet taken it. Can we insert this information? • We cannot do so; we need a student ID because the student ID is part of the primary key and therefore cannot be null. • This is an insert anomaly.
  • 19. Update Anomalies • If we wanted to change the cost of football to ‘500’, we would have to do it for every tuple where someone was playing football . • Any change made to your data will require you to scan all records to make the change. This is called the update anomaly.
  • 20. Customer Order Sheet for an Art Supplier Customer Number: 37 Customer Name: Jagpal Singh Customer Type Code: RC Customer Type Description: Retail Customer Item Number Item Name Supplier ID Price Supplier Name Quantity 099 Basic Paint Set S1 £3 Smith and Co 1 0100 Sable Brush Set S2 £3.50 Acro 1 0101 Extended Colour Set S1 £3.75 Smith and Co 3 098 Metallic Paint Set S1 £3.99 Smith and Co 1 078 Mixed Brush Set S2 £3.99 Acro 2 Customer Order Sheet for Art Supply Shop
  • 21. UNF Lev Customer Number Customer Name Customer Type Code Customer Type Name Item Number Item Name Supplier ID Price Supplier Name Quantity 1 1 1 1 2 2 2 2 2 • Un-normalised Form. Identify repeating groups First Step
  • 22. UNF Lev 1NF Customer Number Customer Name Customer Type Code Customer Type Name Item Number Item Name Supplier ID Price Supplier Name Quantity 1 1 1 1 2 2 2 2 2 Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number Item Name Supplier ID Price Supplier Name Quantity First Normal Form (1NF) (Separate Repeating and Non-repeating group)
  • 23. 1NF 2NF Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number Item Name Supplier ID Price Supplier Name Quantity Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number* Quantity Item Number Item Name Supplier ID Price Supplier ID Supplier Name Second Normal Form (2NF) (Remove Partial Dependency)
  • 24. 2NF 3NF Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number* Quantity Item Number Item Name Supplier ID Price Supplier ID Supplier Name Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number* Quantity Item Number Item Name Supplier ID* Price Supplier ID Supplier Name Third Normal Form (3NF) (Remove Non-Key Dependency)
  • 25. 2NF 3NF Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number* Quantity Item Number Item Name Supplier ID Price Supplier ID Supplier Name Customer Number Customer Name Customer Type Code Customer Type Name Customer Number* Item Number* Quantity Item Number Item Name Supplier ID* Price Supplier ID Supplier Name Customer CustomerItem Item Supplier Third Normal Form (3NF) to Deriving Entities
  • 26. Customer CustomerItem Item Supplier 1 1 1 0...* 0...* 0...* The Entity Relationship Diagram
  • 27. Normalisation and Semantics - 1 • Normalisation depends on understanding the meaning of the data. • For example the price of an item depends on just the item. If the same item could be supplied by different suppliers at different prices then the normalisation would look different. How?
  • 28. Normalisation and Semantics - 2 • Answer: there would be a separate group of attributes with the primary key of Supplier Number and Item Number. Price would be functionally dependent on both of these attributes and would therefore be an attribute of this entity.
  • 29. Extended Example • To be used throughout the course • Lots of different documents might be examined e.g. • Customer records • Sales sheets • Receipts and invoices
  • 30. Marlowe Interiors - 2 Marlowe Interiors 1 Newington Green Road London N1 TYY 020 7888 1234 Job: Kitchen Makeover Customer: Ivan Jones, 2 Digby Mansions. Highbury Park Area: London North Date: 02/03/00 Parts 1 sink, tin @ 130.00 including VAT. 1 u-pipe @ 20.00 ditto 3 x assorted plumbing fittings @ 33.00 total including VAT 1 thermostat @ 100.00 including VAT Labour Plumber 3 hours £150 Labourer 3 hours £60 Electrician 1 hour £50 (to fit thermostat) TOTAL PARTS £283.00 TOTAL LABOUR £260.00 TOTAL £543.00
  • 31. Job Customer Area Date Part Labour Kitchen Makeover Ivan Jones, 2 Digby Mansions. Highbury Park North London 02/03/00 1 sink, tin @ 130.00 Plumber 3 hours £150 Kitchen Makeover Ivan Jones, 2 Digby Mansions. Highbury Park North London 02/03/00 1 u-pipe @ 20.00 Labourer 3 hours £60 Kitchen Makeover Ivan Jones, 2 Digby Mansions. Highbury Park North London 02/03/00 3 x assorted plumbing fittings Kitchen Makeover Ivan Jones, 2 Digby Mansions. Highbury Park North London 02/03/00 1 thermostat @ 100.00 Electrician 1 hour £50 (to fit thermostat)
  • 32. Logical Design • Step One: Create and check ER model • Step Two: Map ER Model to tables
  • 33. Iterative • Discussed as a series of steps but... • Iterative • Step-wise refinement • Revisiting steps • User involvement
  • 34. Logical Design Step One - 1 • Step One: Create and check ER mode • 1.1 Identify entities • 1.2 Identify relationships • 1.3 Identify and associate attributes with entities • 1.4 Determine attribute domains • 1.5 Determine candidate, primary and alternative key attributes
  • 35. Logical Design Step One - 2 • Step One: Create and check ER mode • 1.6 Specialise/Generalise entities (optional step, not covered here) • 1.7 Check model for redundancy • 1.8 Check model supports user transactions • 1.9 Review model with user
  • 36. Identifying Entities • Examine user requirements • Look for nouns • Look for objects that exist in their own right e.g. Customers, staff, • Be aware of synonyms and homonyms
  • 37. Art Suppliers Example Revisited - 1 • From an interview with the manager: • “We get our goods from various suppliers. Generally we have one supplier for each item. Customers order from us. They usually order in bulk and we fill in an order form. We usually group orders in the same are into a delivery. We have three delivery vans.”
  • 38. Art Suppliers Example Revisited - 2 • From an interview with the manager: • “We get our goods from various suppliers. Generally we have one supplier for each item. Customers order from us. They usually order in bulk and we fill in an order form. We usually group orders in the same are into a delivery. We have three delivery vans.”
  • 39. Art Suppliers – Some Possible Entities • Manager • Goods • Suppliers • Item • Customers • Order • Order form • Delivery • Vans
  • 40. Examining Entities more Closely • Manager – one of a number of types of Staff • Suppliers – yes probably an entity • Item aka Goods • Customers - yes • Order – yes so we don’t need a separate entity for order form • Delivery - yes • Vans – yes in order to allocate to a delivery
  • 41. Step 1.2 Identify Relationships • Look for verbs e.g. Items are supplied by Suppliers • Draw up a table with relationships between entities.
  • 42. Cross Reference Entities for Relationships Entity Relationship Entity Items Have Suppliers Orders Contain Items
  • 43. Add Multiplicity Entity Multiplicit y Relationship Multiplicit y Entity Items 1 Have 0...* Suppliers Orders 1...* Contain 0...* Items
  • 44. Step 1.3 Identify Attributes • Ask the question ‘what information are we to hold about that particular entity?’ • Are they simple or composite attributes. • Activity: What attributes do we need for a ‘Customer’?
  • 45. Step 1.4 Determine Attribute Domains • What are the possible values of an attribute? Attribute Description Data type Domain CustomerID Unique ID for customer Char First character will be letter ‘C’ followed by a sequential number CustomerSurname Customer’s surname Char CustomerType Specifies if customer is private or a company Char Will be letter ‘P’ for Private or ‘C’ for company CustomerSex Customer’s sex Char Will be ‘M’ or ‘F’
  • 46. Step 1.5 Determine Candidate, Primary and Alternate Keys • Candidate key is an attribute or group of attributes capable of uniquely identifying a row. CustomerID OrderItemNo Date Time 1 1 13/01/11 9.55 1 2 13/01/11 9.56 3 1 13/01/11 10.01 Possible candidate keys?
  • 47. • Candidate key is an attribute or group of attributes capable of uniquely identifying a row. CustomerID OrderItemNo Date Time 1 1 13/01/11 9.55 1 2 13/01/11 9.56 3 1 13/01/11 10.01 Possible candidate keys? 1. CustomerID, OrderItemNo, Date, Time 2. CustomerID, OrderItemNo, Date 3. CustoemrID, OrderItemNo, Time
  • 48. Chose the Primary Key by Choosing • The candidate key with the minimal set of attributes • The candidate key that is less likely to have its values changed • The candidate key that is less likely to lose uniqueness over time • The candidate key with fewest characters or numbers • The candidate key that is easiest to use for users
  • 49. • Candidate key is an attribute or group of attributes capable of uniquely identifying a row. CustomerID OrderItemNo Date Time 1 1 13/01/11 9.55 1 2 13/01/11 9.56 3 1 13/01/11 10.01 Possible candidate keys? 1. CustomerID, OrderItemNo, Date, Time 2. CustomerID, OrderItemNo, Date 3. CustomerID, OrderItemNo, Time Candidate 2 is best choice
  • 50. Step 1.7 Check Model for Redundancy • Re-examine one-to-one relationships • Remove redundant relationships • Consider time dimension when assessing redundancy
  • 51. Remove Redundant Relationships Video Rental Customer is part of takes out rents Take out this relationship
  • 52. Step 1.8 Check Model Supports User Transactions • Describe and document transactions • Example 1. Create, update and delete a customers details 2. Create and update an order 3. Retrieve details for customers and the orders they make
  • 54. Step 1.9 Review Model with User
  • 55. Step 2.1 Create Tables • Move from entities to tables. • Most entities will have a one-to-one mapping of entity to table. • Document in a data dictionary
  • 56. Entities to Tables - 1 • Decompose any ‘many to many’ relationships Order Item An order is for many items and an item might be on many orders Order ItemOrderItem
  • 57. Entities to Tables - 2 • Some domains will become separate tables • If a ‘type’ attributes has many values and these are dynamic then a look-up table to support the domain should be added. • Product_Type, Student_Type
  • 58. Step 2.2 Check Table Structure using Normalisation • Use the normalisation techniques discussed in the previous lecture to check the tables • Do the tables you have from the top-down method match those from the bottom-up (normalisation) method?
  • 59. Step 2.3 Check Tables Support user Transactions • As the CRUD matrix checked that the ER supported the transactions a similar check should now be made for the tables.
  • 60. Step 2.4 Check Business Rules • This begins the process of check integrity rules and other constraints. • Check required data • Column domain constraints • Entity integrity • Multiplicity • Referential intgrity
  • 61. Step 2.5 Review Logical Design with Users •This is vital!
  • 62. References • Connolly, T. and Begg, C. (2004). Database Systems: A Practical Approach to Design, Implementation, and Management, 4th Edition. Addison Wesley – Chapters 9 and 10

Editor's Notes

  1. A → B means A functionally determines B.
  2. A → B means A functionally determines B.
  3. Anomalies: Deviation or departure from the normal or common order, form, or rule. One that is peculiar, irregular, abnormal, or difficult to classify.
  4. A synonym is a word that has the same meaning as another word. "Couch" and "sofa" are synonyms. A homonym is a word that is pronounced like another word. "Pare," "pair," and "pear" are homonyms. Homonyms, from Greek homo "same" + onoma "name," are sometimes called "homophones" from Greek homo "same" + phone "sound."