Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ASPP(DATABASE DESIGN) Database Design. 2 ASPP(DATABASE DESIGN) Objectives àDefine the terms entity, record, and attribute and discuss the various types.

Similar presentations


Presentation on theme: "1 ASPP(DATABASE DESIGN) Database Design. 2 ASPP(DATABASE DESIGN) Objectives àDefine the terms entity, record, and attribute and discuss the various types."— Presentation transcript:

1 1 ASPP(DATABASE DESIGN) Database Design

2 2 ASPP(DATABASE DESIGN) Objectives àDefine the terms entity, record, and attribute and discuss the various types of keys àDraw an entity-relationship diagram, and explain the types of entity relationships àDefine cardinality, cardinality notation, and crow’s foot notation àExplain normalization, including examples of first, second, and third normal form

3 3 ASPP(DATABASE DESIGN) Objectives àCompare and contrast database management and file processing environments àExplain various types of database organization, including hierarchical, network, and relational design àDescribe various types of files, including master, transaction, table, work, history, and security

4 4 ASPP(DATABASE DESIGN) àData terminology and concepts àRelationships among data objects àEntity-relationship diagrams (ERDs) Introduction

5 5 ASPP(DATABASE DESIGN) àData design includes àEntities àFields àRecords àKeys Data Terminology and Concepts

6 6 ASPP(DATABASE DESIGN) àDefinitions àEntity: a person, place, thing, or event for which data is collected and maintained àField (attribute): a single characteristic or fact about an entity àRecord: a collection of fields that describes one instance of an entity Data Terminology and Concepts

7 7 ASPP(DATABASE DESIGN)

8 8 àDefinitions àKey field: a field used to locate, retrieve, or identify a specific record àPrimary key: a key that uniquely identifies each record Data Terminology and Concepts

9 9 ASPP(DATABASE DESIGN) àKey fields àPrimary keys àA field or combination of fields that uniquely and minimally identifies each member of an entity àA primary key composed of more than one field is called a multivalued key Data Terminology and Concepts

10 10 ASPP(DATABASE DESIGN)

11 11 ASPP(DATABASE DESIGN) àKey fields àCandidate keys àAny field that could serve as primary key àAny field that is not a primary key or candidate key is called a nonkey field Data Terminology and Concepts

12 12 ASPP(DATABASE DESIGN) àKey fields àForeign keys àA field in one file that matches a primary key value in another file àExample: the advisor number is a foreign key in the STUDENT file that matches a primary key value in the ADVISOR file àA foreign key need not be unique àA combination of two or more foreign keys can form a unique primary key value àReferential integrity ensures that a foreign key value cannot be entered unless it matches a primary key value in another file Data Terminology and Concepts

13 13 ASPP(DATABASE DESIGN) àKey fields àSecondary keys àA field or combination of fields that can be used to access or retrieve records àSecondary keys do not need to be unique Data Terminology and Concepts

14 14 ASPP(DATABASE DESIGN) àEntity-relationship diagrams (ERDs) àAn ERD is a graphical model that shows relationships among system entities Data Relationships and Entity- Relationship Diagrams

15 15 ASPP(DATABASE DESIGN)

16 16 ASPP(DATABASE DESIGN) àEntity-relationship diagrams (ERDs) àAn ERD is a graphical model that shows relationships among system entities àEach entity is a rectangle, labeled with a noun àEach relationship is a diamond, labeled with a verb àTypes of relationships àOne-to-one (1:1) àOne-to-many (1:M) àMany-to-many (M:N) àA full ERD shows all system relationships Data Relationships and Entity- Relationship Diagrams

17 17 ASPP(DATABASE DESIGN)

18 18 ASPP(DATABASE DESIGN) àOne-to-one (1:1) relationship àExists when exactly one of the second entity occurs for each instance of the first entity àExamples àOne office manager heads one office àOne vehicle ID number is assigned to one vehicle àOne driver drives one delivery truck àOne faculty member is chairperson of one department Data Relationships and Entity- Relationship Diagrams

19 19 ASPP(DATABASE DESIGN)

20 20 ASPP(DATABASE DESIGN) àOne-to-many (1:M) relationship àExists when one occurrence of the first entity can be related to many occurrences of the second entity, but each occurrence of the second entity can be associated with only one occurrence of the first entity àExamples àOne individual owns many automobiles àOne customer places many orders àOne department employs many employees àOne faculty advisor advises many students Data Relationships and Entity- Relationship Diagrams

21 21 ASPP(DATABASE DESIGN)

22 22 ASPP(DATABASE DESIGN) àMany-to-many (M:N) relationship àExists when one instance of the first entity can be related to many instances of the second entity, and one instance of the second entity can be related to many instances of the first àExamples àA student enrolls in one or more classes, and each class has one or more students registered àA passenger buys tickets for one or more flights, and each flight has one or more passengers àAn order lists one or more products, and each product is listed on one or more orders Data Relationships and Entity- Relationship Diagrams

23 23 ASPP(DATABASE DESIGN)

24 24 ASPP(DATABASE DESIGN) àA full ERD shows all system relationships àExamples àA sales rep serves one or more customers, but each customer has only one sales rep àA customer places one or more orders, but each order has only one customer àAn order lists one or more products, and each product can be listed in one or more orders àA warehouse stores one or more products, and each product can be stored in one or more warehouses Data Relationships and Entity- Relationship Diagrams

25 25 ASPP(DATABASE DESIGN)

26 26 ASPP(DATABASE DESIGN) àCardinality àDescribes how instances of one entity relate to another àMandatory vs. optional relationships àCrow’s foot notation is one method of showing cardinality Data Relationships and Entity- Relationship Diagrams

27 27 ASPP(DATABASE DESIGN)

28 28 ASPP(DATABASE DESIGN) àCardinality àDescribes how instances of one entity relate to another àMandatory vs. optional relationships àCrow’s foot notation is one method of showing cardinality àMost CASE products support the drawing of ERDs Data Relationships and Entity- Relationship Diagrams

29 29 ASPP(DATABASE DESIGN)

30 30 ASPP(DATABASE DESIGN) àCreating an ERD 1. Identify the entities 2. Determine all significant events or activities for two or more entities 3. Analyze the nature of the interaction 4. Draw the ERD Data Relationships and Entity- Relationship Diagrams


Download ppt "1 ASPP(DATABASE DESIGN) Database Design. 2 ASPP(DATABASE DESIGN) Objectives àDefine the terms entity, record, and attribute and discuss the various types."

Similar presentations


Ads by Google