What is the difference between a supertype and a subtype entities




















Entity Supertypes and Subtypes:. Because most employees possess a wide range of skills and special qualifications, data modelers must find a variety of ways to group employees based on employee characteristics. For instance, a retail company could group employees as salaried and hourly employees, while a university could group employees as faculty, staff, and administrators. The grouping of employees to create various types of employees provides two important benefits:.

In modeling terms, an entity supertype is a generic entity type that is related to one or more entity subtypes, where the entity supertype contains the common characteristics, and the entity subtypes contain the unique characteristics of each entity subtype.

Based on this scenario, employee entity can be further classified under different subtype entities like HR employee, IT employee etc. A person can open a savings account or a certificate deposit fixed deposit in a bank. These accounts have attributes like account number, account opening date, account expiry date, principal amount, maturity amount, account balance, interest rate, checks issued, pre-cancellation fee etc.

Account entity will store attributes like account number, interest rate that are common to savings account and certificate deposit entity. Savings account entity will have attributes like account balance and checks issued.

While fixed deposit entity will have attributes like account opening, account expiry date, principal amount, maturity amount, pre-cancellation fee etc. When you design a logical data model in this manner, it provides more meaning to the business and the attributes are not cluttered in one table.

Each supertype and subtype of entities is implemented by a corresponding table. Table fields are attributes of this type of entity. The disadvantages of using subtypes of entities are that the overall development of the database is complicated. The difficulties are as follows:. Entity subtypes.

Advantages and disadvantages of using subtypes of entities Before studying this topic, it is recommended to familiarize yourself with the following topic: The concept of ER-model. The concept of entity. Attribute type Contents 1. What is an entity subtype? What are entity subtypes used for? Example 2. What is an entity supertype? How can entity subtypes be related together? Example 4. What are the disadvantages of using subtypes of entities in database developing?

What are the advantages of using entity subtypes when designing databases?



0コメント

  • 1000 / 1000