Try   HackMD

Database Management for Beginners

IMG_256

Source

What is a Database?

A database is simply a collection of data or records, which is organized in a manner that we can perform operations on it. These records are stored in the form of tables with rows and columns. Rows are known as tuples and columns are known as attributes of the database.

A database stores its metadata in a data dictionary. Metadata is any information about the data, like its schema, constraints, structure, etc.

What is a Database Management System?

Database management is basically the management of different types of data, such as textual data, numerical data, and binary data with the use of database management systems.

A database management system or DBMS is a software used to manage a database (stored data). Some well-known DBMSs are MySQL, PostgreSQL, etc. A DBMS provides us a platform to interact with data, store it, and use it.

Let's see some popular DBMSs in detail.

MySQL

The first popular database we will discuss is MySQL. So, what is MySQL? It is an open source relational database management system (RDBMS) that organizes data into data tables, which helps in structuring the data.

It uses SQL, which is a language, used to create, modify, and extract data from databases. MySQL is developed by Oracle Corporation.

MySQL is used by big MNCs like Youtube, Facebook, Paypal, Netflix, Uber, and many more.

PostgreSQL

The next database we will turn to is PostgreSQL. And, what is PostgreSQL? It is a free, open-source relational database management system (RDBMS). It's an enterprise-class database that provides extensibility and is compatible with SQL. It's also known as Postgres.

Postgres transacts with ACID properties (Atomicity, Consistency, Isolation, Durability). It supports both SQL (relational) and JSON (non-relational) querying. PostgreSQL is used by MNCs like Apple, Instagram, Spotify, NASA, etc.

MongoDB

And not the final DB you should know about: What is MongoDB? It is a document database which provides scaling and helps in the development process as it has the same structure as some programming languages. In MongoDB, a record is composed of key(field) and value pairs.

MongoDB has many unique features-replication, indexing, load-balancing, server-side Java execution, etc. It can be used as a file system and provides serverless accessibility.

MongoDB is also available as an on-demand fully managed service. MongoDB Atlas runs on AWS, Microsoft Azure, and Google Cloud Platform. Big companies like Forbes, Google, Toyota, KPMG, and many more use MongoDB.

What are the Types of DBMS?

Hierarchical DBMS

A hierarchical DBMS organizes data in a tree-like structure, either in a top-down or bottom-up design. It's defined by a parent-child relationship.

There are two types of relationships:

  • one-to-one: A parent has a single child.
  • one-to-many: A parent has multiple children.

One child can't have multiple parents.

IMG_256

Source

Network DBMS

A Network DBMS is an extension of a hierarchical DBMS in which data can have many-to-many relationships and appears in the form of a network. In this database structure, a child can have multiple parents. Therefore, it allows you to model more intricate relationships.

IMG_256

Source

Relational DBMS

A relational DBMS uses a logical relationship of entities to create a database. It's one of the most extensively used arrangements for organizing databases. It organizes and stores data in independent tables and allows them to relate and connect with one another.

The data stored in this is structured and can be accessed/modified by SQL.

IMG_256

Source

Object-Oriented DBMS

An object-oriented DBMS describes data as an object that stores values and operations. Objects with similar features are grouped as a class. This is compatible with many OOPS languages, like C++, Python, Java, Scala, etc.

IMG_256

Source

NoSQL DBMS

A NoSQL DBMS is used to store a wide range of data sets. It's not a relational database. We can further divide it into four types:

  1. Key-value storage: Every item is stored in the key-value format.
  2. Document-oriented storage: It stores data in JSON-like documents. It stores data in the same format as used in the application code.
  3. Graph database: It stores vast amounts of data in a graph-like structure.
  4. Wide-column stores: Data is stored in large columns together, instead of storing in rows.

What are Database Languages?

Database languages are used to read, store, and update data in the database. These are used to express database queries and updates.

  1. Data Definition Language (DDL): It's used to define a database's structure and patterns. You can create the skeleton of the database. It's used to store the metadata in a database, like schemas, constraints, etc.
  2. Data Manipulation Language (DML): It's used for accessing and manipulating data in databases. It handles user requests, like SELECT, INSERT, UPDATE, etc.
  3. Data Control Language (DCL): It's used to retrieve stored data. Its execution is transactional. It includes tasks like GRANT, REVOKE, etc.
  4. Transaction Control Language (TCL): It's used to run the changes made by the DML. It can be grouped into logical transactions. This includes tasks like COMMIT, ROLLBACK, etc.

Why Do We Need DBMS?

DBMSs provide the following advantages:

  • Data sharing: With a DBMS, it's easy to share data using the correct authorization protocol. Multiple users can access and work on data concurrently.
  • Data integration: They store all data in one database file, which removes redundancy and improves integration of data.
  • Efficient and safe: It saves time in maintenance and operations. Also, due to their in-built authorization protocols, the data is safer. DBMSs provide better confidentiality and safety guidelines. It reduces a lot of external efforts from users.
  • Backups and Better view of data: A DBMS provides well-managed and structured data, on which operations are easy to perform and observations and decisions can be made more effectively. It also provides backup subsystems, which help when there is some problem or crash. It restores your data if required.

Conclusion

Data is the future. In times like these where everything is online, there is a ton of data generated on a daily basis. All this tells us that data is very important. With different types of large, unstructured data, there is a need to manage that and use that in a way that would be helpful for all. There are many roles and streams developing for this duty like Data Engineer or Data Scientist, but it all starts with a Database Management System.