Code Skiller logoCB Logo
Logo LearnLearnLogo PracticePracticeLogo HireHireLogo IDEIDE

Introduction to Databases

User image

Published by

sanya sanya

Published at: 28th Jul, 2023
3.265 mins read

A database is an organized collection of structured data that is stored, managed, and accessed using specialized software known as a database management system. It serves as a repository for storing and retrieving data, allowing efficient data manipulation and retrieval operations.

Databases are an essential part of modern software applications and information systems. They are used in various domains, including web applications, mobile apps, enterprise systems, scientific research, and more.

Type of Database

SQL (Structured Query Language) and NoSQL (Not Only SQL) are two broad categories of database management systems (DBMS) that differ in their data models, query languages, and design philosophies.

The SQL and NoSQL Databases in the descriptive manner are mentioned below.

SQL Databases

SQL databases are based on the relational data model and use SQL as the primary query language. They organize data into tables with predefined schemas, where each table consists of rows and columns.

SQL databases enforce strong data consistency and support ACID(Atomicity, Consistency, Isolation, Durability) properties.

NoSQL Databases

These are the databases that are designed to handle the unstructured and semi-structured type of data. They provide flexible schemas and prioritize scalability, performance, and availability over strong data consistency.

NoSQL databases use various data models, including key-value, document, columnar, and graph, depending on the specific type.

What is DBMS?

DBMS stands for Database Management System. It is a software application that facilitates the creation, organization, storage, retrieval, and management of data in a database.

DBMS serves as an intermediary between users or applications and the underlying database, providing a way to interact with and manipulate the data efficiently.

Relational Database and Non-Relational Database are two type of Databases and both descriptively are mentioned below.

Relational Database

Relational DBMS, also referred to as RDBMS, is based on the relational data model. It organizes data into structured tables with predefined schemas, consisting of rows and columns.

The tables establish relationships between each other through keys, specifically primary keys and foreign keys. Relational databases use SQL (Structured Query Language) as the primary query language for data manipulation and retrieval.

Non-Relational Database

Non-relational DBMS, or NoSQL databases, emerged as a response to the growing need for flexible data models and scalability. NoSQL databases are designed to handle unstructured, semi-structured, or rapidly changing data.

They provide flexible schemas and prioritize scalability, performance, and availability over strict data consistency.

Concept of Keys

DBMS uses the concept of Keys and the type of keys in the DBMS are mentioned below -

  • Foreign key - A foreign key is a column or a set of columns in a table that references the primary key of another table, establishing a relationship between the two tables.

  • Composite key - A composite key is a key that consists of two or more columns in a table, used to uniquely identify a record when no single column can serve as a unique identifier.

  • Primary key - A primary key is a unique identifier for a record in a table, ensuring each record's uniqueness and serving as a reference for establishing relationships with other tables.

  • Super Key - A super key in DBMS is a set of one or more attributes (columns) that uniquely identify a record in a table, allowing for the identification of a specific tuple within the table.

Mongodb.txt

//mongodb.txt
{
{
"id":1,
"name":"samarth",
"text":"hi from samarth"
},

{
"id":2,
"name":"vohra",
"text":"hi from vohra",
},

{
"id":3,
"name":"coding blocks",
"text":"hi from coding blocks",
}
}

this is stored like JSON format.
so rather than making tables what we an do is that we     can
create an array of comments done by that user. (as below)

{
{
"id":1,
"name":"samarth",
"text":"hi from samarth",
"comments" : ["hola coding"]
},

{
"id":2,
"name":"vohra",
"text":"hi from vohra",
"comments" : ["hello samarth"]
},

{
"id":3,
"name":"coding blocks",
"text":"hi from coding blocks",
"comments" : ["yo blocks"]
}
}

Library

WEB DEVELOPMENT

Basic

Frontend

Backend

Node JS

Database

Introduction to Databases

Mongo DB

Interview Questions

FAANG QUESTIONS

On this page

Type of Database

SQL Databases

NoSQL Databases

What is DBMS?

Relational Database

Non-Relational Database

Concept of Keys

Mongodb.txt