Chapter 2 DATABASE DESIGN FOR SQL SERVER 2000
Chapter 2 DATABASE DESIGN FOR SQL SERVER 2000 73 An EMPLOYEE helps a PATIENT with his/her expertise and can prescribe MEDICINE if needed. EMPLOYEES teach COURSES to TRAINEES studying at Lloyd s Academic. Employee Course Treats Trainee Patient TRAINEES are those A PATIENT is one who needs participating in the COURSES treatment from a doctor provided by Lloyd s Hospital (EMPLOYEE). Used by doctors to better help patients Medicine Machinery MEDICINE is used to aid in treating their PATIENTS. MACHINERY helps EMPLOYEES PATIENTS and is prescribed by EMPLOYEES. going to look like. This is shown in Figure 2.3. So how are relationships actually implemented? They are implemented as parent and child entities. In all cases in the ER model, a key attribute from a child parent entity is attached to a related key value in a parent. All cardinality of relationships are implemented in this way. This means that whether you have a one-to-one, one-to-many, or many-to-many relationship, you always have the key of the child related to a parent. As noted previously in the chapter, many-to-many relationships exist when many instances of one entity are related to many instances of another entity. The reason why many-to-many relationships are implemented a bit differently is that the ER relational model does not support many-to-many relationships. Nonetheless, establish many-to-many relationships by creating two one-to-many relationships and connecting them to a new entity. This new entity is known as an associate entity or join entity. Resolving many-to-many relationships involves creating two one-tomany relationships from each of the original entities onto the associative entity. Take the many-to-many relationship between the Course entity and Trainee entity, for example. A many-to-many relationship needs to be resolved by creating an associative entity, TraineeCourse, and then linking a one-to-many relationship from the Course and Trainee entities to TraineeCourse. This process of FIGURE 2.3 ER model overview.
For high quality website hosting services please check java web hosting website.