Entities and Attributes

 

Entities and Attributes

—  Entities are specific objects or things in the world that are represented in the database. For example the EMPLOYEE Prasad Yadav, the Research DEPARTMENT, the ProductX PROJECT

—  Attributes are properties used to describe an entity. For example an EMPLOYEE entity may have a Name, SSN, Address, Sex, BirthDate

—  A specific entity will have a value for each of its attributes. For example a specific employee entity may have Name=‘Prasad Yadav’, id=’123456789′, Address =’A 15 Reu Residency, Pune’, Sex=’M', BirthDate=’05-May-82‘

—  Each attribute has a value set (or data type) associated with it – e.g. integer, string, subrange, enumerated type, …

 

Entities

ž Entities with the same basic attributes are grouped or typed into an entity type. For example, the EMPLOYEE entity type or the PROJECT entity type.

ž An attribute of an entity type for which each entity must have a unique value is called a key attribute of the entity type. For example, Id of EMPLOYEE.

ž A key attribute may be composite. For example, VehicleTagNumber is a key of the CAR entity type with components (Number, State).

ž An entity type may have more than one key. For example, the CAR entity type may have two keys:

—  VehicleIdentificationNumber (popularly called VIN) and

—  VehicleTagNumber (Number, State), also known as license_plate number.

 

Weak Entity Types

ž An entity that does not have a key attribute

ž A weak entity must participate in an identifying relationship type with an owner or identifying entity type

ž Entities are identified by the combination of:

—  A partial key of the weak entity type

—  The particular entity they are related to in the identifying entity type

Example:

Suppose that a DEPENDENT entity is identified by the dependent’s first name and birhtdate, and the specific EMPLOYEE that the dependent is related to.  DEPENDENT is a weak entity type with EMPLOYEE as its identifying entity type via the identifying relationship type DEPENDENT_OF

 

 Attributes and relationship

 

Types of Attributes

ž Simple

—  Each entity has a single atomic value for the attribute. For example, Id or Sex.

ž Composite

—  The attribute may be composed of several components. For example, Address (Apt#, House#, Street, City, State, PIN Code, Country) or Name (FirstName, MiddleName, LastName). Composition may form a hierarchy where some components are themselves composite.

ž Multi-valued

—  An entity may have multiple values for that attribute. For example, Color of a CAR or PreviousDegrees of a STUDENT. Denoted as {Color} or {PreviousDegrees}.

ž In general, composite and multi-valued attributes may be nested arbitrarily to any number of levels although this is rare. For example, PreviousDegrees of a STUDENT is a composite multi-valued attribute denoted by {PreviousDegrees (College, Year, Degree, Field)}.

ž Another distinguished type of attribute is the derived attribute.  Unlike most attributes, whose values are stored, derived attributes have values that can be calculated from stored data.

 

 

Relationships and Relationship Types

ž A relationship relates two or more distinct entities with a specific meaning. For example, EMPLOYEE Prasad Yadav works on the ProductX PROJECT or EMPLOYEE Rahul manages the Research DEPARTMENT.

ž Relationships of the same type are grouped or typed into a relationship type. For example, the WORKS_ON relationship type in which EMPLOYEEs and PROJECTs participate, or the MANAGES relationship type in which EMPLOYEEs and DEPARTMENTs participate.

ž The degree of a relationship type is the number of participating entity types. Both MANAGES and WORKS_ON are binary relationships.

 

More Relationships and Relationship Types

ž We can also have a recursive relationship type.

ž Both participations are same entity type in different roles.

ž For example, SUPERVISION relationships between EMPLOYEE (in role of supervisor or boss) and (another) EMPLOYEE (in role of subordinate or worker).

ž In following figure, first role participation labeled with 1 and second role participation labeled with 2.

In ER diagram, need to display role names to distinguish participations.

 

 

 

 

 

Registration


A password will be e-mailed to you.

Feedback Form

Name (required)

Email (required)

Feedback