Mapping mapping


Download 460 b.
Sana28.07.2017
Hajmi460 b.
#12222



MAPPING

  • MAPPING

  • ER MODEL

  • EER (Enhanced /Extended Entity Relationship)

    • Superclass/subclass relationships
      • Shared Subclass
    • Generalization
    • Specialization
      • Specialization Hierarchy
      • Specialization Lattice
    • Attribute Inheritance
    • Etc










Entity sets that do not have sufficient attributes to form a key are called weak entity sets.

  • Entity sets that do not have sufficient attributes to form a key are called weak entity sets.

  • A weak entity set existentially depend upon (one or more) strong entity sets via a one-to-many relationship from whom they derive their key

  • A weak entity set may have a discriminator (or a partial key) that distinguish between weak entities related to the same strong entity

  • key of weak entity set = Key of owner entity set(s) + discriminator



Adalah set entitas yang tidak memiliki atribut kunci (key attributes)yang cukup.

  • Adalah set entitas yang tidak memiliki atribut kunci (key attributes)yang cukup.

  • Entias lemah ini bergantung kepada satu atau lebih entitas kuat menggunakan hubungan one-to-many

  • Suatu set entitas lemah memiliki kunci yang biasa disebut diskriminator. Fungsinya ?

  • Kunci dari set entitas = kunci dari entitas kuat yang berhubungan + diskriminator



The existence of a weak entity set depends on the existence of an identifying entity set.

  • The existence of a weak entity set depends on the existence of an identifying entity set.

    • it must relate to the identifying entity set via a total, one-to-many relationship set from the identifying to the weak entity set.
    • Identifying relationship depicted using a double diamond.
  • The discriminator (or partial key) of a weak entity set is the set of attributes that distinguishes among all the entities of a weak entity set.

  • The primary key of a weak entity set is formed by the primary key of the strong entity set on which the weak entity set is existence dependent, plus the weak entity set’s discriminator.



Keberadaan set entitas lemah tergantung dari set entitas kuatnya.

  • Keberadaan set entitas lemah tergantung dari set entitas kuatnya.

    • Gambar hubungannya dapat diidentifikasi dengan dobel diamond.
  • Diskriminator dari set entitas lemah adalah kumpulan atribut yang membedakan entitas yang ada dalam entitas lemah.

  • Primary key dari entitas lebah dibentuk dari primary key set entitas kuat ditambahkan dengan diskriminator.



Transaction is a weak entity set related to accounts via log relationship.

  • Transaction is a weak entity set related to accounts via log relationship.

  • Trans# distinguish different transactions on same account



Names of state are unique and form the key.

  • Names of state are unique and form the key.

  • Names of city are unique only within a state (e.g., 24 Springfield’s within the 50 states).

  • Names of streets are unique within a city. Multiple cities could have streets with the same name.



Reviewers review movie and assign a rating -- thumb up/thumbs down.

  • Reviewers review movie and assign a rating -- thumb up/thumbs down.

  • Review is a weak entity set whose owner sets correspond to both the movie and the reviewer entity sets.

  • Key for the review entity set = key of movie + key of reviewer



Double rectangles represent weak entity sets.

  • Double rectangles represent weak entity sets.

  • Discriminator of a weak entity set underlined with a dashed line.

  • payment-number – discriminator of the payment entity set

  • Primary key for payment – (loan-number, payment-number)



  • Note: the primary key of the identifying entity set is not explicitly stored with the weak entity set, since it is implicit in the identifying relationship.

  • If loan-number were explicitly stored, payment could be made a strong entity, but then the relationship between payment and loan would be duplicated by an implicit relationship defined by the attribute loan-number common to payment and loan.



We wish to represent that an employee works on a specific project possibly using multiple tools

  • We wish to represent that an employee works on a specific project possibly using multiple tools



Treat the relationship set work and the entity sets employee and projects as a higher level entity set-- an aggregate entity set

  • Treat the relationship set work and the entity sets employee and projects as a higher level entity set-- an aggregate entity set

  • Permit relationships between aggregate entity sets and other entity sets



