Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
MySQL + SQL · Lesson 24

Entity, Relationship and Attribute Types in DBMS

In this lesson: Entity types, relationship types and attribute types — simple, composite, derived, multivalued, key — with diagrams.

The three building blocks

The ER model is built from three things: entities (the objects), attributes (their details) and relationships (how they connect). Each of these comes in different types, and knowing them helps you model real situations accurately.

💡 Entities, attributes and relationships each have several types you can mix to model anything.

Strong and weak entities

  • Strong entity — has its own key and stands alone (Student, Book). Drawn as a single rectangle.
  • Weak entity — has no key of its own; it depends on a strong entity to be identified (a Dependent tied to an Employee). Drawn as a double rectangle.

A weak entity needs an identifying relationship (double diamond) to its owning strong entity.

Types of attributes

TypeMeaningExample
SimpleAtomic, cannot splitage
CompositeMade of partsfull name (first + last)
Single-valuedOne value onlydate of birth
MultivaluedMany valuesphone numbers
DerivedCalculated from othersage from DOB
KeyUniquely identifiesroll number

Types of relationships

By cardinality — how many relate to how many:

  • One-to-one (1:1) — a person and their passport.
  • One-to-many (1:N) — a department and its students.
  • Many-to-many (M:N) — students and courses.

Cardinality decides where foreign keys go, and whether a link table is needed (for M:N).

Degree of a relationship

  • Unary — one entity related to itself (an Employee "manages" another Employee).
  • Binary — two entities (Student "enrolls in" Course). The most common.
  • Ternary — three entities in one relationship.

Degree counts how many entities take part; cardinality counts how many instances.

Putting it together

Consider a library:

  • Entities: Member (strong), Book (strong).
  • Attributes: Member has id (key), name, and phone numbers (multivalued).
  • Relationship: Member "borrows" Book — a many-to-many binary relationship.

This maps to Member and Book tables plus a link table for borrowing.

Common mistakes

  • Treating a weak entity as strong. It has no key of its own; link it to its owner.
  • Storing a derived attribute. Often better to calculate it than store it.
  • Confusing degree and cardinality. Degree = number of entities; cardinality = number of instances.
  • Modelling many-to-many without a link table. M:N needs one.

Summary

  • Entities can be strong (own key) or weak (dependent).
  • Attributes: simple, composite, single/multivalued, derived, key.
  • Relationships by cardinality: 1:1, 1:N, M:N.
  • Degree is how many entities join a relationship (unary, binary, ternary).
  • These types together let you model any real situation.

Next, learn the overall ER model, or the drawing symbols in ER diagram symbols.

Frequently Asked Questions

What is the difference between a strong and a weak entity?
A strong entity has its own key and exists on its own, like a Student. A weak entity has no key of its own and depends on a strong entity to be identified, like a Dependent that only makes sense linked to an Employee.
What are the types of attributes in DBMS?
Common types are: simple (atomic, like age), composite (made of parts, like full name), single-valued (one value), multivalued (many, like phone numbers), derived (calculated, like age from DOB), and key (uniquely identifies the entity).
What are the types of relationships in DBMS?
By cardinality: one-to-one, one-to-many, and many-to-many. These describe how many instances of one entity relate to instances of another, and decide how foreign keys and link tables are used.
What is a derived attribute?
A derived attribute is one whose value can be calculated from other data rather than stored directly. For example, age can be derived from date of birth, so you may not store age at all.
What is the degree of a relationship?
The degree is how many entities take part in a relationship: unary (one entity related to itself), binary (two entities, the most common), or ternary (three entities). Most real relationships are binary.
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

Next topicFunctional Dependency in DBMS Your progress: 24 / 151 (16%) · Lesson 25 / 151 Continue →

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free