What is Database?
A database is an organised collection of structured information, or data, typically stored electronically in a computer system such a way that it can be easily access, manage and update. Any form of data can be stored in Database.
Data can be anything and everything. Distinct pieces of information usually formatted and stored in a memory, gathered from different sources and used for different purposes. For example, Text, Audio, Images, Videos, name etc.
Data can be stored in a file system but there are typical problems using a file system.
- Limited data sharing
- Data redundancy
- Difficult to get quick response
- Data dependency
What is DBMS?
Database Management System is software that handles storage, retrieval and updating data in computer system. MySQL, Oracle, SQL Server are some examples of dbms. DBMS places data in a central space and applications required this data can refer this place.
Consider a scenario where a company consists data of all employees according to their role, location, name and salary.
Tables in database
Tables are used to store data in the database. It is the simple form of data storage. Tables are uniquely named within a database. A table in a database is a dataset that consists of rows and columns. Each table contains one or more columns and each column has an associated data type that represents the kind of data it can store e.g., numbers, strings, date etc.
Row in a table is called as Record which represent a one complete unit of information.
Column in a table is called Field which consist one type of information. It is smallest unit of data may consist of any number of bits or bytes.
Normally table has one column which uniquely identifies records in a table. This field is called Primary key.
Foreign key is field that references the primary key of another table.
DBA (Database administrator) is responsible for handling DBMS. They use SQL (Structure Query language) for Create, Access, Manipulate Databases. One can write queries to perform these tasks.
Types of Database
Relation Database
In relational database, data is stored in multiple tables that are linked with common field. Relational databases provide an efficient, intuitive, and flexible way to store and access structured information by maintaining data in tables. Tables, also known as relations, consist of columns containing one or more data categories, and rows, also known as table records, containing a set of data defined by the category. Applications access data by with the help of queries.
Table Image
Non relational database
The non-relational database, stores data. Unlike the relational database, there are no tables, rows, primary keys or foreign keys. Instead, the non-relational database uses an optimised storage model beneficial for the type of data being stored.
Some of the more popular NoSQL databases are MongoDB, Apache Cassandra, Redis, Couchbase and Apache HBase.