Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor
-
Upload
abdul-bolton -
Category
Documents
-
view
47 -
download
0
description
Transcript of Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor
![Page 1: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/1.jpg)
1
Database Design Concepts
J. S. Chou, P.E., Ph.D.Assistant Professor
Department of Business AdministrationNational Chung Cheng University
![Page 2: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/2.jpg)
2
Database TerminologyEntities • Things we store information about. (i.e. persons,
places, objects, events, etc.)• Have relationships to other entities (i.e. the
entity Student has a relationship to the entity Grades in a University Student database
Attributes• These are pieces of information about an
entity (i.e. Student ID, Name, etc. for the entity Student)
![Page 3: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/3.jpg)
3
View of a Database Table or FileAttribute
(One Column)
Record(One Row)
AttributeType
![Page 4: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/4.jpg)
4
Designing Databases – Data Model
Example: ERD (Entity Relationship Diagram)
Data Model• A map or diagram that represents entities and
their relationships• Used by Database Administrators to design tables
with their corresponding associations
![Page 5: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/5.jpg)
5
Designing Databases – Keys
Primary KeyA unique attribute type used to identify a single instance of an entity.
Compound Primary KeyA unique combination of attributes types used to identify a single instance of an entity
![Page 6: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/6.jpg)
6
Designing Databases – Keys (Example)Primary Key- Student ID
ENTITIES
Compound Primary Key- Student ID - Course ID - Sec No.- Term
SecondaryKey- Major
Entities are translated into Tables
(Students and Grades)
Entities arejoined by commonattributes
![Page 7: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/7.jpg)
7
Designing Databases - AssociationsAssociations• Define the relationships one entity has to another• Determine necessary key structures to access data• Come in three relationship types:
- One-to-One - One-to-Many - Many-to-Many
Foreign Key• An attribute that appears as a non-primary
key in one entity (table) and as a primary key attribute in another entity (table)
![Page 8: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/8.jpg)
8
Designing Databases - AssociationsEntity Relationship Diagram (ERD) • Diagramming tool used to express entity relationships• Very useful in developing complex databases
Example• Each Home Stadium has a Team (One-to-One) • Each Team has Players (One-to-Many)• Each Team Participates in Games• For each Player and Game there are Game Statistics
![Page 9: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/9.jpg)
9
Designing Databases – Associations (Example)
![Page 10: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/10.jpg)
10
The Relational Model - NormalizationNormalization• A technique to make complex databases more efficient by
eliminating as much redundant data as possible• Example: Database with redundant data (below)
![Page 11: Database Design Concepts J. S. Chou, P.E., Ph.D. Assistant Professor](https://reader036.fdocuments.net/reader036/viewer/2022062301/568134c6550346895d9beb80/html5/thumbnails/11.jpg)
11
The Relational Model - NormalizationNormalized Database