DATABSE MANAGEMENT SYSTEM CHEATSHEET BY TECHIE CODEBUDDY
(This Cheatsheet is free, don’t pay any money for it)
### What is a Database?
Definition:
A database is a systematic collection of data that is stored and accessed
electronically from a computer system. It is designed to manage and organize
large amounts of information efficiently.
Key Features:
- Structured Storage: Data is organized into tables, records, and fields.
- Accessibility: Users can easily retrieve, update, and manage data.
- Consistency: Ensures data accuracy and integrity through constraints and
rules.
- Scalability: Can handle large volumes of data and grow with the needs of the
organization.
Real-World Example:
Think of a library catalog. Instead of keeping book information on individual cards
or pieces of paper, all details (title, author, genre, availability) are stored in a
structured, organized system. This system helps librarians quickly find and
manage books, and it makes it easy for users to search for specific titles or
authors.
### Evaluation of Database Models (In Short)
1. Hierarchical Model:
- Structure: Data is organized in a tree-like structure with a parent-child
relationship.
- Pros: Easy to understand and implement.
- Cons: Rigid structure and not flexible for complex queries.
,Example: A company's organizational chart where each manager has a list of
employees reporting to them.
2. Network Model:
- Structure: Data is organized in a graph structure with nodes representing
entities and edges representing relationships.
- Pros: More flexible than hierarchical models; supports many-to-many
relationships.
- Cons: Complex to design and manage.
Example: A social network where users are connected to other users, and
connections can have multiple types (friends, colleagues).
3. Relational Model:
- Structure: Data is organized into tables (relations) with rows and columns.
Tables can be linked using primary and foreign keys.
- Pros: Easy to use, flexible, and supports complex queries. It is the most widely
used model.
,- Cons: Can become complex with very large datasets.
Example: A database for an online store with tables for customers, products,
and orders. Relationships between these tables (e.g., customers placing orders)
are managed using keys.
4. Object-Oriented Model:
- Structure: Data is represented as objects, similar to object-oriented
programming concepts. Each object contains data and methods.
- Pros: Aligns well with object-oriented programming, supports complex data
types.
- Cons: Less mature compared to relational models; can be more complex to
design.
Example: A database for a graphics application where shapes and their
properties are represented as objects.
5. NoSQL Model:
- Structure: Non-relational databases that use various data models (document,
key-value, column-family, graph).
- Pros: Highly scalable and flexible; suitable for unstructured or semi-structured
data.
- Cons: May lack support for complex queries and transactions.
Example: A document store like MongoDB where each document (e.g., a user
profile) can have different structures.
Each database model has its strengths and is suited for different types of
applications and data requirements.
, ### Types of Databases
1. Centralized Database
- Definition:
A centralized database is stored, managed, and maintained in a single location
or server. All data operations are performed on this central system.
- Advantages:
- Simplified Management: Easier to manage and maintain because everything is
in one place.
- Consistency: Ensures data consistency since there is only one copy of the
data.
- Security: Easier to implement security measures since there is a single point of
access.
Disadvantages:
- Single Point of Failure: If the central server fails, the entire system is affected.
- Scalability Issues: Can become a bottleneck as the number of users or volume
of data grows.
- Use Case/Example:
A company's internal HR system where all employee records, payroll data, and
performance evaluations are stored on a single central server.
2. Distributed Database
- Definition:
A distributed database is spread across multiple locations, servers, or nodes.
The data is distributed to provide better performance and reliability.
(This Cheatsheet is free, don’t pay any money for it)
### What is a Database?
Definition:
A database is a systematic collection of data that is stored and accessed
electronically from a computer system. It is designed to manage and organize
large amounts of information efficiently.
Key Features:
- Structured Storage: Data is organized into tables, records, and fields.
- Accessibility: Users can easily retrieve, update, and manage data.
- Consistency: Ensures data accuracy and integrity through constraints and
rules.
- Scalability: Can handle large volumes of data and grow with the needs of the
organization.
Real-World Example:
Think of a library catalog. Instead of keeping book information on individual cards
or pieces of paper, all details (title, author, genre, availability) are stored in a
structured, organized system. This system helps librarians quickly find and
manage books, and it makes it easy for users to search for specific titles or
authors.
### Evaluation of Database Models (In Short)
1. Hierarchical Model:
- Structure: Data is organized in a tree-like structure with a parent-child
relationship.
- Pros: Easy to understand and implement.
- Cons: Rigid structure and not flexible for complex queries.
,Example: A company's organizational chart where each manager has a list of
employees reporting to them.
2. Network Model:
- Structure: Data is organized in a graph structure with nodes representing
entities and edges representing relationships.
- Pros: More flexible than hierarchical models; supports many-to-many
relationships.
- Cons: Complex to design and manage.
Example: A social network where users are connected to other users, and
connections can have multiple types (friends, colleagues).
3. Relational Model:
- Structure: Data is organized into tables (relations) with rows and columns.
Tables can be linked using primary and foreign keys.
- Pros: Easy to use, flexible, and supports complex queries. It is the most widely
used model.
,- Cons: Can become complex with very large datasets.
Example: A database for an online store with tables for customers, products,
and orders. Relationships between these tables (e.g., customers placing orders)
are managed using keys.
4. Object-Oriented Model:
- Structure: Data is represented as objects, similar to object-oriented
programming concepts. Each object contains data and methods.
- Pros: Aligns well with object-oriented programming, supports complex data
types.
- Cons: Less mature compared to relational models; can be more complex to
design.
Example: A database for a graphics application where shapes and their
properties are represented as objects.
5. NoSQL Model:
- Structure: Non-relational databases that use various data models (document,
key-value, column-family, graph).
- Pros: Highly scalable and flexible; suitable for unstructured or semi-structured
data.
- Cons: May lack support for complex queries and transactions.
Example: A document store like MongoDB where each document (e.g., a user
profile) can have different structures.
Each database model has its strengths and is suited for different types of
applications and data requirements.
, ### Types of Databases
1. Centralized Database
- Definition:
A centralized database is stored, managed, and maintained in a single location
or server. All data operations are performed on this central system.
- Advantages:
- Simplified Management: Easier to manage and maintain because everything is
in one place.
- Consistency: Ensures data consistency since there is only one copy of the
data.
- Security: Easier to implement security measures since there is a single point of
access.
Disadvantages:
- Single Point of Failure: If the central server fails, the entire system is affected.
- Scalability Issues: Can become a bottleneck as the number of users or volume
of data grows.
- Use Case/Example:
A company's internal HR system where all employee records, payroll data, and
performance evaluations are stored on a single central server.
2. Distributed Database
- Definition:
A distributed database is spread across multiple locations, servers, or nodes.
The data is distributed to provide better performance and reliability.