100 Part I EXAM PREPARATION APPLYYOURKNOWLEDGEAPPLY YOUR KNOWLEDGE
100 Part I EXAM PREPARATION APPLYYOURKNOWLEDGEAPPLY YOUR KNOWLEDGE Traine. TraineeCours. Course Traine. I. Cours. I. Firs. Nam. Cours. I. . F. Traine. I. . F. Name Las. Nam. Location Stree. Addres. Cost Cit. Available Stat. Zi. Cod. Gende. Dat. Registere. Dat. o. Birt. SS. Nam. o. Cours. Paymen. Du. FIGURE 2.14 An example of a many-to-many relationship. Include in each entity the attributes defined as rows inside the box. 2. Recall that a many-to-many relationship can only be implemented with the help of an associative entity as an intermediate. Create a new entity between Trainee and Course and name it TraineeCourse. 3. The new associative entity needs to link both the Course and Trainee entities. To do this, the associative entity must contain two Foreign Keys: TraineeID and CourseID. 4. After you have placed these two attributes onto the associative entity, draw two lines from the associative entity to both other entities, placing a large dot at the ends of the lines pointing to the associative entity. The final model should look similar to the one in Figure 2.14. 2.3 Deciding on Primary Keys and Attribute Characteristics This exercise demonstrates the use of characteristics and Primary Keys, as well how to identify them. Estimated Time: 15 minutes 1. The entity to which you will be adding column constraints is the Employee entity. If you have not already copied out the Employee entity, do so now. 2. Now you will need to decide upon a Primary Key Employe. Employe. I. -IDENTIT. Firs. Nam. -NO. NUL. Las. Nam. ContractTyp. -NO. NUL. -NUL. Salar. -NO. NUL. Divisio. -NO. NUL. UNIQU. SS. -NO. NUL. N. CHANGE. Hire_Dat. -NO. NUL. UNIQU. UNIQU. Phon. Addres. -NUL. -NUL. FIGURE 2.15 An example of choosing attribute characteristics. for this entity. You could use the employee s first name as a Primary Key, but doing so allows for duplicate values. Creating a Primary Key with the IDENTITY property enforces uniqueness on any attribute. Create a new attribute named EmployeeID that will be used as the Primary Key and mark it as IDENTITY. 3. You can decide which values are required and which values do not need to be entered; use NULL and NOT NULL to do this. Place NOT NULL for the FirstName, LastName, Hire_Date, SSN, Division, and Salary attributes. Place NULL beside the ContractType, Address, and Phone attributes.
For high quality java hosting services please check java web hosting website.