Entity in DBMS
Entity
- Entities are objects/concepts/nouns, e.g. customer, supervisor, location, or promotion.
- An entity represents real-world objects which are easily identifiable.
- Example:- in a school database, students, teachers, classes, and courses are entities.
- All these entities have some attributes or
properties for identity.
- Entities are represented by rectangles.
Properties of entity
- 1. Represented by a set of
properties, called attributes.
- 2. It is atomic (can’t
break into smaller parts).
- 3. Represents real-world items.
- 4. Instance of entity types
- 5. Define in a rectangle box.
- Types of entities: -
1. 1. Strong entities
- Independently from other entity types.
- Have owned one or more attributes that uniquely distinguish each other.
- Has own primary key/ keys.
2. Weak entities
- Depend on some other entity
type.
- Another entity is known as the owner.
- Don't have own primary key.
3. 3. Associative entities
- Entities, which are associated with the instances of one or more entity types.
- Contain attributes that are unique to the
relationship.
4. Composite Entity:
- Entities, participating in the many to many relationships.
- In this case, two or more entities are part of the relation.
- create a primary key by using the primary keys of the other two entities.
- Example:- multiple students enrolled in multiple courses so we create student, course, and enrolment tables. In relation to ‘Enrolment’, we create STUD_COURSE table and add primary keys of student and course tables. These keys create a composite primary key in the enrolment table.
5. 5. Recursive
Entity:
- If a relationship exists between the same entities, then it is called a recursive entity.
- example, HOD of the department is another example of having a recursive entity.
Examples of entities:
- Person: Employee,
Student, Patient
- Place: Store,
Building
- Object: Machine,
product, and Car
- Event: Sale,
Registration, Renewal
Entity set
- It
is a collection of similar types of entities.
- It contains entities with attributes for sharing similar values.
- Example, a student set contains all the students of a school; a teachers set contains all the teachers of a school from all faculties.
Difference
between a weak entity and a Strong Entity
Strong Entity Set |
Weak Entity Set |
Have a primary key. |
Not have a primary key. |
Represented by a rectangle symbol. |
Represented by a double rectangle symbol. |
The primary key is represented by the underline symbol. |
Contains a Partial Key, represented by a dashed underline
symbol. |
The member of a strong entity set is called a dominant
entity set. |
The member of a weak entity set is called a subordinate
entity set. |
Primary Key is most attributes which help to identify its
member. |
a combination of primary key and partial key of the strong
entity set. |
the relationship between two strong entities set is shown by using
a diamond symbol. |
The relationship between one strong and a weak entity set is shown by using the double diamond symbol. |
The connecting line of the strong entity set with the
relationship is single. |
The line connecting the weak entity set for identifying
relationships is double. |
================================================================
0 Comments