Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Modeling Data in the Organization Kuliah 3 Basis Data Disampaikan oleh: Annisa, M.Kom. Enrollment Key: basdat 2011.

Presentasi serupa


Presentasi berjudul: "Modeling Data in the Organization Kuliah 3 Basis Data Disampaikan oleh: Annisa, M.Kom. Enrollment Key: basdat 2011."— Transcript presentasi:

1 Modeling Data in the Organization Kuliah 3 Basis Data Disampaikan oleh: Annisa, M.Kom. Enrollment Key: basdat 2011

2 Outline © Pearson Education Limited 1995, 2005 Modeling the Rules of Organization Business Rules and Scope of Business Rules Data Names and Definitions Conceptual Database Design: ER data model Modeling Entities Modeling Attributes Modeling Relationships

3 Business Rules and Scope of Business Rules “Friday is business casual dress day” “A student may register for a section of a course only if he or she has successfully completed the prerequisites for that course” Important policy statement, but no impact on databases

4 Data Names and Definitions Relate to business, not technical : Customer, not File10, Bit7, X, etc. Meaningful, Readable : GradePointAverage, not AverageGradeRelativetoCust Unique : HomeAddress VS CampusAddress Composed of Words Taken from an Approved List: CUST for Customer Repeatable: StudentBirthDate, EmployeeBirthDate A course is a module of instruction in a particular subject area

5 Entity-Relationship (ER) Modeling • Entity Relationship (ER) Diagram – A detailed, logical representation of the entities, associations and data elements for an organization or business • Notation uses three main constructs – Entities – Relationships – Attributes

6 E-R Model Constructs • Entities: – Entity instance–person, place, object, event, concept (often corresponds to a row in a table) – Entity Type–collection of entities (often corresponds to a table) • Relationships: – Relationship instance–link between entities (corresponds to primary key-foreign key equivalencies in related tables) – Relationship type–category of relationship…link between entity types • Attribute–property or characteristic of an entity or relationship type (often corresponds to a field in a table)

7 Relationship degrees specify number of entity types involved Entity symbols A special entity that is also a relationship Relationship symbols Relationship cardinalities specify how many of each entity type is allowed Attribute symbols Basic E-R notation

8 • Examples of entities: – Person: EMPLOYEE, STUDENT, PATIENT – Place: STORE, WAREHOUSE – Object: MACHINE, PRODUCT, CAR – Event: SALE,REGISTRATION, RENEWAL – Concept: ACCOUNT, COURSE Basic E-R notation

9 Strong Entity of Dream Home Dream Home adalah perusahaan yang bergerak di bidang penyewaan rumah. Dream Home memiliki banyak cabang di masing-masing ibukota propinsi, dimana setiap cabang memiliki banyak pegawai. Setiap pegawai memperoleh asuransi kesehatan untuk dirinya dan keluarganya. Property didaftarkan oleh Owner. Setiap owner boleh mendaftarkan lebih dari satu propertinya. Setiap client boleh menyewa lebih dari satu property. Setiap client mendaftarkan preferensi tentang rumah yang dikehendakinya. Client mengetahui property yang disewakan dari iklan yang dipasang oleh perusahaan. Setiap rumah dapat dilihat oleh client. Jika client setuju untuk menyewa rumah tersebut, maka akan dilakukan perjanjian kontrak.

10 Strong Entity of Dream Home BRANCHEMPLOYEE PROPERTY OWNER CLIENT

11 Weak Entity of Dream Home Dream Home adalah perusahaan yang bergerak di bidang penyewaan rumah. Dream Home memiliki banyak cabang di masing-masing ibukota propinsi, dimana setiap cabang memiliki banyak pegawai. Setiap pegawai memperoleh asuransi kesehatan untuk dirinya dan keluarganya. Property didaftarkan oleh Owner. Setiap owner boleh mendaftarkan lebih dari satu propertinya. Setiap client boleh menyewa lebih dari satu property. Setiap client mendaftarkan preferensi tentang rumah yang dikehendakinya. Client mengetahui property yang disewakan dari iklan yang dipasang oleh perusahaan. Setiap rumah dapat dilihat oleh client. Jika client setuju untuk menyewa rumah tersebut, maka akan dilakukan perjanjian kontrak.

12 Weak Entity of Dream Home DEPENDENT BRANCHEMPLOYEE PROPERTY OWNER CLIENT

