What’s a database, Why a database, and DBMS.
What is DataBase ?
A database is an organized collection of data stored and accessed electronically. It is designed to store, retrieve, and manage large amounts of information in an efficient manner.
DBMS ( Database Management System )
A DBMS is a software system that enables users to define, create, maintain and control access to the database.
Why is DBMS important?
The importance of DBMS can be summarized as follows:
- Data Management: DBMS helps in managing the data efficiently. It provides an easy interface for data storage, retrieval, and manipulation.
- Data Security: DBMS provides data security by preventing unauthorized access to the data. It ensures that only authorized users have access to the data.
- Data Integrity: DBMS ensures that the data is consistent and accurate. It ensures that the data is free from errors and anomalies.
- Data Consistency: DBMS provides consistency in data by enforcing constraints and rules on the data.
- Data Sharing: DBMS allows multiple users to access the data simultaneously. It provides a centralized platform for data sharing.
Function of Database
a. Data Management: Store, retrieve, and modify data.
b. Data Security: Access to authorized users only.
c. Data Integrity: Maintain accuracy and consistency.
d. Data Backup and Recovery.
e. Concurrency: Data access for multiple users.
How DBMS works?
DBMS works on the principle of the client-server model. It consists of two components, the server, and the client. The server is responsible for managing the data, while the client is responsible for accessing the data. The server is also responsible for enforcing data security, data integrity, and data consistency.
The following steps are involved in DBMS:
- Data modeling: DBMS involves designing a data model that describes the data and its relationships.
- Data storage: The data is stored in tables, which are organized into a database.
- Data retrieval: The data can be retrieved using SQL (Structured Query Language).
- Data manipulation: The data can be manipulated using SQL, which includes inserting, deleting, and updating data.
- Data security: DBMS provides data security by enforcing access controls, which restrict access to the data.
- Data integrity: DBMS ensures data integrity by enforcing constraints, which prevent data inconsistencies.
Types of Databases:
- Hierarchical DBMS
- Network DBMS
- NoSQL
- Relational Database Management System (RDBMS)
1. Hierarchical DBMS
A hierarchical database management system stores data in a tree-like structure where each record has a parent and child relationship, forming a hierarchy. It is used for storing data with a fixed structure and a single parent for each record.
Example of Hierarchical DBMS
Consider a university database where each department has multiple courses, and each course has multiple students enrolled. The table for this database could look something like this:
In this hierarchical database, the Department column acts as the parent or root, the Course column acts as the child, and the Student column acts as the grandchild. Each department can have multiple courses, and each course can have multiple students enrolled. This creates a hierarchical relationship between the data.
2. Network DBMS
A network database management system stores data in a graph-like structure where each record can have multiple parent and child relationships. It allows for more complex relationships between data and is used for applications where data relationships are important.
Example of Network DBMS
3. NoSQL
NoSQL databases do not use the traditional tabular structure of relational databases. They allow for flexible and dynamic data models and are typically used for handling large volumes of unstructured or semi-structured data, such as in web applications or real-time analytics.
[we will discuss Later]
4. Relational Database Management System (RDBMS)
A relational database management system is the most widely used type of database, where data is stored in tables consisting of rows and columns. It uses SQL to manage data and provides a structured way to organize and access data. It is used for applications where data relationships are important and data consistency is crucial.
We are going to focus on relational database management systems (RDBMS). And here’s Why? …
- They are the most commonly used ones.
- The principles we are going to discuss here are usable across all of them.
- If you know you are going to jump into NoSQL databases, most of the introductions assume you already understand relational database concepts and will use these concepts to explain what’s offered by NoSQL databases.
RDBMS are like Oracle, MySQL, SQL Server, SQLite, DB2, …etc.
Conclusion
DBMS is a software tool that helps organizations manage their data efficiently. It enables users to store, retrieve, and manipulate data in an organized way. It provides data security, data integrity, and data consistency. There are different types of DBMS, including relational, NoSQL, hierarchical, and network. Each type has its advantages and disadvantages, and organizations need to choose the appropriate DBMS based on their requirements.