0% found this document useful (0 votes)
58 views

Database

The document discusses entity supertypes and subtypes in database design. It defines entity supertype as a conceptual model that represents a higher-level entity sharing attributes with lower-level subtypes. Reasons for using supertypes include abstracting common characteristics, reducing redundancy, and maintaining consistency and flexibility. The document also defines and provides examples of specialization hierarchies, subtype discriminators, overlapping and disjoint subtypes, and partial and total completeness in database design.

Uploaded by

prajwolsubedim1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Database

The document discusses entity supertypes and subtypes in database design. It defines entity supertype as a conceptual model that represents a higher-level entity sharing attributes with lower-level subtypes. Reasons for using supertypes include abstracting common characteristics, reducing redundancy, and maintaining consistency and flexibility. The document also defines and provides examples of specialization hierarchies, subtype discriminators, overlapping and disjoint subtypes, and partial and total completeness in database design.

Uploaded by

prajwolsubedim1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Week-5 Tutorial Advanced Data Modelling

1. What is an entity supertype, and why is it used?

An entity supertype is a conceptual model used in database design to represent a higher-level,


generalized entity that shares common attributes and characteristics with one or more lower-
level, specialized entities called subtypes. The supertype serves as a parent entity to its
subtypes and contains attributes and relationships that are common among those subtypes.

Some of the reason entity supertypes are used in database design are:

 To Abstract the Common Characteristics

 To reduce the redundancy by grouping common attributes and characteristics at a


higher level in the database schema.

 To maintain consistency. If changes need to be made to common attributes or


relationships, they can be done at the supertype level, ensuring that all subtypes
inherit the changes automatically.

 To maintain flexibility and scalability.

2. Describe what is meant by a specialisation hierarchy?

A specialization hierarchy in databases is a structure that arranges different types of data into
a family tree-like format. It's used to show how general categories, called supertypes (like
"employee"), relate to more specific ones, called subtypes (like "pilot" or "mechanic"). For
instance, all pilots, mechanics, and accountants are considered types of employees. Each
subtype inherits characteristics from its supertype. In this hierarchy, a subtype can only
belong to one supertype, but a supertype can have multiple subtypes. This arrangement keeps
data organized and understandable, allowing new subtypes to be added easily while
maintaining consistency across the database.

3. What is a subtype discriminator? Given an example of its use.

A subtype discriminator is the attribute in the supertype entity which is like a label that
helps identify which specific subtype an entity belongs to within a supertype. It's an
attribute in the supertype that holds information pointing to the subtype it corresponds to.
For example, in a Vehicle supertype, the subtype discriminator might be Type, and it
could have values like Car, Truck, or Motorcycle to indicate the specific type of vehicle.
So, when we look at a vehicle's record, the 'Type' attribute tells you whether it's a car,
truck, or motorcycle. This helps organize data and makes it easier to understand and
manage different types of entities within the database.

4. What is an overlapping subtype? Give an example.

An overlapping subtype is a subtype where the entities within it can also belong to other
subtypes of the same supertype. It means that one entity instance of the supertype can fit into
multiple subtypes simultaneously.

For example, Let's consider a database where Vehicle is the supertype. In this case, Car and
'Truck' might be subtypes. However, some vehicles, like pickup trucks, can be both cars and
trucks. Pickup trucks share characteristics of both cars and trucks. So, Car and Truck are
overlapping subtypes of the supertype 'Vehicle'. This overlap occurs because certain vehicles
possess attributes and functionalities that belong to both car and truck categories.

5. What is a disjoint subtype? Give an example

A disjoint subtype is a subtype where each entity instance of the supertype can belong to only one of the
subtypes; they don't overlap. In simpler terms, it means that each entity fits neatly into one subtype
category without being part of any other subtype. For example, consider a database where Vehicle is the
supertype. In this case, Car and Motorcycle can be subtypes. Each vehicle in the database must fit into one
of these categories exclusively.

For example, a specific vehicle instance, such as a sedan, can only be categorized as a 'Car' and not as a
'Motorcycle' at the same time. Similarly, a motorcycle instance cannot also be classified as a car. So, 'Car'
and 'Motorcycle' are disjoint subtypes of the supertype 'Vehicle'. This ensures that each vehicle in the
database is clearly categorized into one specific subtype without any overlap.

6. What is the difference between partial completeness and total completeness?

Partial Completeness: In a partially complete relationship, not every instance of the supertype
is required to be a member of a subtype. This means that there can be instances of the
supertype that do not fit into any of the defined subtypes. For example, in a 'Shape' supertype
with subtypes 'Circle' and 'Square', there might be other shapes that don't fit neatly into these
categories, such as a triangle or a polygon. These shapes would be considered instances of
the supertype but not members of any subtype.

Total Completeness: On the other hand, total completeness dictates that every instance of the
supertype must belong to at least one of the defined subtypes. In other words, there are no
instances of the supertype that are not accounted for in the subtype categories. Using the
same 'Shape' example, if the relationship is totally complete, every shape in the database
must be either a 'Circle' or a 'Square' or belong to another defined subtype. There are no
shapes left in the supertype that are not part of a subtype.

To sum up the partial completeness allows for flexibility, permitting instances of the
supertype to exist outside of defined subtypes, while total completeness requires that every
instance of the supertype must belong to a defined subtype.

7. Given the following business scenario, create a Crow’s Foot ERD using a
specialization hierarchy if appropriate.

Two-Bit Drilling Company keeps information on employees and their insurance


dependents. Each employee has an employee number, name, date of hire, and title. If
an employee is an inspector, then the date of certification and the renewal date for
that certification should also be recorded in the system. For all employees, the Social
Security number and dependent names should be kept. All dependents must be
associated with one and only one employee. Some employees will not have
dependents, while others will have many dependents.

You might also like