Presentation is loading. Please wait.

Presentation is loading. Please wait.

ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.

Similar presentations


Presentation on theme: "ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes."— Presentation transcript:

1 ERD ( ANS)Mazharjaved2001@yahoo.com1 Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes how the data elements in the database are to be grouped. Three terms are used to describe the data requirements: Entity An entity is a thing of interest to an organisation about which data is to be held Attribute: An attribute is a property or characteristic of an entity Relationship: A relationship is a link or association between entities

2 ERD ( ANS)Mazharjaved2001@yahoo.com2 Person, place, object, event or concept about which data is to be maintained named property or characteristic of an entity Association between the instances of one or more entity types Represents a set or collection of objects in the real world that share the same properties EntityNameVerb Phrase AttributeName

3 ERD ( ANS)Mazharjaved2001@yahoo.com3 Entities Examples of entities: –Person: EMPLOYEE, STUDENT, PATIENT –Place: STORE, WAREHOUSE –Object: MACHINE, PRODUCT, CAR –Event: SALE,REGISTRATION, RENEWAL –Concept: ACCOUNT, COURSE Guidelines for naming and defining entity types: –An entity type name is a singular noun –An entity type should be descriptive and specific –An entity name should be concise –Event entity types should be named for the result of the event, not the activity or process of the event.

4 ERD ( ANS)Mazharjaved2001@yahoo.com4 Attributes Example of entity types and associated attributes: STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number, Major Guidelines for naming attributes: –An attribute name is a noun. –An attribute name should be unique –To make an attribute name unique and clear, each attribute name should follow a standard format –Similar attributes of different entity types should use similar but distinguishing names.

5 ERD ( ANS)Mazharjaved2001@yahoo.com5 Relationships  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. relationship name is an active or a passive verb.  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. relationship name is an active or a passive verb. Author Book Relationship name: writes An author writes one or more books A book can be written by one or more authors.

6 ERD ( ANS)Mazharjaved2001@yahoo.com6 One-to-one Eg Products in a supermarket each have a unique barcode number. One-to-many Eg A video club member may hire out a number of videos. Many-to-many Teachers and pupils in a school. Each teacher teaches many pupils and each pupil has many teachers. Types of relationship

7 ERD ( ANS)Mazharjaved2001@yahoo.com7 Types of relationship One to One. 1. A department in school is led up by an individual person, and this person only leads one department. One to Many The head of department may be in charge of many staff, but these staff only have one head of department. Many to Many A teacher may order many books, but each book could be ordered by many teachers.

8 ERD ( ANS)Mazharjaved2001@yahoo.com8 Entity-relationship diagrams An entity-relationship diagram is a diagrammatic way of representing the relationships between the entities in a database. EmployeeCompany car drives (One-to-one) WardPatient holds (One-to-many) AlbumSingers features (Many-to-many)

9 ERD ( ANS)Mazharjaved2001@yahoo.com9 Data Requirements for a Hospital In-patient System A hospital is organised into a number of wards. Each ward has a ward number and a name recorded, along with a number of beds in that ward. Each ward is staffed by nurses. Nurses have their staff number and name recorded, and are assigned to a single ward. Each patient in the hospital has a patient identification number, and their name, address and date of birth are recorded. Each patient is under the care of a single consultant and is assigned to a single ward. Each consultant is responsible for a number of patients. Consultants have their staff number, name and specialism recorded.

10 ERD ( ANS)Mazharjaved2001@yahoo.com10 Entity Relationship Diagram Entity ( identifier ) Ward Ward Id Nurse Staff id Patient Patient id Consultant Staff id Ward Patient holds (One-to-many) Nurse Consultant Sees Staffed by

11 ERD ( ANS)Mazharjaved2001@yahoo.com11 Scenario Each semester, each student must be assigned an advisor who counsels students about degree requirements and helps the students register for classes. Each student must register for classes with the help of an advisor, but if the student ’ s assigned advisor is not available, the student may register with any advisor. We must keep track of students, the assigned advisor for each, and the name of the advisor with whom the student registerd for the current term.

12 ERD ( ANS)Mazharjaved2001@yahoo.com12 ERD For Scenario

13 ERD ( ANS)Mazharjaved2001@yahoo.com13 Scenario A course is always taught by some teacher. A teacher cannot exist without corresponding course. A course may be taught by at least one or more teachers. On the other hand, a teacher may teach at least one or more courses. Draw ERD diagram ???

14 ERD ( ANS)Mazharjaved2001@yahoo.com14 Scenario 2 Each department has a chairman while a chairman chairs only one department. The relationship between department and chairman will be what??


Download ppt "ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes."

Similar presentations


Ads by Google