Aggregation: Relationship will be mapped to a table,; extended with p.k. of participating entity set(s) + relationship + its own attributes ( if exists)

  • Aggregation: Relationship will be mapped to a table,; extended with p.k. of participating entity set(s) + relationship + its own attributes ( if exists)

  • Example:











Entity type describes:

  • Entity type describes:

    • Type of entity
    • The entity set
  • Example: ‘EMPLOYEE’

  • Employee can be sub-grouped into:

    • Secretary
    • Engineer
    • Technician
    • Manager
  • These are called the subclass of EMPLOYEE entity type.





EMPLOYEE entity type is the super class of engineer, secretary & technician class

  • EMPLOYEE entity type is the super class of engineer, secretary & technician class

  • Subclass represent the same mini-world entity of the superclass, but in a distinct specific role.

  • These are also called IS-A relationships (SECRETARY IS-A EMPLOYEE, TECHNICIAN IS-A EMPLOYEE, …).

  • Entity in a subclass must be a member of a superclass, but not vice-versa! Example…?





EER = ER + Generalisasi + Spesialisasi + Kategorisasi

  • EER = ER + Generalisasi + Spesialisasi + Kategorisasi

  • Superclass := set entitas yang umum dan memiliki relasi satu atau lebih subclass

  • Subclass := adalah sub-sub kelompok dari entitas yang berguna bagi organisasi. Subclass merupakan spesialisasi dari entitas superclass. Subclass mewarisi atribut dan relasi yang berkaitan dengan superclassnya.



An entity that is member of a subclass inherits all attributes of the entity as a member of the superclass

  • An entity that is member of a subclass inherits all attributes of the entity as a member of the superclass

  • It also inherits all relationships



Is a process of defining a set of subclasses of an entity type (the superclass)

  • Is a process of defining a set of subclasses of an entity type (the superclass)

  • Secretary, engineers, & technician are specialization of EMPLOYEE based on job type attribute



Proses pemecahan entitas menjadi subclass-subclass beserta atribut-atributnya.

  • Proses pemecahan entitas menjadi subclass-subclass beserta atribut-atributnya.

  • Terdapat beberapa jenis spesialisasi seperti Disjoint Total, Disjoint Partial, Overlapping Total dan Overlapping Partial.

  • Contoh : Spesialisasi dari PEGAWAI berdasarkan tipe pekerjaan.



May have several specialization based on different characteristics

  • May have several specialization based on different characteristics

  • Example, EMPLOYEE can be subclass-ed into Salaried_Employee and Hourly_Employee



Define a set of subclasses of an entity type

  • Define a set of subclasses of an entity type

  • Establish additional specific attributes with each subclass

  • Establish additional specific relationship types between each subclass and other entity types or other subclasses

  • Refer to the EER diagram…!





savings and checking are subclasses of the account entity set

  • savings and checking are subclasses of the account entity set

  • account is a superclass of savings and checking entity sets

  • An entity in a subclass has to belong to superclass as well -- that is, every savings account is also an account. Similarly every checking account is also an account

  • Attribute Inheritance: subclasses inherit all the attributes of the superclass. Similarly, subclasses inherit all relationships in which the superclass participates



Completeness Constraints: Whether an instance of a supertype must also be a member of at least one subtype.

  • Completeness Constraints: Whether an instance of a supertype must also be a member of at least one subtype.

    • Total Specialization Rule: Yes (Fig. 4-6a - note the double line convention)
    • Partial Specialization Rule: No (Fig. 4-6b - single line convention)






Disjointness Constraints: Whether an instance of a supertype may simultaneously be a member of two (or more) subtypes.

  • Disjointness Constraints: Whether an instance of a supertype may simultaneously be a member of two (or more) subtypes.

    • Disjoint Rule: An instance of the supertype can be only ONE of the subtypes
    • Overlap Rule: An instance of the supertype could be more than one of the subtypes








Subset symbol

  • Subset symbol

  • Specific attributes, or local attributes

  • Specific relationships

  • Superclass/subclass EMPLOYEE/Secretary resembles 1:1 relationship at the instance level, of one entity.















