Saturday, 22 February 2014

Object-Based Logical Model

The ER model:
Views the real world as a collection of objects or entities and the relationship among them.

An entity:
Is any object, place, person, or activity about which the data is recorded.
Can be categorized as entity type and entity instance.

An entity can be of the following types:
  1. Dependent entity
  2. Independent entity

A relationship is:
  1. Defined as an association among entities.
  2. Depicted in a diamond shaped box with the name of the relationship type inside it.  

The following diagram depicts a relationship between the entities (TEACHER and STUDENT).
---------------------------------------------------------------------------------------------------------
  • Consider the following statement:

      “A supplier ships certain parts.”
      Identify the entities and the relationship which exists  
      between them.

Entities: SUPPLIER and PARTS
     Relationship: SHIPS

Entities: SUPPLIER and SHIPS
     Relationship: PARTS

Entities: PARTS and SHIPS
     Relationship: SUPPLIER

Entities: SUPPLIER, PARTS, and SHIPS
     Relationship: SUPPLIES

Solution:
Entities: SUPPLIER and PARTS
    Relationship: SHIPS
----------------------------------------------------------------------------------------------------
The three types of relationships are:
  1.  One-to-One
  2.  One-to-Many (or Many-to-One)
  3.  Many-to-Many

An attribute:
  • Is a property of a given entity.
  • Is depicted as ellipses, labeled with the name of the property. 
----------------------------------------------------------------------------------------------

An attribute is a property of a given entity, which is depicted as ___________, labeled with the name of the property.

Solution:
ellipses
--------------------------------------------------------------------------------------------

Consider the following statement:
     A supplier ships certain parts. A particular part is not necessarily   
      supplied
by only one supplier. No supplier supplies only a single  
      part.”
      What type of relationship is possible between the two
      entities?
One-to-One relationship
One-to-Many relationship
Many-to-Many relationship

Many-to-One relationship

Solution:
Many-to-Many relationship
--------------------------------------------------------------------
A subtype:
  • Is a subset of another entity.
  • Is always dependent on the supertype for its existence.

The attributes of a supertype apply to all of its subtypes.

The following diagram depicts the relationship between supertype (COURSE) and subtypes (STANDLONE and SEMESTER).


---------------------------------------------------------------------------------------------------

There are two types of suppliers. One type of supplier allows credit, while the other type insists on payment in cash before delivery. The manufacturer wishes to maintain separate information on these two types of suppliers. For the credit supplier, “credit period” and “credit limit” have to be recorded. For the cash supplier, “date of payment” has to be stored. Identify the subtype and supertype entities.
Subtypes: Suppliers and Cash
     Supertype: Credit
Subtype: Credit
     Supertypes: Cash and Suppliers
Subtypes: Cash and Credit
     Supertype: Suppliers
Subtype: Suppliers
     Supertypes: Cash and Credit

Solution:
Subtypes: Cash and Credit
     Supertype: Suppliers

No comments:

Post a Comment