13 Associative Entity of Dream Home Dream Home adalah perusahaan yang bergerak di bidang penyewaan rumah. Dream Home memiliki banyak cabang di masing-masing ibukota propinsi, dimana setiap cabang memiliki banyak pegawai. Setiap pegawai memperoleh asuransi kesehatan untuk dirinya dan keluarganya. Property didaftarkan oleh Owner. Setiap owner boleh mendaftarkan lebih dari satu propertinya. Setiap client boleh menyewa lebih dari satu property. Setiap client mendaftarkan preferensi tentang rumah yang dikehendakinya. Client mengetahui property yang disewakan dari iklan yang dipasang oleh perusahaan. Setiap rumah dapat dilihat oleh client. Jika client setuju untuk menyewa rumah tersebut, maka akan dilakukan perjanjian kontrak.

14 Associative Entity of Dream Home DEPENDENT BRANCHEMPLOYEE PROPERTY OWNER CLIENT LEASE VIEW ADVERTISE

15 15 Attributes •Attribute–property or characteristic of an entity or relationship type •Classifications of attributes: –Required versus Optional Attributes –Simple versus Composite Attribute –Single-Valued versus Multivalued Attribute –Stored versus Derived Attributes –Identifier Attributes

16 16 Simple and composite identifier attributes The identifier is boldfaced and underlined

17 17 Composite: An attribute broken into component parts Entity with multivalued attribute (Skill) and derived attribute (Years_Employed) Multivalued an employee can have more than one skill Derived from date employed and current date Composite, multivalued and derived attribute

18 18 Identifiers (Keys) •Identifier (Key)–An attribute (or combination of attributes) that uniquely identifies individual instances of an entity type •Simple versus Composite Identifier •Candidate Identifier–an attribute that could be a key…satisfies the requirements for being an identifier •Will not change in value •Will not be null

19 Attributes of Dream Home Entities BRANCH Branch_Id Branch_Address … EMPLOYEE Employee_Id Employee_Address … PROPERTY Property_Id Property_Address Types No_Of_Rooms … OWNER Owner_Id Owner_Address Owner_Telp … CLIENT Client_Id Client_Address Client_Telp Preferred_type … DEPENDENT Dependent_Name Date_Of_Birth …

20 20 Relationships •Relationship Types vs. Relationship Instances –The relationship type is modeled as lines between entity types…the instance is between specific entity instances •Relationships can have attributes –These describe features pertaining to the association between the entities in the relationship •Two entities can have more than one type of relationship between them (multiple relationships) •Associative Entity–combination of relationship and entity

21 21 Relationship types and instances a) Relationship type b) Relationship instances

22 22 Degree of Relationships •Degree of a relationship is the number of entity types that participate in it –Unary Relationship –Binary Relationship –Ternary Relationship

23 23 Cardinality of Relationships •One-to-One –Each entity in the relationship will have exactly one related entity •One-to-Many –An entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entity •Many-to-Many –Entities on both sides of the relationship can have many related entities on the other side

24 24 Degree of relationships Entities of two different types related to each other Entities of three different types related to each other One entity related to another of the same entity type

25 25 Examples of relationships of different degrees a) Unary relationships

26 26 Examples of relationships of different degrees (cont.) b) Binary relationships

27 27 Examples of relationships of different degrees (cont.) c) Ternary relationship Note: a relationship can have attributes of its own

28 28 Cardinality Constraints •Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity •Minimum Cardinality –If zero, then optional –If one or more, then mandatory •Maximum Cardinality –The maximum number

29 29 Examples of cardinality constraints a) Mandatory cardinalities A patient must have recorded at least one history, and can have many A patient history is recorded for one and only one patient

30 30 Examples of cardinality constraints (cont.) b) One optional, one mandatory An employee can be assigned to any number of projects, or may not be assigned to any at all A project must be assigned to at least one employee, and may be assigned to many

31 31 Examples of cardinality constraints (cont.) c) Optional cardinalities A person is married to at most one other person, or may not be married at all

32 32 Entities can be related to one another in more than one way Examples of multiple relationships a) Employees and departments

33 33 Examples of multiple relationships (cont.) b) Professors and courses (fixed lower limit constraint) Here, min cardinality constraint is 2

34 34 Multivalued attributes can be represented as relationships simple composite

35 TUGAS Kerjakan perkelompok didiskusikan hari Rabu depan


Download ppt "Modeling Data in the Organization Kuliah 3 Basis Data Disampaikan oleh: Annisa, M.Kom. Enrollment Key: basdat 2011."

Presentasi serupa


Iklan oleh Google