Presentation on theme: "Developing ER-Diagram Indra Budi"— Presentation transcript:
Developing ER-Diagram Indra Budi
Fakultas Ilmu Komputer UI 2 Data Modeling Process Specifying entities Specifying relationships Determining identifiers (key attribute) Specifying attributes, and Specifying domains Specifying cardinality & participation Specifying specialization & generalization concepts is necessary
Fakultas Ilmu Komputer UI 3 Persons: agency, contractor, customer, department, division, employee, instructor, student, supplier. Places: sales region, building, room, branch office, campus. Objects: book, machine, part, product, raw material, software license, software package, tool, vehicle model, vehicle. Events: application, award, cancellation, class, flight, invoice, order, registration, renewal, requisition, reservation, sale, trip. Concepts: account, block of time, bond, course, fund, qualification, stock. Specifying Entity Entity – a class of persons, places, objects, events, or concepts about which we need to capture and store data. Named by a singular noun
Fakultas Ilmu Komputer UI 4 Specifying Relationship Examine every combination of two entities and see whether there is a possible relationship between them This is often documented using a matrix that lists the entity names on both axes. A symbol is entered at the intersection of each row and column to indicate the existence of a possible relationship. This technique becomes unusable if the model is large. Look at the requirements documents to find relationships indicated by the documents. The two techniques can be used together
Fakultas Ilmu Komputer UI 5 Identifiers One or more attributes can serve as the entity identifier, uniquely identifying each entity instance Concatenated identifier consists of several attributes
Fakultas Ilmu Komputer UI 6 Specifying Attributes Attribute – a descriptive property or characteristic of an entity. Synonyms include element, property, and field. Just as a physical student can have attributes, such as hair color, height, etc., a data entity has data attributes Compound attribute – an attribute that consists of other attributes. Synonyms in different data modeling languages are numerous: concatenated attribute, composite attribute, and data structure.
Fakultas Ilmu Komputer UI 7 Specifying Domain A domain is the set of valid data properties and values for an attribute. It can be imagined as the source of the possible values of that attribute, including type definition, initial value and value constraints. The use of domains allows attributes to inherit the properties of their assigned domains, and also allows the database administrator to change attribute properties by changing the domain properties. Domains can thus be used to enforce data standards throughout the model. Some organizations use data dictionaries to document and standardize domains and their properties.
Fakultas Ilmu Komputer UI 8 Cardinality refers to the number of times instances in one entity can be related to instances in another entity One instance in an entity refers to one and only one instance in the related entity (1:1) One instance in an entity refers to one or more instances in the related entity (1:N) One or more instances in an entity refer to one or more instances in the related entity (M:N)
Fakultas Ilmu Komputer UI 9 Participation Sometimes called modality Refers to whether or not an instance of a child entity can exist without a related instance in the parent entity Not Null means that an instance in the related entity must exist for an instance in another entity to be valid Null means that no instance in the related entity is necessary for an instance in another entity to be valid (min,max) participation
Fakultas Ilmu Komputer UI 10 ERD - Design Guidelines Best practices rather than rules Entities should have many occurrences Avoid unnecessary attributes Clearly label all components Apply correct cardinality and modality Break attributes into lowest level needed Labels should reflect common business terms Assumptions should be clearly stated
Fakultas Ilmu Komputer UI 11 True/False A conceptual schema is a complete logical view of the database. An implementational schema shows physical storage using a particular product or technique In E-R modeling, an attribute may be either composite or multi-value, but it cannot be both The degree of a relationship is expressed as the relationship’s maximum cardinality All weak entities must have a minimum cardinality of 1 on the entity on which it depends
Fakultas Ilmu Komputer UI 12 Multiple Choice The representation of a particular entity is called a(n) ______________. a. entity class b. entity relationship c. entity instance d. entity attribute e. None of the above. Supertype / subtype entities are said to have a(n) __________________ relationship. a. HAS-A b. IS-A c. Recursive d. redundant e. multi-value
Fakultas Ilmu Komputer UI 13 Multiple Choice (cont) In terms of generalization hierarchies, the characteristic of “inheritance” means that: a. the attributes of an instance of the supertype include the attributes of the subtype. b. an instance of the supertype must belong to one of the subtypes. c. the attributes of an instance of the subtype include the attributes of the supertype. d. there is a redundant relationship among instances of the subtype. e. the attributes of different subtypes must not overlap with each other.
Fakultas Ilmu Komputer UI 14 Multiple Choice (cont) Minimum cardinality refers to ……. a. the most instances of one entity class that can be involved in a relationship with one instance of another entity class b. the minimum number of entity classes involved in a relationship c. whether or not an instance of one entity class is required to be related to an instance of another entity class d. whether or not an entity is a weak entity e. None of the above.
Fakultas Ilmu Komputer UI 15 Fill in blank In a generalization hierarchy, the ……..entity contains the attributes that are common to all subtypes. Generalization hierarchies have a characteristic called …….which means that entities in the subtypes have all the attributes of the supertype. Relationships among entities of a single entity are sometimes called ….. Relationships When designing a data model the users’ views must be translated into the developers’ …….schema.
Fakultas Ilmu Komputer UI 16 Exercise A company database needs to store information about employees (identifed by ssn, with salary and phone as attributes), departments (identifed by dno, with dname and budget as attributes), and children of employees (with name and age as attributes). Employees work in departments; each department is managed by an employee; a child must be identi.ed uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known. We are not interested in information about a child once the parent leaves the company. Draw an ER diagram that captures that information.
Fakultas Ilmu Komputer UI 17 Addition to Group Presentation on Monday Each of the clinics in the hospital is identified by a unique name. There are two types of clinics: Local and distant. Clinics located at the main campus of the hospital are local and the remaining ones are distant. Some distant clinics are jointly operated by another health institution XYZ Healthcare. A director is responsible for each clinic. The director is also a doctor. Each doctor may serve as the director of one and only one clinic but may serve as the assistant director of another (one) clinic. There are a large number of laboratories at the hospital; some labs are managed by one clinic, whereas others are managed jointly by two or more clinics. Doctors are assigned to one clinic; each clinic has many doctors. Each patient is assigned to one primary doctor. A doctor takes care of many patients. Each patient has a number of tests done at a number of labs; each lab can carry out a number of tests. Draw an EER Diagram