What are Attributes in DBMS?-Types of Attributes in DBMS
Attributes in DBMS are data fields that store information about objects or entities. They are often used to store additional information about a record, such as a person’s name, address, phone number, etc.
Simple Attribute
An attribute that cannot be subdivided into a smaller component is known as a simple attribute. It is also called the atomic attribute. For example, a person can have only gender and one date of birth.
Composite Attribute
Smaller components of a composite attribute are called composite attributes. For example, a name is an example composite attribute. It can be subdivided into streets, cities, and countries. Similarly, a phone number can be subdivided into area codes and numbers.
Single-Valued Attribute
Attributes that contain a single value are called “single-valued attributes”. For example, the Age of a person is a single-valued attribute. Another example of a single-valued attribute is gender.
Multi-Valued Attribute
A multi-valued attribute is an attribute that can contain more than one value. For example, a person can have multiple college degrees or an employee may have a variety of skills. This type of attribute is represented by a double-line oval in a diagram.
Stored Attribute
An attribute that is not stored in the database but derived from another value is called a derived attribute.
When it comes to data storage, there are two types of values – those that can be stored in a database, and those that can be derived from another source. For example, a student’s Roll No, Name and Date of Birth can be stored in the database. The age of a student can be calculated by taking the date of birth and subtracting it from the current date. A derived attribute is indicated by using an ellipse with a dashed line.
Identifiers
An identifier is an attribute that identifies an entity instance among other instances in an entity class. For example, there may be many instances of the STUDENT entity class. No two students are alike, and each one is identified by their unique Roll or Registration number. Similarly, an employee in the EMPLOYEE entity class is identified by his EmployeeID etc. These attributes are known as identifiers.
An identifier that has only one attribute is called a simple identifier. For example, the identifier for the STUDENT entity type would be just Student_ID. An identifier that consists of a composite attribute is called a composite identifier. For example, the OrderID identifier may consist of OrderNo and Date.
Identifiers can be unique or non-unique. A unique identifier may identify a set of instances. For example, EmployeeID is a unique identifier. It identifies a specific employee. But Department is a non-unique identifier. The non-unique identifier identifies all the workers who work in a particular department.
Leave a Reply