Skip to content

Commit e4cbaf5

Browse files
committed
DBMS basics docs added
1 parent cd2c9a8 commit e4cbaf5

11 files changed

+477
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"label": "Entity-Relational Model",
3+
"position": 1,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "In this section, you will learn about the Entity-Relational Model in DBMS, a fundamental concept for conceptual design of databases. We will cover the basics of entities, relationships, attributes, and constraints, and how they are used to create a structured database schema."
7+
}
8+
}
9+
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
id: dbms-generalization-and-aggregation
3+
title: DBMS - Generalization and Aggregation
4+
sidebar_label: Generalization and Aggregation
5+
sidebar_position: 3
6+
description: Learn about the concepts of Generalization and Aggregation in DBMS, which allow expressing database entities in a conceptual hierarchical manner.
7+
tags:
8+
- DBMS
9+
- Generalization
10+
- Aggregation
11+
- Database Design
12+
---
13+
14+
# DBMS - Generalization and Aggregation
15+
16+
The ER Model has the power of expressing database entities in a conceptual hierarchical manner. As the hierarchy goes up, it generalizes the view of entities, and as we go deep in the hierarchy, it gives us the detail of every entity included.
17+
18+
Going up in this structure is called generalization, where entities are clubbed together to represent a more generalized view. For example, a particular student named Mira can be generalized along with all the students. The entity shall be a student, and further, the student is a person. The reverse is called specialization where a person is a student, and that student is Mira.
19+
20+
## Generalization
21+
22+
As mentioned above, the process of generalizing entities, where the generalized entities contain the properties of all the generalized entities, is called generalization. In generalization, a number of entities are brought together into one generalized entity based on their similar characteristics. For example, pigeon, house sparrow, crow, and dove can all be generalized as Birds.
23+
24+
### Example of Generalization
25+
26+
| Specific Entities | Generalized Entity |
27+
|-------------------|---------------------|
28+
| Pigeon | Bird |
29+
| House Sparrow | Bird |
30+
| Crow | Bird |
31+
| Dove | Bird |
32+
33+
![generalization](https://www.tutorialspoint.com/dbms/images/generalization.png)
34+
35+
## Specialization
36+
37+
Specialization is the opposite of generalization. In specialization, a group of entities is divided into sub-groups based on their characteristics. Take a group ‘Person’ for example. A person has a name, date of birth, gender, etc. These properties are common in all persons, human beings. But in a company, persons can be identified as employee, employer, customer, or vendor, based on what role they play in the company.
38+
39+
### Example of Specialization
40+
41+
| General Entity | Specialized Entities |
42+
|----------------|--------------------------|
43+
| Person | Employee, Employer, Customer, Vendor |
44+
45+
![specialization](https://www.tutorialspoint.com/dbms/images/specialization.png)
46+
47+
Similarly, in a school database, persons can be specialized as teacher, student, or a staff, based on what role they play in school as entities.
48+
49+
## Inheritance
50+
51+
We use all the above features of ER-Model in order to create classes of objects in object-oriented programming. The details of entities are generally hidden from the user; this process is known as abstraction.
52+
53+
Inheritance is an important feature of Generalization and Specialization. It allows lower-level entities to inherit the attributes of higher-level entities.
54+
55+
### Example of Inheritance
56+
57+
![inheritance](https://www.tutorialspoint.com/dbms/images/inheritance.png)
58+
59+
| Higher-level Entity | Attributes | Lower-level Entities |
60+
|---------------------|-----------------------------|------------------------|
61+
| Person | Name, Age, Gender | Student, Teacher |
62+
63+
For example, the attributes of a Person class such as name, age, and gender can be inherited by lower-level entities such as Student or Teacher.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
id: er-diagram-representation
3+
title: DBMS ER Diagram Representation
4+
sidebar_label: ER Diagram Representation
5+
sidebar_position: 2
6+
description: Learn how to represent the Entity-Relationship (ER) Model using ER diagrams, including entities, attributes, relationships, and cardinality.
7+
tags:
8+
- DBMS
9+
- ER Diagram
10+
- Database Design
11+
---
12+
13+
# DBMS - ER Diagram Representation
14+
15+
Let us now learn how the ER Model is represented by means of an ER diagram. Any object, for example, entities, attributes of an entity, relationship sets, and attributes of relationship sets, can be represented with the help of an ER diagram.
16+
17+
## Entity
18+
19+
Entities are represented by means of rectangles. Rectangles are named with the entity set they represent.
20+
21+
![entities](https://www.tutorialspoint.com/dbms/images/entities.png)
22+
23+
## Attributes
24+
25+
### Simple Attributes
26+
27+
Attributes are the properties of entities. Attributes are represented by means of ellipses. Every ellipse represents one attribute and is directly connected to its entity (rectangle).
28+
29+
![er_attributes](https://www.tutorialspoint.com/dbms/images/er_attributes.png)
30+
31+
### Composite Attributes
32+
33+
If the attributes are composite, they are further divided in a tree-like structure. Every node is then connected to its attribute. Composite attributes are represented by ellipses that are connected with an ellipse.
34+
35+
![er_attributes_composite](https://www.tutorialspoint.com/dbms/images/er_attributes_composite.png)
36+
37+
### Multivalued Attributes
38+
39+
Multivalued attributes are depicted by double ellipse.
40+
41+
![er_attributes_multivalued](https://www.tutorialspoint.com/dbms/images/er_attributes_multivalued.png)
42+
43+
### Derived Attributes
44+
45+
Derived attributes are depicted by dashed ellipse.
46+
47+
![er_attributes_derived](https://www.tutorialspoint.com/dbms/images/er_attributes_derived.png)
48+
49+
## Relationship
50+
51+
Relationships are represented by diamond-shaped boxes. The name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship are connected to it by a line.
52+
53+
### Binary Relationship and Cardinality
54+
55+
A relationship where two entities are participating is called a binary relationship. Cardinality is the number of instances of an entity from a relation that can be associated with the relation.
56+
57+
#### One-to-One
58+
59+
When only one instance of an entity is associated with the relationship, it is marked as '1:1'. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship.
60+
61+
#### One-to-Many
62+
63+
When more than one instance of an entity is associated with a relationship, it is marked as '1:N'. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship.
64+
65+
#### Many-to-One
66+
67+
When more than one instance of entity is associated with the relationship, it is marked as 'N:1'. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship.
68+
69+
#### Many-to-Many
70+
71+
The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship.
72+
73+
### Participation Constraints
74+
75+
#### Total Participation
76+
77+
Each entity is involved in the relationship. Total participation is represented by double lines.
78+
79+
#### Partial Participation
80+
81+
Not all entities are involved in the relationship. Partial participation is represented by single lines.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
id: er-model-basics-concepts
3+
title: DBMS ER Model Basic Concepts
4+
sidebar_label: ER Model Basic Concepts
5+
sidebar_position: 1
6+
description: Learn about the Entity-Relationship (ER) model, its basic concepts, entities, attributes, and relationships that form the foundation of database design.
7+
tags:
8+
- DBMS
9+
- ER Model
10+
- Database Design
11+
---
12+
13+
# DBMS - ER Model Basic Concepts
14+
15+
The ER model defines the conceptual view of a database. It works around real-world entities and the associations among them. At view level, the ER model is considered a good option for designing databases.
16+
17+
## Entity
18+
19+
An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. For example, in a school database, students, teachers, classes, and courses offered can be considered as entities. All these entities have some attributes or properties that give them their identity.
20+
21+
An entity set is a collection of similar types of entities. An entity set may contain entities with attribute sharing similar values. For example, a Students set may contain all the students of a school; likewise, a Teachers set may contain all the teachers of a school from all faculties. Entity sets need not be disjoint.
22+
23+
## Attributes
24+
25+
Entities are represented by means of their properties, called attributes. All attributes have values. For example, a student entity may have name, class, and age as attributes.
26+
27+
There exists a domain or range of values that can be assigned to attributes. For example, a student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be negative, etc.
28+
29+
### Types of Attributes
30+
31+
| Type | Description |
32+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
33+
| Simple attribute | Atomic values, which cannot be divided further. Example: a student's phone number is an atomic value of 10 digits. |
34+
| Composite attribute | Made of more than one simple attribute. Example: a student's complete name may have first_name and last_name. |
35+
| Derived attribute | Attributes that do not exist in the physical database, but their values are derived from other attributes. Example: average_salary in a department. |
36+
| Single-value attribute | Contain a single value. Example: Social_Security_Number. |
37+
| Multi-value attribute | May contain more than one value. Example: a person can have more than one phone number, email_address, etc. |
38+
39+
These attribute types can come together in a way like −
40+
41+
- Simple single-valued attributes
42+
- Simple multi-valued attributes
43+
- Composite single-valued attributes
44+
- Composite multi-valued attributes
45+
46+
## Entity-Set and Keys
47+
48+
Key is an attribute or collection of attributes that uniquely identifies an entity among an entity set.
49+
50+
For example, the roll_number of a student makes him/her identifiable among students.
51+
52+
- **Super Key** − A set of attributes (one or more) that collectively identifies an entity in an entity set.
53+
- **Candidate Key** − A minimal super key is called a candidate key. An entity set may have more than one candidate key.
54+
- **Primary Key** − A primary key is one of the candidate keys chosen by the database designer to uniquely identify the entity set.
55+
56+
## Relationship
57+
58+
The association among entities is called a relationship. For example, an employee works_at a department, a student enrolls in a course. Here, Works_at and Enrolls are called relationships.
59+
60+
### Relationship Set
61+
62+
A set of relationships of similar type is called a relationship set. Like entities, a relationship too can have attributes. These attributes are called descriptive attributes.
63+
64+
### Degree of Relationship
65+
66+
The number of participating entities in a relationship defines the degree of the relationship.
67+
68+
- Binary = degree 2
69+
- Ternary = degree 3
70+
- n-ary = degree n
71+
72+
### Mapping Cardinalities
73+
74+
Cardinality defines the number of entities in one entity set, which can be associated with the number of entities of another set via a relationship set.
75+
76+
| Cardinality | Diagram | Description |
77+
| ------------ | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78+
| One-to-one | ![one to one](https://www.tutorialspoint.com/dbms/images/one_to_one_relation.png) | One entity from entity set A can be associated with at most one entity of entity set B and vice versa. |
79+
| One-to-many | ![one to many](https://www.tutorialspoint.com/dbms/images/one_to_many_relation.png) | One entity from entity set A can be associated with more than one entities of entity set B; however, an entity from entity set B can be associated with at most one entity. |
80+
| Many-to-one | ![many to one](https://www.tutorialspoint.com/dbms/images/many_to_one_relation.png) | More than one entities from entity set A can be associated with at most one entity of entity set B; however, an entity from entity set B can be associated with more than one entity from entity set A. |
81+
| Many-to-many | ![many to many](https://www.tutorialspoint.com/dbms/images/many_to_many_relation.png) | One entity from entity set A can be associated with more than one entity from entity set B and vice versa. |

docs/DBMS/_category.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "DBMS",
3+
"position": 11,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Database Management Systems (DBMS) are software systems designed to manage databases. They provide an interface for users and applications to interact with data efficiently and securely. DBMSs support various types of databases, such as relational, NoSQL, and distributed databases, each serving different purposes and use cases. Relational databases use structured query language (SQL) for defining and manipulating data, while NoSQL databases are designed for specific data models and scalability. Key features of DBMS include data integrity, concurrency control, transaction management, and data security. Examples of popular DBMS include MySQL, PostgreSQL, MongoDB, and Oracle Database."
7+
}
8+
}

docs/DBMS/data-independence-dbms.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
id: data-independence-dbms
3+
title: DBMS Data Independence
4+
sidebar_label: Data Independence
5+
sidebar_position: 6
6+
tags: [dbms, data independence]
7+
description: Understand data independence in DBMS, including logical and physical data independence, and their importance in maintaining flexibility and scalability.
8+
---
9+
10+
# DBMS - Data Independence
11+
12+
If a database system is not multi-layered, then it becomes difficult to make any changes in the database system. Database systems are designed in multi-layers as we learned earlier.
13+
14+
## Data Independence
15+
16+
A database system normally contains a lot of data in addition to users’ data. For example, it stores data about data, known as metadata, to locate and retrieve data easily. It is rather difficult to modify or update a set of metadata once it is stored in the database. But as a DBMS expands, it needs to change over time to satisfy the requirements of the users. If the entire data is dependent, it would become a tedious and highly complex job.
17+
18+
![data_independence](https://www.tutorialspoint.com/dbms/images/data_independence.png)
19+
20+
### Data Independence
21+
22+
Metadata itself follows a layered architecture, so that when we change data at one layer, it does not affect the data at another level. This data is independent but mapped to each other.
23+
24+
### Logical Data Independence
25+
26+
Logical data is data about the database, that is, it stores information about how data is managed inside. For example, a table (relation) stored in the database and all its constraints, applied to that relation.
27+
28+
Logical data independence is a kind of mechanism, which liberalizes itself from actual data stored on the disk. If we make some changes to the table format, it should not change the data residing on the disk.
29+
30+
### Physical Data Independence
31+
32+
All the schemas are logical, and the actual data is stored in bit format on the disk. Physical data independence is the power to change the physical data without impacting the schema or logical data.
33+
34+
For example, if we want to change or upgrade the storage system itself − suppose we want to replace hard disks with SSDs − it should not have any impact on the logical data or schemas.

docs/DBMS/data-models.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
id: data-models-dbms
3+
title: DBMS Data Models
4+
sidebar_label: Data Models
5+
sidebar_position: 4
6+
tags: [dbms, data models]
7+
description: Learn about different data models in DBMS, including flat data models, Entity-Relationship models, and relational models, and understand how data is structured, processed, and stored.
8+
---
9+
10+
# DBMS - Data Models
11+
12+
Data models define the logical structure of a database and introduce abstraction in a DBMS. They specify how data is connected, processed, and stored within the system.
13+
14+
## Flat Data Models
15+
16+
Flat data models were the earliest, where all data was kept on the same plane. However, they were prone to duplication and update anomalies due to their non-scientific nature.
17+
18+
## Entity-Relationship Model (ER Model)
19+
20+
The Entity-Relationship (ER) Model is based on real-world entities and their relationships. It creates entity sets, relationship sets, attributes, and constraints, making it suitable for conceptual database design.
21+
22+
![er_model_intro](https://www.tutorialspoint.com/dbms/images/er_model_intro.png)
23+
24+
### Concepts of ER Model
25+
26+
- **Entity**: A real-world entity with attributes defined by a domain. For example, in a school database, a student is an entity with attributes like name, age, and class.
27+
- **Relationship**: Logical associations between entities, defined by mapping cardinalities such as one-to-one, one-to-many, many-to-one, and many-to-many.
28+
29+
## Relational Model
30+
31+
The Relational Model is the most popular data model in DBMS, based on first-order predicate logic. It defines a table as an n-ary relation.
32+
33+
![relational_model_table](https://www.tutorialspoint.com/dbms/images/relational_model_table.png)
34+
35+
### Highlights of Relational Model
36+
37+
- Data stored in tables (relations).
38+
- Relations can be normalized.
39+
- Normalized relations contain atomic values.
40+
- Each row in a relation has a unique value.
41+
- Columns in a relation contain values from the same domain.

0 commit comments

Comments
 (0)