What has only a single value of each attribute of an entity?

There are various Database attributes types in the Database management system. But before going through the types we must understand the meaning and purpose of attributes.

An attribute provides the characteristics of the entity. In other words, an attribute describes the property of an entity. Each entity consists of one or more attributes.

Database Management System (DBMS) consists of ER model. The full form of ER model is the Entity-Relationship model. We use ER model to describe the data elements and their relation with the specified system.

The ER model consists of entities and attributes. An entity can be an object, person, or place. In the ER model, we represent Entity as rectangles. For example, In an organization, we can take employees, departments, executives, as an entity.

Attributes give us additional information about the entity. It describes the property of an entity. In the ER model, we represent the Attributes as an Eclipse. For example, If Employee is an entity, employee id, contact number, name, date of joining, etc can be the attributes of an employee.

There are 5 different types of attributes in DBMS.

Simple Attributes

Simple Attributes are independent attributes that cannot be classified further. In other words, it is also known as atomic attributes.

For example, a Student is an entity that consists of attributes Roll No, Age, Class. Here, we cannot divide the Roll no attribute into sub-attributes. Therefore, if we cannot divide the attribute further then it is a Simple Attribute.

Composite Attribute

When it is possible to divide the attributes into different components then that attribute is called a Composite Attribute. We divide Composite Attribute into sub-parts that form simple attributes.

For example, If Name is an attribute for Student entity. We can divide the Name attribute into first name, middle name, last name attributes. These sub-attributes that are classified from the composite Attribute works as Simple Attributes.

Single Valued Attributes

Attributes stores values that are used to describe the entity. The attributes which are able to store only one value are known as Single Valued Attributes. These attributes cannot store more than one value.

For example, The attributes of an Employee entity are Employee id, DOB, Gender. An employee has only one employee id which is unique and it also has a single date of birth. So these attributes can store only one value in it. Therefore, it is known as Single Valued Attributes.

The attributes which are able to store more than one value are known as Multi-Valued Attributes.

For example, let’s assume Email id and Contact No are the attributes of the Employee entity. An employee can provide more than one email id and contact no. Therefore multiple values can be stored in Multi-Valued Attributes.

Derived Attributes

The name itself describes the attribute. Derived attributes are those attributes that are derived from the value of another attribute.

For example, We can calculate the age from the date of birth value. Therefore Age attribute can be derived from the DOB attribute.

Key Attributes

Every entity has a special attribute that holds a unique value to identify the entity in the entity set. The value of key attributes must be unique and cannot be used again.

For example, Employee id is the key attribute for employee entity, Roll No is the key attribute for Student entity, and Pincode is the key attribute for the place attribute.

Besides DBMS there are different database attributes types in Data Mining. Data Mining is a computational process of analyzing the data. It gathers more information about the data. It is also referred to as knowledge extraction of the data.

In Data Mining there are Data objects which act as an entity and these entities have various types of data attributes. A group of attributes of an entity forms a data object. It has a different concept as compared to DBMS. when a data object is ready to be used in a database, the data object is called data tuples.

There are 3 main phases in Data Mining. Data Pre-processing, Data Extraction, Data Evaluation. Data Mining uses data objects and attributes in the first phase of Data Pre-processing. The Database divides the attributes into two main categories.

There are 3 types of attributes that describe the quality of the entity.

Nominal (N)

Nominal attributes consist of names. It also describes the category or state of the attribute. It does not follow any order or sequence.

For example, Assume the Attributes is Colours, the values of this attribute can be Black, Brown, White.

Binary Attributes (B)

Binary attributes consist of only two values. For example, Pass and Fail, Agree and Disagree, etc.

There are two different types of Binary attributes. Symmetric Binary attributes occur when both the values are important. For instance, Gender has two values Male and Female both the values are equally important. Asymmetric Binary attributes occur when both the values are not important. For instance, In the Result attribute, Pass and Fail are not equally important.

Ordinal Attributes (O)

The values in the Ordinal Attributes must follow a meaningful sequence. Ordinal Attributes are attributes when the order of values is sequential and describes what is important.

For example, the attribute Grade has values A, B, C, D, E, F.

There are 3 different types of data that describe the quantity of the entity.

Numeric

A numeric data consists of integers. It is a subcategory of Quantitative Attributes because it can be measurable. There are two different types of Numeric Data.

The interval-scaled attribute consists of numeric values. The difference between the two values is meaningful. We can add or remove the data at an interval but we cannot multiply the data.

The ratio-scaled attribute consists of values that are multiples or ratios of another value. The values must be in a sequence. We can also calculate the mean, median, and differences of the values.

Discrete

Discrete data consist of both Numerical and Nominal values. The main feature of this data is that it has a finite set of values.

For example, Zipcode attributes consist of a finite set of numerical values.

Continuous

Continuous data consist of an infinite set of values. The values of this data are in float type. For example, if height is an attribute the values will be 5.2, 6.4, 7.2, ….etc.

Conclusion

Attributes are describing the entity. It consists of values. We have also seen various types of attributes. In DBMS there are different types of attributes that store the values for the Entity. In the ER model, attributes are also important to describe the entity-relationship.

