What Is Database
The database is a collection of
inter-related data which is used to retrieve, insert and delete the data
efficiently. It is also used to organize the data in the form of a table,
schema, views, and reports, etc.
Database Management System
- Database management system is a software which is used to manage the database. For example: MySQL, Oracle, etc are a very popular commercial database which is used in different applications.
- DBMS provides an interface to perform various operations like database creation, storing data in it, updating data, creating a table in the database and a lot more.
- It provides protection and security to the database. In the case of multiple users, it also maintains data consistency.
DBMS allows users the following tasks:
- Data Definition: It is used for creation, modification, and removal of definition that defines the organization of data in the database.
- Data Updation: It is used for the insertion, modification, and deletion of the actual data in the database.
- Data Retrieval: It is used to retrieve the data from the database which can be used by applications for various purposes.
- User Administration: It is used for registering and monitoring users, maintain data integrity, enforcing data security, dealing with concurrency control, monitoring performance and recovering information corrupted by unexpected failure.
Advantages of DBMS
- Controls database redundancy: It can control data redundancy because it stores all the data in one single database file and that recorded data is placed in the database.
- Data sharing: In DBMS, the authorized users of an organization can share the data among multiple users.
- Easily Maintenance: It can be easily maintainable due to the centralized nature of the database system.
- Reduce time: It reduces development time and maintenance need.
- Backup: It provides backup and recovery subsystems which create automatic backup of data from hardware and software failures and restores the data if required.
- Multiple user interface: It provides different types of user interfaces like graphical user interfaces, application program interfaces
Disadvantages of DBMS
- Cost
of Hardware and Software: It requires a high speed of data processor and large
memory size to run DBMS software.
- Size:
It occupies a large space of disks and large memory to run them efficiently.
- Complexity:
Database system creates additional complexity and requirements.
- Higher
impact of failure: Failure is highly impacted the database because in most of
the organization, all the data stored in a single database and if the database
is damaged due to electric failure or database corruption then the data may be
lost forever.
Different Types Of Database Management System
(DBMS)
- Relational
Database
- Centralized
Database
- Distributed
Database
- NoSQL
Database
- Cloud
Database
- Network
Database
- Object-Oriented
Database
- Hierarchical
Database
Relational Database
This database is based on the
relational data model, which stores data in the form of rows(tuple) and
columns(attributes), and together forms a table(relation). A relational
database uses SQL for storing, manipulating, as well as maintaining the data.
E.F. Codd invented the database in 1970. Each table in the database carries a
key that makes the data unique from others. Examples of Relational databases
are MySQL, Microsoft SQL Server, Oracle, etc.
RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
A Relational database management system (RDBMS) is a database management (DBMS) that is based on the relational model as introduced by E. F. Codd.
Properties of Relational Database
There are following four commonly known properties of a relational model known as ACID properties, where:
- A means Atomicity: This ensures the data operation will complete either with success or with failure. It follows the 'all or nothing' strategy. For example, a transaction will either be committed or will abort.
- C means Consistency: If we perform any operation over the data, its value before and after the operation should be preserved. For example, the account balance before and after the transaction should be correct, i.e., it should remain conserved.
- I means Isolation: There can be concurrent users for accessing data at the same time from the database. Thus, isolation between the data should remain isolated. For example, when multiple transactions occur at the same time, one transaction effects should not be visible to the other transactions in the database.
- D means Durability: It ensures that once it completes the operation and commits the data, data changes should remain permanent.
- NOT NULL Constraint − Ensures that a column cannot have a NULL value.
- DEFAULT Constraint − Provides a default value for a column when none is specified.
- UNIQUE Constraint − Ensures that all the values in a column are different.
- PRIMARY Key − Uniquely identifies each row/record in a database table.FOREIGN Key − Uniquely identifies a row/record in any another database table.
- CHECK Constraint − The CHECK constraint ensures that all values in a column satisfy certain conditions.
- INDEX − Used to create and retrieve data from the database very quickly.
- Entity Integrity − There are no duplicate rows in a table.
- Domain Integrity − Enforces valid entries for a given column by restricting the type, the format, or the range of values.
- Referential integrity − Rows cannot be deleted, which are used by other records.
- User-Defined Integrity − Enforces some specific business rules that do not fall into entity, domain or referential integrity.
- Database normalization is the process of efficiently organizing data in a database. There are two reasons of this normalization process −
- Eliminating redundant data, for example, storing the same data in more than one table.
- Ensuring data dependencies make sense.
- Both these reasons are worthy goals as they reduce the amount of space a database consumes and ensures that data is logically stored. Normalization consists of a series of guidelines that help guide you in creating a good database structure.
- Normalization guidelines are divided into normal forms; think of a form as the format or the way a database structure is laid out. The aim of normal forms is to organize the database structure, so that it complies with the rules of first normal form, then second normal form and finally the third normal form.
- It is your choice to take it further and go to the fourth normal form, fifth normal form and so on, but in general, the third normal form is more than enough.
- Types Of Normalization
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)