Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Tutorial 3

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Tutorial 3

1. Matching

1. Supertype D a. subset of supertype


2. entity cluster F b. entity belongs to two subtypes
3. subtype A c. subtype gets supertype attributes
4. specialization E d. generalized entity type
5. discriminator G e. creating subtypes for an entity type
6. attribute inheritance C f. a group of associated entity types and
7. overlap rule B relationships
g. locates target subtype for an entity

2. Contrast the following term


a. Supertype, subtype.
-  Supertype: A generalized entity type that contains attributes common to one or
more subtypes. It represents a broad category.
Supertype Example: Vehicle
- A vehicle can be broadly defined as any mode of transport.
 Subtype: A more specific entity type that inherits attributes from its supertype and
may have additional attributes unique to itself. It represents a subset of the supertype.
Subtype Example: Car and Truck
- A Car subtype might have attributes like “number of seats,” while a Truck
subtype might have attributes like “cargo capacity.” Both inherit common
attributes from the Vehicle supertype, such as “manufacturer” and “engine
type.”

b. Generalization; specialization
Generalization: The process of combining several subtypes into a single supertype,
focusing on shared attributes. It's an upward abstraction, moving from the specific to
the general.
-  Generalization Example: Payment Method
 Combining Credit Card, PayPal, and Bank Transfer into a generalized entity called
Payment Method.
 Specialization: The process of dividing a supertype into one or more subtypes, focusing
on distinct attributes. It's a downward abstraction, moving from the general to the
specific.
 Specialization Example: Employee
 Dividing an Employee entity into subtypes such as Full-Time Employee and Part-Time
Employee based on their work hours and benefits.

c. Disjoint rule; overlap rule


Disjoint Rule: An entity instance can belong to only one subtype. There’s no overlap
between subtypes.
-  Disjoint Rule Example: Employee Roles
 An employee can be classified as either a Manager or a Staff Member but not both
simultaneously.
 Overlap Rule: An entity instance can belong to more than one subtype. There is overlap,
meaning an entity can simultaneously fit into multiple subtypes.
 Overlap Rule Example: University Courses
 A course might be classified as both an Undergraduate Course and a Graduate Course if
it’s available to students from both levels.

d. Total specialization rule; partial specialization rule


Total Specialization Rule: Every instance of the supertype must be a member of at
least one subtype. It’s a mandatory relationship.
-  Total Specialization Rule Example: Animal Species
 Every Animal must be classified as either a Mammal, Bird, Fish, etc. There’s no animal
that doesn’t belong to a specific category.
 Partial Specialization Rule: An instance of the supertype may or may not be a member
of any subtype. It’s an optional relationship.
 Partial Specialization Rule Example: Electronics
 An Electronic Device could be classified as a Mobile Device or a Home Appliance, but
some devices (like a generic Gadget) may not fit into any specific subtype.

e. Party; party role


Party: A general term for an entity that can participate in various relationships, such as a person,
organization, or group.
 Party Example: Person
o In a customer relationship management system, a Person could be an individual
entity.
Party Role: The specific function or part a party plays in a particular context or
relationship, such as a customer, supplier, or employee.
 Party Role Example: Customer and Supplier
o The same Person could play different roles, such as being a Customer when
purchasing products and a Supplier when selling goods.

f. Entity; entity cluster


 Entity: A single object or thing within the system that has a distinct existence and is
distinguishable from other objects.
Entity Example: Product
 In an e-commerce system, a Product is an individual item available for sale.

 Entity Cluster: A group of related entities that are associated with each other, often used
to simplify the design by grouping closely related entities and their relationships.
Entity Cluster Example: Order
 An Order might cluster entities like Customer, Product, and Payment Details,
representing a group of related entities that collectively define a complete transaction.

3. Draw ER diagram for the following situation:


A university has a large number of courses in its catalog. Attributes of COURSE include
Course_Number (identifier), Course_Name, and Units. Each course may have one or
more different courses as prerequisites, or may have no prerequisites. Similarly, a
particular course may be a prerequisite for any number of courses, or may not be
prerequisite for any other course.
4. Draw ER diagram for the following situation:
There are only three types of accounts in a bank, with these attributes:
 Checking: Acct-no, Date-opened, Balance, Service-charge
 Savings: Acct-no, Date-opened, Balance, Interest-rate
 Loan: Acct-no, Date-opened, Balance, Acct-limit
5. Draw an EER diagram for the following problem
A nonprofit organization depends on a number of different types of persons for its
successful operation. The organization is interested in the following attributes for all of
these persons: SSN, Name, Address, City/State/Zip, and Telephone. Three types of
persons are of greatest interest: employees, volunteers, and donors. Employees have only
a Date Hired attribute, and volunteers have only a Skill attribute. Donors have only a
relationship (named Donates) with an Item entity type. A donor must have donated one or
more items, and an item may have no donors, or one or more donors. There are persons
other than employees, volunteers, and donors who are of interest to the organization, so
that a person need not belong to any of these three groups. On the other hand, at a given
time a person may belong to two or more of these groups (e.g., employee and donor).
6. Companies, identified by Company ID and described by Company Name and Industry
Type, hire consultants, identified by Consultant ID and described by Consultant Name,
Consultant Specialty, which is multivalued. Assume that a consultant can work for only
one company at a time, and we need to track only current consulting engagements. Draw
an ERD for this situation.
Now, consider a new attribute, Hourly Rate, which is the rate a consultant charges a
company for each hour of his or her services. Now, consider that each time a consultant
works for a company, a contract is written describing the terms for this consulting
engagement. Contract is identified by a composite identifier of Company ID, Consultant
ID, and Contract Date. Assuming that a consultant can still work for only one company at
a time. Redraw ERD to reflect changes.

7. A laboratory has several chemists who work on one or more projects. Chemists also may
use certain kinds of equipment on each project. Attributes of CHEMIST include
Employee ID (identifier), Name, and Phone No. Attributes of PROJECT include Project
ID (identifier) and Start Date. Attributes of EQUIPMENT include Serial No and Cost.
The organization wishes to record Assign Date—that is, the date when a given equipment
item was assigned to a particular chemist working on a specified project. A chemist must
be assigned to at least one project and one equipment item. A given equipment item need
not be assigned, and a given project need not be assigned either a chemist or an
equipment item. Provide good definitions for all of the relationships in this situation.

You might also like