1. Trang chủ
  2. » Công Nghệ Thông Tin

Module 5: Normalizing the Logical Data Design

24 351 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 24
Dung lượng 639,53 KB

Nội dung

Module 5: Normalizing the Logical Data Design THIS PAGE LEFT INTENTIONALLY BLANK Module 1: Course Overview Module 4: Deriving a Logical Data Design Module 5: Normalizing the Logical Data Design Module 6: Deriving a Physical Data Design Module 7: Implementing Data Integrity Module 2: Solution Design Processes Module 3: Using a Conceptual Design for Data Requirements Module 8: Designing Data Services Module 9: Data Storage Considerations Designing Data Services and Data Models Implementing Entity Relationships Activity 5.1: Identifying Keys in the Logical Model Normalization Basic Activity 5.2: Deriving the Third Normal Form for a Logical Data Model Module 5: Normalizing the Logical Data Design Module 5: Normalizing the Logical Data Design 95 ! !! ! Overview " Implementing Entity Relationships " Normalization Basics " Review In this module . In this module . After completing this module, you will be able to: " Use primary and foreign keys to implement relationships between entities. " Explain the benefits of normalizing entities. " Normalize a table to third normal form. Slide Objective To provide an overview of this module’s topics and objectives. Lead-in This module discusses the implementation of relationships between entities with keys and database normalization strategies. 96 Module 5: Normalizing the Logical Data Design ! !! ! Implementing Entity Relationships " Using Keys " Primary Keys " Foreign Keys " Examples of Primary and Foreign Keys " Activity 5.1: Identifying Keys in the Logical Model In this section . In this section . In this section, you will learn how entities are uniquely identified within the logical data model with keys. You will also learn how keys are used to implement relationships between entities. Slide Objective To introduce the topics in this section. Lead-in In this section, you will learn about primary and foreign keys and how to use them to implement relationships. Module 5: Normalizing the Logical Data Design 97 Using Keys " Benefits $ Uniquely define an entity within a group of like entities $ Help to move data design from logical to physical $ Tie entities together to form relationships Keys are identifying values assigned to each instance of an entity within a data model. As you learned in Module 4, “Deriving a Logical Data Design,” entities within a data model represent a grouping of information about people, places, objects, or ideas. When you begin to move a logical design to a physical design, you use keys to uniquely identify each instance of an entity within the data model. Keys also provide the mechanism for tying entities together. In your physical database design, you represent relationships between entities by adding the keys from parent entity tables to child entity tables so that the entities are bound together by the common key value. Slide Objective To introduce the concept of keys within the physical data model. Lead-in Keys are the mechanism for implementing relationships. 98 Module 5: Normalizing the Logical Data Design Primary Keys " Identifying attributes (existing or new) for entities " Unique values are necessary " Types of primary keys $ Intelligent — related to entities as attributes and keys $ Surrogate — related to entities only as unique identifiers $ Composite — comprised of more than one value A primary key is any field that represents the uniqueness of all an entity’s instances. The primary key value must be unique across all instances of an entity; otherwise, the key value cannot identify any one instance of the entity. The uniqueness of the values in a primary key allows each instance of an entity to exist independently. An entity’s primary key can be an existing attribute within the entity. Any identifying attribute that is guaranteed to be unique across all instances of an entity is a candidate for a primary key. If the uniqueness of the existing attributes cannot be guaranteed, you can create an identifying key, usually a numeric value, and assign it primary key responsibilities. The following types of primary keys exist: " Intelligent keys These keys are created from existing attributes and are related to entities as both attributes and keys. " Surrogate keys These keys are identifier values with no specific relation to entities other than to uniquely identify them. " Composite keys These keys include more than one value per entity. When one attribute within an entity is not enough to uniquely identify each instance of the entity, you can select more than one attribute to be a composite key. For example, each project within a project-tracking database might have a project number, and each project number might contain multiple jobs, each with its own identifying job number. You might use recurring job numbers within each project to denote a specific phase of the project. In this case, the primary key of the project table would be a composite key consisting of both the project number and the job number, because both numbers are necessary to uniquely identify any one job. Slide Objective To introduce primary keys and how they are defined within the data model. Lead-in Primary keys define uniqueness in the relational data model. Delivery Tip Give an example of an intelligent key and a surrogate key. Delivery Tip It might help to draw a picture of a project table with a composite key. Module 5: Normalizing the Logical Data Design 99 Foreign Keys " Values that establish relationships between parent and child entities " Typically primary keys of parent entities " Keys that contain same values as parent entities’ instances " Possibly members of child entities’ primary keys Foreign keys are values that exist in child entities and that establish relationships with the corresponding parent entities. The parent entity can find all its related child entities by searching the child entities for those instances with the appropriate foreign key. A foreign key for a child entity is usually the primary key of the parent entity, because as the primary key uniquely defines the parent, the child must in turn be associated with a unique instance of the parent. The foreign key for a child entity cannot serve as the child’s entire primary key because many instances of the child entity may be related to the same parent instance, and as a result, have the same foreign key value. In many cases, however, the foreign key can serve as a member of a composite key for the child. Slide Objective To introduce foreign key concepts. Lead-in Foreign keys are used as the links between entities that make relationships possible. Delivery Tip If necessary, remind students of the basic definition of a relationship. Also remind them about parent and child entities, as well as the different types of relationships. 100 Module 5: Normalizing the Logical Data Design Examples of Primary and Foreign Keys The slide shows a logical data model with primary and foreign keys, as well as entity relationships. The primary keys identified for each entity are surrogate keys. As shown, each employee, client, timesheet, and invoice instance of an entity has its own unique identifier. The EmployeeID primary key in the Employee entity is used as a foreign key in both the Client and Timesheet entities. Although the Timesheet entity has a primary key, the EmployeeID foreign key is responsible for linking the Timesheet and Employee entities together. Notice the existence between the Timesheet and EmployeeID entities. A timesheet cannot exist unless an employee fills it out. However, the dotted line between the Client and Employee entities indicates that although an employee and a client are related, neither depends on the other for its existence. Slide Objective To show how primary and foreign keys might be used in a logical data model. Lead-in The following slide shows how primary and foreign keys might be used in a logical data model. Module 5: Normalizing the Logical Data Design 101 Activity 5.1: Identifying Keys in the Logical Model In this activity, you will identify primary, foreign, and (if necessary) composite keys in the logical data model for Ferguson and Bardell, Inc. After completing this activity, you will be able to: " Identify primary, foreign, and composite keys in a logical data model. " Select a primary and foreign key type that is appropriate for a given entity. Slide Objective To introduce this activity. Lead-in In this activity, you will identify keys in the Ferguson and Bardell, Inc. logical data model. Delivery Tip Make the students aware that they are focusing on keys in this activity. They are identifying keys to reinforce their knowledge so that they will be able to build a normalized data model. 102 Module 5: Normalizing the Logical Data Design ! !! ! Normalization Basics " Normalizing Logical Models " Creating a First Normal Form Data Model " First Normal Form Example " Moving to a Second Normal Form Data Model " Creating a Third Normal Form Data Model " Third Normal Form Example " Benefits of Normalization " Activity 5.2: Normalizing Data In this section . In this section . In this section, you will learn about normalization and related concepts to understand the role of normalization in a database. Slide Objective To explain the purpose of this section and what students will learn. Lead-in In this section, you will learn about normalization and its benefits. [...]... here Module 9: Data Storage Considerations Lead-in The next module discusses the physical design and topics such as the following Module 1: Course Overview Module 8: Designing Data Services Module 7: Implementing Data Integrity Module 6: Deriving a Physical Data Design Module 2: Solution Design Processes Designing Data Services and Data Models Module 3: Using a Conceptual Design for Data Requirements Module. .. Conceptual Design for Data Requirements Module 4: Deriving a Logical Data Design Module 5: Normalizing the Logical Data Design In the next module, you will learn how to derive a physical data design In the process, you will be introduced to concepts such as the following: " Database objects " Joins " Indexes 116 Module 5: Normalizing the Logical Data Design THIS PAGE INTENTIONALLY LEFT BLANK ... operations Module 5: Normalizing the Logical Data Design 105 Creating a First Normal Form Data Model Slide Objective To introduce the process of creating a first normal form data design " Create two-dimensional tables Lead-in " Assign only one value to each cell " Assign a single meaning to each column Creating first normal form is the first step in producing a normalized data design The first step in normalizing. .. columns that are not dependent on the primary key and completes the elimination of redundant data 3 Why would you normalize a database? You would normalize a database to reduce the amount of redundant data and inconsistencies Normalization also helps speed up data modification and reduces application modifications and data maintenance Module 5: Normalizing the Logical Data Design 115 Looking Forward Slide... multiple users are making modifications to the data s values " Fewer null values Reducing the number of columns in a table to those that are relevant to that particular table results in fewer null, or not applicable, values for a given record, thus reducing overall size of the table and the database Module 5: Normalizing the Logical Data Design Activity 5.2: Normalizing Data Slide Objective To introduce this... value for their existence 3 Move these independent attributes into separate tables and identify each with a primary key Relate that primary key back to the parent entity as a foreign key Module 5: Normalizing the Logical Data Design 109 Third Normal Form Example Slide Objective To illustrate third normal form Lead-in When you reach third normal form, you have the desired data design In the slide, the Timesheet.. .Module 5: Normalizing the Logical Data Design 103 Normalizing Logical Models Slide Objective To define normalization " Normalization is the process of progressively refining a logical model to eliminate duplicate data from a database Process of eliminating duplicate data, and usually, defining relationships among tables " Lead-in Normal... entities from the Ferguson and Bardell, Inc case study After completing this activity, you will be able to: • Normalize a logical data design to third normal form 111 112 Module 5: Normalizing the Logical Data Design ! Review Slide Objective To explain the purpose of this section and what students have learned Lead-in This section reviews what you have learned and prepares you for the next modules " Guidelines... used for all the people whose information will be stored in the database 114 Module 5: Normalizing the Logical Data Design Review Questions Slide Objective To reinforce this module s objectives by reviewing key points " Use primary and foreign keys to implement relationships among entities " Explain the benefits of normalizing entities " Normalize a table to third normal form Lead-in These review... normalized data design The first step in normalizing a database is to ensure that the tables are in first normal form To accomplish this step, the tables must adhere to the following criteria: Delivery Tip Remind the students that they are not completely out of logical design at this point They are still moving from logical data design to physical data design This is a step in that process " Tables must . Third Normal Form for a Logical Data Model Module 5: Normalizing the Logical Data Design Module 5: Normalizing the Logical Data Design 95 ! !! ! Overview. Module 5: Normalizing the Logical Data Design Module 6: Deriving a Physical Data Design Module 7: Implementing Data Integrity Module 2: Solution Design

Ngày đăng: 16/10/2013, 13:15

TỪ KHÓA LIÊN QUAN