We have also seen the use of Attributes in data mining. The Pre-processing phase of Data Mining consists of Data objects and Attributes. Without attributes, we cannot define the Entity and it will be impossible to choose the entity in an entity set with unique attributes.

You may also like to read: Pros and Cons of Data Mining Explained

Entity Relationship Model

Definition: ER Model is a popular high level conceptual data model. ER model describes the data as entity relationships and attributes. The basic objects that the ER model represents are an entity and attributes. This model and its variations are frequently used for the conceptual design of database applications, and many database design tools employ its concepts. The diagrammatic notation of ER Model is known as ER Diagram.

Entity Relationship Diagram

Definition: An entity-relationship (ER) diagram is a specialized graphic or graphical representation of ER model that illustrates the interrelationships between entities in a database. ER diagrams often use symbols to represent three different types of information. Boxes are commonly used to represent entities. Diamonds are normally used to represent relationships and ovals are used to represent attributes of entity.

What has only a single value of each attribute of an entity?

Entity

Definition: - Entity is a thing in the real world with an independent existence. Entity is the basic component of ER diagram. An entity may be an object with a physical existence (for example a particular parson, car, house, or employee) or it may be an object with a conceptual existence (for example a company, job, or university course). The graphical representation of entity is a rectangle for example person and city both are the entities in above ER diagram.

Attribute

Definition: - Attributes are the property of entity which describes to the entity. Each entity has attributes. The graphical representation of attribute is an oval. A particular entity will have a value for each of its attributes. For example an employee entity may be described by the employee’s name, age, sex, address, salary, and job.

In the above figure the name is the attribute of entity person and population is the attribute of Entity city.

Types of Attributes

Attributes are of the following types:-

  • Simple and composite attributes
  • Single value and multi value attributes
  • Stored and derived attributes

Simple and composite attributes

Composite attributes

Composite attributes can be divided into smaller subparts. These subparts represent the basic attributes with independent meanings of their own. For example, take Name attributes. We can divide it into sub-parts like First_name, Middle_name, and Last_name.

What has only a single value of each attribute of an entity?

Simple attributes

Attributes that can’t be divided into subparts are called Simple or Atomic attributes. For example, Employee Number is a simple attribute. Age of a person is a simple attribute.

Single valued and multi valued attributes

Single Valued attribute

Attributes that can have single value at a particular instance of time are called single valued. A person can’t have more than one age value. Therefore, age of a person is a single-values attribute.

Multi valued attributes

A multi-valued attribute can have more than one value at one time. For example, degree of a person is a multi-valued attribute since a person can have more than one degree. Where appropriate, upper and lower bounds may be placed on the number of values in a multi-valued attribute For example, a bank may limit the number of addresses recorded for a single customer to two. Such attributes are represented by double ovals in ER diagram.

Stored and derived attributes

Stored attributes

The stored attribute are such attributes which are already stored in the database and from which the value of another attribute is derived is called stored attribute. For example age of a person can be calculated from person’s date of birth and present date. Difference between these two dates gives the value of age. In this case, date of birth is a stored attribute and age of the person is the derived attribute

Derived attributes

The derived attributes are such attributes for which the value is derived or calculated from stored attributes. For example date of birth of an employee is the stored attribute but the age is the derived attributed. Derived attributes are usually created by a formula or by a summary operation on other attributes. Take another example, if we have to calculate the interest on some principal amount for a given time, and for a particular rate of interest, we can simply use the interest formula 

Interest=(N*P*R)/100; 

In this case, interest is the derived attribute whereas principal amount (P), time (N) and rate of interest(R) are all stored attributes.

Entity Type, Entity Set, Keys, Value Set

Entity Type

An entity type defines a collection (or set) of entities that have the same attributes. Each entity type in the database is described by its name and attributes.

What has only a single value of each attribute of an entity?

In the above figure there are two entities types named employee and company with the list of attributes. The entity type describes the schema or instance for a set of entities that share the same structure.

Entity set

The collection of all entities of a particular entity type in the database at any point of time is called an entity set or extension of the entity type.

Key Attributes

An important constraint on the entities of an entity type is the key or uniqueness constraint on attributes. An entity usually has an attribute whose values are distinct for each individual entity in the entity set. Such an attribute is called a key attribute, and its values can be used to identify each entity uniquely. In diagrammatic notations each key attribute is represented by underlined attribute inside the oval. For example in the following figure name is the key attribute of the company.

What has only a single value of each attribute of an entity?

Value sets of attributes

Each simple attribute of an entity type is associated with a value set (or domain of values), which specifies the set of values that may be assigned to that attribute for each individual entity. For example if the range of ages allowed for employees is between 16 and 70. Similarly we can specify the value set of the age attribute of employee entity type to be the set of integer number between 16 and 70, similarly we can specify the value set for the name attribute as being the set of alphabetic characters separated by blank space character and so on.

Weak Entity or Weak Entity Type

Weak Entity

Entity types that do not have any key attribute of their own are called week entity type. Week entity type is represented in ER diagram by double rectangle like