Identify common features (attributes), and generalize into a superclass

  • Identify common features (attributes), and generalize into a superclass

  • Example: truck & car can be generalized into VEHICLE

  • Inverse of the specialization process



Generalisasi adalah proses bottom-up dalam mendefinisikan dan melakukan generalisasi terhadap beberapa subclass menjadi satu entitas superclass.

  • Generalisasi adalah proses bottom-up dalam mendefinisikan dan melakukan generalisasi terhadap beberapa subclass menjadi satu entitas superclass.

  • Generalisasi merupakan proses untuk minimalisasi perbedaan antar entitas dengan mendefinisikan atribut yang sama.









Also called condition-defined subclasses

  • Also called condition-defined subclasses

  • Conditioned by a defining predicate at the superclass

  • Example, JobType = ‘Secretary’

  • Place attribute name on the arc





Membership is specified individually for each entity by the user

  • Membership is specified individually for each entity by the user

  • Not by any condition that may be evaluated automatically

  • Example: Manager subclass



Subclasses of a specialization must be disjoint

  • Subclasses of a specialization must be disjoint

  • An entity can only be at most one of the subclass

  • Look at the EER diagram

  • Use (d)



The same entity may be a member of more than one subclass of the specialization

  • The same entity may be a member of more than one subclass of the specialization

  • Use the (o)

  • Example, a person can be:





Total specialization:

  • Total specialization:

    • Every entity in the superclass must be a member of some subclass
    • Example, the Salaried_Employee and Hourly_Employee
    • Shown using double line


Partial specialization:

  • Partial specialization:

    • Allows an entity not to belong to any subclass
    • Example:
      • Manager
      • Job type
    • Use single line


Deleting entity from a superclass  deletes it also from the subclasses

  • Deleting entity from a superclass  deletes it also from the subclasses

  • Inserting in a superclass, when attribute defined is filled  must insert to the proper subclass as well

  • Inserting in superclass of total specialization  must insert into at least one subclass



Hierarchy: a subclass only participates in one class/subclass relationship

  • Hierarchy: a subclass only participates in one class/subclass relationship

  • Example: Vehicle with Car and Trucks

  • Lattice: a subclass can participate in more than one class/subclass relationship

  • Example: an Engineering Manager, must be an Engineer, and also a Manager!

  • The concept of multiple inheritance







a property or description of an entity

  • a property or description of an entity

  • a set of possible values for an attribute.

  • an object in the real world that is distinguishable from other objects such as the green dragon toy.

  • an association among two or more entities.

  • a collection of similar entities such as all of the toys in the toy department.

  • a collection of similar relationships

  • a key constraint that indicates that one entity can be associated with many of another entity.

  • an entity that cannot be identi.ed uniquely without considering some primary key attributes of another identifying owner entity.

  • is the least number of instances of an entity that can participate in an instance of a relationship



a property or description of an entity

  • a property or description of an entity

  • a set of possible values for an attribute.

  • an object in the real world that is distinguishable from other objects such as the green dragon toy.

  • an association among two or more entities.

  • a collection of similar entities such as all of the toys in the toy department.

  • a collection of similar relationships

  • a key constraint that indicates that one entity can be associated with many of another entity.

  • an entity that cannot be identi.ed uniquely without considering some primary key attributes of another identifying owner entity.

  • is the least number of instances of an entity that can participate in an instance of a relationship





Develop ER-Diagram based on following facts !

  • Develop ER-Diagram based on following facts !

    • Manufacturers have a name, which we may assume is unique, an address, and a phone number
    • Product have a model number and a type (e.g., television set). Each product is made by one manufacturer, and different manufacturers may have different products with the same model number. However, you may assume that no manufacturer would have two products with the same model number.
    • Customers are identified by their unique social security number. They have email addresses, and physical addresses. Several customers may live at the same (physical) address, but we assume that no two customers have the same email address.
    • An order has a unique order number, and a date. An order is placed by one customer. For each order, there are one or more products ordered, and there is a quantity for each product on the order.


?

  • ?







Download 460 b.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling