# Entity

A definable thing - such as a person, object, concept or event, that can have data stored about it. Think of entities as nouns. Examples: a customer, student, car or product.&#x20;

Organisation require information in order to carry out tasks and activities for which they are responsible. The information that these organisations need could be categorized in a number of ways, for example,&#x20;

An entity may represent a category of people, things, events, locations or concepts within the area under consideration. An entity instance is a specific example of an entity. For example, Syed Jafer is an entity instance of an student entity.

Denoted with Rectangle.&#x20;

<figure><img src="/files/q8zrkttZZTBfwtqZNsat" alt=""><figcaption></figcaption></figure>

### **Entity Type**

A group of definable things, such as **students**. Examples include:

* **Student**: A generic type representing all students.
* **Course**: Represents all courses offered by the university.
* **Department**: Represents academic departments.

**Specific Entities**

* A specific student, e.g., *John Doe, Student\_ID: 12345*.
* A specific course, e.g., *Calculus I, Course\_ID: MATH101*.
* A specific department, e.g., *Mathematics Department*.

### **Entity Set**

Represents an entity type at a specific point in time. Examples include:

* **Students enrolled in "Fall 2024" semester**: This subset might include *John Doe, Jane Smith, and Alice Brown*.
* **Courses offered in "Spring 2025"**: Includes *MATH101, ENG202, and CS301*.
* **Departments active as of "2024"**: Includes *Mathematics, Physics, and Computer Science*.

**Related Instances**

* Instance of **Student**: *John Doe, enrolled in Spring 2024*.
* Instance of **Course**: *MATH101, offered by the Mathematics Department*.

### **Entity Categories**

> 🥁 For now, dont think about primary key, foreign key or something.&#x20;

**Strong Entity**

* **Student**: A strong entity because it can be uniquely identified using its own attributes like *Student\_ID*.
* Example attributes:
  * Student\_ID (Primary Key)
  * Name
  * Date\_of\_Birth

<figure><img src="/files/pKMHaHHtRBmV9IEQUzOC" alt=""><figcaption></figcaption></figure>

**Weak Entity**

* **Dependent**: A weak entity related to a student, such as a family member. It depends on the Student entity for identification. Even though it has a unique ID, Conceptually its dependant on student.&#x20;
* Example: *Dependent\_ID* is meaningful only when associated with a specific Student\_ID.

<figure><img src="/files/ZqPHklNOa3UOECXCzavK" alt=""><figcaption></figcaption></figure>

**Associative Entity**

* **Enrollment**: An entity that associates Students and Courses.
* Example attributes:
  * Enrollment\_ID (Primary Key)
  * Student\_ID (Foreign Key)
  * Course\_ID (Foreign Key)
  * Semester

**The Associative Entity is there to establish a Many to Many Relationship between Two or More Entities.**&#x20;

For Example, A Student can enroll in many courses. Also a course can be enrolled by many students. But we can't able to manage these details without an additional Entity (Table). This Entity is denoted as Associative Entity.&#x20;

<figure><img src="/files/K0Md6HOXFwBc30kpzn5T" alt=""><figcaption></figcaption></figure>

Also, Associative Entity, can contain additional values like duration in above example.&#x20;

### What Should an Entity Type Be?

**SHOULD BE:**&#x20;

• An object that will have many instances in the database&#x20;

• An object that will be composed of multiple attributes&#x20;

• An object that we are trying to model&#x20;

**SHOULD NOT BE:**&#x20;

• A user of the database system&#x20;

• An output of the database system (e.g. a report)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://courses.parottasalna.com/database-engineering/entity-relationship-diagram/entity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
