www.infotech.monash.edu.au/FIT1004/ FIT1004 Database Topic 5: Logical Design Learning Objectives : • Understand the purpose of logical database design. • Understand the expected inputs and outputs of the logical database design process. • Convert a conceptual design model (ER diagram) to a logical design model (Data Structure Diagram (DSD)). • Understand the drawing conventions of DSD. • Interpret a DSD. • Understand how business rules are reflected in DSDs. • Understand the purpose of a Data Dictionary. • Create a Data Dictionary. References : • Rob, P. & Coronel, C., Database Systems –6 th Edition, Chapter 6, p. 232–235, Chapter 8, p. 401–420. –7 th Edition, Chapter 6, p. 184–202, Chapter 9, p. 380–381 • Hoffer, J.A., Prescott, M.B. & McFadden, F.R., Modern Database Management, 7th Edition, Chapter 5 (Appendix A in Unit Book).
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
www.infotech.monash.edu.au/FIT1004/
FIT1004 Database
Topic 5: Logical Design
Learning Objectives:• Understand the purpose of logical database design.• Understand the expected inputs and outputs of the logical database design process.• Convert a conceptual design model (ER diagram) to a logical design model (Data
Structure Diagram (DSD)).• Understand the drawing conventions of DSD.• Interpret a DSD.• Understand how business rules are reflected in DSDs.• Understand the purpose of a Data Dictionary.• Create a Data Dictionary.
References:• Rob, P. & Coronel, C., Database Systems
– 6th Edition, Chapter 6, p. 232–235, Chapter 8, p. 401–420. – 7th Edition, Chapter 6, p. 184–202, Chapter 9, p. 380–381
• Hoffer, J.A., Prescott, M.B. & McFadden, F.R., Modern Database Management, 7th Edition, Chapter 5 (Appendix A in Unit Book).
2
Where We Are
Introduction to Database Systems The Relational Model
• Central repository which maintains data describing the tables within the database
• Data kept– Names of the tables– Names and detailed descriptions of the attributes– Domains and lengths of the attributes– Integrity constraints
• Can be created and maintained manually or using Computer-Aided Software Engineering (CASE) tools, such as:
– ERwin – Computer Associates (http://ca.com/)– Rational Rose – IBM - http://www.ibm.com/software/rational/– VISIO – Microsoft (http://office.microsoft.com/en-
us/FX010857981033.aspx) – Enterprise version required to generate schemas
– Database Design Studio - http://www.chillisource.com/
11
Data Dictionary
12
Data Dictionary
• Main uses– Easier management of the data about the database
structure since all this information is stored at a central location
– A communication tool between database designers and users
– Identifying redundancy and inconsistency in attribute names
– Tracking the changes of the database structure
13
Data Structure Diagram (DSD)
• Logical ERD model representation useful as midpoint between Conceptual ERD and schema:– Shows all attributes– PK's indicated in some manner Underlined, labelled as PK, …– Relationships (ERD diamonds) replaced by FK's, FK's indicated in
some manner Italics, broken underline, labelled as FK,….
• Deleting a painter (row) from the PAINTER table:– PAINTING table will contain references to PAINTER
which no longer exists: deletion anomaly– Impose a DELETE RESTRICT requirement
> DBMS will not permit removal of a PAINTER if they still have a PAINTING
Stage 2: Logical ERD (DSD)
30
• Adding a painter (row):– No problems caused
• Modifying the primary key in the PAINTER table:– Should we allow key updates?– PAINTING table will contain references to PAINTER which no longer exist:
update anomaly– Impose an UPDATE CASCADE requirement – DBMS will automatically
update all related FK's (pntg_num in PAINTING) to the new value• Deleting a gallery (row) from the GALLERY table:
– Deletion anomaly impose DELETE RESTRICT• Adding a gallery (row) to the GALLERY table:
– No problem caused• Modifying the primary key in the GALLERY table:
– Update anomaly impose UPDATE CASCADE
31
• Given these results the SQL2 type schema needs to be of the form:create table gallery (
gal_num smallint not null,gal_owner char (20) not null,gal_phone char (10) not null,
primary key (gal_num));create table painter (
ptr_num smallint not null,ptr_name char (20) not null,ptr_phone char (10) not null,
primary key (ptr_num));create table painting (
pntg_num integer not null,pntg_title char (50) not null,pntg_price decimal(8,2) not null,ptr_num smallint not null,gal_num smallint,
• This lecture– Understand the purpose of logical database design.– Understand the expected inputs and outputs of the logical
database design process.– Convert a conceptual design model (ER diagram) to a logical
design model (Data Structure Diagram (DSD)).– Understand the drawing conventions of DSD.– Interpret a DSD.– Understand how business rules are reflected in DSDs.– Understand the purpose of a Data Dictionary.– Create a data dictionary.