Entity and its Types – Strong Entity, Weak Entity, Composite Entity
An entity is an object that are represented in the database. For example Mohit, Vasu, CSE306 etc.
An entity is represented or defined by set of attributes. Attributes are the properties used to describe an entity. For example, a STUDENT entity may have a Name, Roll number, Class, Marks etc. where STUDENT is the entity and name roll number class marks are the attributes.
Types of Entity –
- Strong Entity Types
- Recursive Entity Types
- Weak Entity Types
- Composite Entity Types or Associative Entity Types
- SuperType and SubType Entities
Notations Of different Entity Type in ER Diagram
|Strong Entity Type|
|Weak Entity Type|
|Recursive Entity Type|
|Composite Entity Type (or)
|Subtypes and Supertypes|
Strong Entity Type – are the entities which has a key attribute in its attribute list or a set that has a primary key. The strong entity type is also called regular entity type. For Example,
The Student’s unique RollNo will identify the students. So, RollNo is set to be the Primary Key of the STUDENT entity, & Hence STUDENT is a strong entity type because of its key attribute.
Recursive Entity Type – It is also called Self Referential Relationship Entity Type. It is an entity type with foreign key referencing to same table or itself. Recursive Entity Type occurs in a unary relationship.
For example, a supervisor and subordinate relationship sets – One Supervisor can supervise multiple subordinates but each subordinate reporting to atmost one supervisor.
In example b) An employee supervises another employee. Let the employee who supervises another one is manager. So, Manager supervises employees. But a manager is also an employee, whose details are in the employee entity. So, to implement this, a foreign key of the employee’s manager number would be held in each employee record i.e “supssn”.
So, the employee entity will contain its attributes as –
- Employee ID (subssn)
- Employee FirstName
- Employee Lastname
- Employee DateofBirth
- and Manager Number (i.e. employee number of the employee’s manager) – (supssn)
The next figure will clear you the employee entity as a recursive entity –
If M:M ==> Reports_To(supssn,subssn) then 2 tables are made.
Weak Entity Type –
Entity Type with no key or Primary Key are called weak entity Type.
The Tuples of weak entity type may not be possible to differentiate using one attribute of weak entity.For every weak entity, there should be unique OWNER entity type. In the below example, CHILD is a WEAK entity type and Employee is the OWNER entity type.
Example of weak entity type is –
Children Entity is depending upon Strong Entity Employee(as it has a unique ID named SSN). The relationship is established to associate children with their parents for insurance coverage.
Attributes of CHILDREN entity are-
- CNAME (name of Child)
- Age of Child
- Type of Insurance
So, None of the attributes of CHILDREN does not give a unique ID to the entity. And the CHILDREN Entity has to depend on EMPLOYEE entity for identification.
The next table will clear you the child entity as a weak entity and so is represented with employee id(SSN) –
Maximum number of tables = 2
Minimum number of tables = 2
Some Points about weak entity Type –
1) Weak entity Type should always combines with weak relationship set for database schema relation. 2) Relationship between OWNER ENTITY Type and Weak Entity Type is also partial. 3) Participation between weak entity Type and relationship is always TOTAL 4) Cardinality can be Many to Many or One to Many.
Composite Entities –
If a Many to Many relationship exist then we must eliminate it by using composite entities. Composite Entities are the entities which exists as a relationship as well as an entity. The many to many relationship will be converted to 1 to many relationship.
Composite Entities are also called Bridge Entities, because they acts like a bridge between the two entities which have many to many relationship.
Bridge or Composite entity composed of the primary keys of each of the entities to be connected.
A composite entity is represented by a diamond shape with in a rectangle in an ER Diagram.
Supertypes and Subtypes Entities –
A subtype is a subprouping of the entities in an entity type that is meaningful to the organisation. For example, In a University, a STUDENT is an entity type. Two subtypes of STUDENT entity are
- GRADUATE STUDENT
- UNDERGRADUATE STUDENT
A supertype is a generic entity type that has a relationship with one or more sub-types. In the above example, STUDENT entity is a supertype.
|Relationship Constraints in DBMS||Identifying and Non Identifying Relationships|
Incoming search terms:
- entity types in dbms
- Entity in dbms
- Types of entity in DBMS
- entity type in dbms
- types of entities in DBMS
- types of entity
- what is entity in dbms
- types of entity in database
- types of entities in database
- entity and its types