Chapter 2 DATABASE DESIGN FOR SQL SERVER 2000

Chapter 2 DATABASE DESIGN FOR SQL SERVER 2000 99 APPLYYOURKNOWLEDGEAPPLY YOUR KNOWLEDGE implementation of the database will be a major exam focus. KEY TERMS client/server Relational Database Management System (RDBMS) entities attributes relationships entity decomposition Primary Key one-to-one relationship one-to-many relationship many-to-many relationship Foreign Key normalization denormalization Exercises Employe. Course Employe. I. Cours. I. Firs. Nam. Employe. I. Las. Nam. Nam. Stree. Addres. Locatio. Cit. Cos. Stat. Availabl. Zi. Cod. Gende. Dat. Registere. Dat. o. Birt. SS. Nam. o. Cours. Paymen. Du. 2.1 Creating a One-to-Many Relationship The purpose of this exercise is to show you how to create a basic one-to-many relationship between the Employee entity and the Course entity. Employees teach courses at Lloyd s Hospital. A single employee or teacher may teach many courses, such as blood composition and blood circulation, therefore creating a oneto- many relationship. Estimated Time: 5 minutes. 1. Draw out the two entities, Employee and Course, as boxes, including the attributes defined in each as rows inside the box. Define a Primary Key element for each entity. 2. Creating a Foreign Key is required on the child table (Course) so that it can be related to the parent table (Employee). Create a Foreign Key named EmployeeID on the Course table that references the EmployeeID Primary Key in the Employee table. 3. Draw a line from the Employee entity to the Course entity, making a large dot at the end of the line pointing to Course. This indicates a oneto- many relationship, as shown in Figure 2.13. 2.2 Creating a Many-to-Many Relationship This exercise demonstrates how to create a many-tomany relationship between the Trainee entity and the Course entity. Trainees enroll in courses taught at Lloyd s. A single trainee can enroll in many courses, and at the same time many trainees can enroll to a single course, thus developing a many-to-many relationship. Estimated Time: 5 minutes. 1. Draw out the entities participating in this exercise; that is, the Trainee and Course entity. FIGURE 2.13 An example of a one-to-many relationship.

For high quality jboss hosting services please check jboss web hosting website.

Comments are closed.