ER Model - Entities

ER Model – Entities

Table of Contents

What is Distinction between the Strong entity and the Weak entity?

Strong EntityWeak Entity
It will have the own Primary keythis don’t have the sufficient attributes to have own primary key
Represented by  the Rectanglerepresented by the double rectangle
projection of this entity subordinate, will be called as the dominant entity setmembers of this entity will be called as Entity set
Total participation may or may not be existedtotal participation will be existed for identifying relationship

Entity should be either living or non-living thing:

Entity set: entity set is the group of similar type of the entities, this will include all the entities with all the attributes which will share similar values.

Let’s consider an example, so that we can understand easily: staff set will include all the staff of the company from all employees

Attribute: this is the property of an object where the entities will be named by the properties of the database.

Let’s consider an example: employee name, employee age, employee salary, employee date of joining etc.

Types of attributes in the database are:

Totally its been five types of attribute which are been listed down:

  1. Simple attribute
  2. Composite attribute
  3. Derived attribute
  4. Single value attribute
  5. Multi value attribute
  • Simple attribute: in these attributes are like the atomic values which will not be break further or divided further. Simple attribute will be diagrammatically drawn by eclipse.

Attribute

Let’s consider an Example: suppose there is the staff phone number which will be have the atomic value of 10 digits which will be represented by the eclipse diagram.

  • Composite attribute: these are the attributes which are made up of more than one simple attribute is called as composite attribute

Let’s consider an so that it will be easy to understand Example: staff name may divide as first name and last name as shown in the below diagram

  • Composite attribute Derived attribute in this attribute which are basically not represented in the database, but the values will be derived from the other attribute which is been present in the database which is represented by the dazed eclipse.

Let’s consider an example: average salary in department cannot be saved directly in database instead we can derive it from the table.

  • Single value attribute: this will contain the attributes which has single values which will be represented by eclipse with underline in it

Example: employee ssn, student ssn

Key attribute or single value attribute

  • Multi value attribute: this type of attribute will contain more than one values and it’s represented by the double eclipse.

Let’s consider an example so that we can understand example: staff can have more than one phone number and also the mail address

Key: this is the single attribute which will uniquely identifies the row 

Let’s consider an Example: employee id

Types of keys are been listed:

  1. Super key: these are the set of attributes which will collectively identify the entity as well as entity the set where the combination of values will be unique for all the lines of the database.
  1. Candidate key: this is the candidate key which has minimal super key which will be known as the candidate key. Entity set will contains more than one candidate key which will be minimum number of columns which will uniquely identify single row.

Let’s consider an Example so that it will be easy to understand : employee id will be always unique in employee table.

  1. Primary key: the primary key, the super key will be identifying the single row of the database which will be known as the primary key.

Let’s consider an Example: employee id will be unique in the table.

  1. Foreign key: the foreign key it defines the connection between two tables of the database
  1. Alternate key: the table which will be more than one candidate key after its been choosing primary key from those candidate key will be called as the alternate key

 Questions

  1. What is entity? Explain types
  2. What is attribute? Explain types
  3. What is super key and foreign key?
  4. What is alternate key explain?
Share this article