DBMS-Introduction to DBMS-1.4-Attribute-SPPU

 Attribute

Attribute: An attribute is a characteristic of an entity. Entities are represented using their

attributes. All attributes have their own specific values. 

For example, an employee entity may have. Employee ID, emp_name, and salary as attributes.

In a database management system, an attribute is a database component, such as a field or column of a

table.

Example:

The entity student has attributes like student_id and student_name. In this, every attribute has a value. Here

101 is the value for the attribute student_id, and Kunal is the value for the attribute student_name.

10

Name

Student

ID

Contact no


There are five different types of attributes in a Database Management System :

1. Single-valued Attribute:

-A single-valued attribute is the attribute that can hold a single value for a single entity.

-Example: In the entity Student, student_name is the single-valued attribute since a student has a single value for the name attribute.

2. Multi-valued Attribute:

-A multi-valued attribute is an attribute that can hold multiple values for a single entity.

-Example: In the entity student, the attribute student_contact no could be considered a multi-value attribute since a student could have multiple contact numbers.

3. Simple Attributes :

-An attribute whose value cannot be further divided is known as a simple attribute. That means it is atomic in nature.

-Example  In the entity student, the attribute student_age cannot be divided. Therefore student_age is the simple attribute of the student entity.

4. Composite Attribute:

-The composite attributes are the attri Utes which can be further divided into sub Parts. These subparts represent the basic entities with their independent meaning.

-Example In the entity student, student_name is the composite attribute, we can divide this attribute into Q free into different sub-parts: First_name, ddle_name •, and Last_name.

5. Derived Attribute:

-The attribute which does not physically exist in the database, but its value can be calculated from the other present attributes is known as a derived attribute.

-Example: In the entity student, we can calculate the average age of students. This average age is not physically present in the database but it can be derived from the attribute student_age;


- Relationships

The association between two different entities is called a relationship. In the real-world application, what does one entity do with the other, and how do they connect to each other

For example,    An employee works at a department, or a student.no enrolls in a course. Here, works at and Enrolls are called relationships.

The Degree of Relationships

The degree of relationship refers to several entities that participated in the relationship.

1. Unary Relationship

- A unary relationship exists when there is a relation between a single entity. A unary relationship is also known as a recursive relationship in which an entity relates to itself.

- Example:  A  person can be in a relationship with another person, such as:-

- A woman who can be someone's mother

- A person that is someone's child.

2. Binary Relationship

- A binary relationship exists only when there is a relationship between only two entities. In this case, the regret: of radiation is two.

- Example: A teacher teaches students. In this teacher and student are two different entities which are connected with each other via. - relation Teaches.

3. Ternary Relationship

- A ternary relationship exists when there are relations between three entities. In ternary relation, the degree of relation is six.

- Example: A person can be a student and a person also can be a Her teacher. Here teac, her, student, and person are three entities that are related to each other.

4. Quaternary Relationship

- A quaternary relationship exists when there are relations between four entities. In quaternary relation, the degree of relation is eight.

- Example: The· four entities ·Employee, Management Faculty, Teaching Faculty, and Non-Teaching Faculty are connected with each other via a relationship.



Comments