โ What is a Database?
โ What is a Relational Database?
โ What is SQL?
โ What is NoSQL?
โ Categories
โ SQL vs NoSQL
โ BONUS: Which one is for you?
โ What is a Database?
โฌ A database is an organised collection of data stored in a computer system (typically a server machine, but can be any machine) so that it can be accessed and managed easily.
โฌ In early days, each database had a separate way of data management. The way one database was storing and managing data may vary from another.
โฌ But with time this practice got normalised. The "Relational Database" design came into picture.
โ What is a Relational Database?
โฌ A relational database is a "collection of data items" that have some "pre-defined relationships" between them.
โฌ Typically these items are organised as a set of "Tables" with "Columns" and "Rows".
โฌ Relationship between 2 tables are established based on one or multiple similar columns.
โฌ Relational databases grew in popularity. As so many of them exist, the need to develop one common language for managing both data and structures became stronger.
โ What is SQL?
โฌ SQL stands for Structured Query Language.
โฌ SQL is a computer language for storing, manipulating and retrieving data stored in a relational database.
โฌ SQL has many parts
โฎ DDL
Data Definition Language
โฎ DML
Data Manipulation Language
โฎ DQL
Data Query Language
โฎ DCL
Data Control Language
โฎ TCL
Transaction Control Language
โฌ Remember, a database is "Relational" and the language used in it is called "SQL". But it is normal to use "Relational Database" and, "SQL Database" terms interchangeably.
โฌ In a SQL Database, data are kept fully structured. Often data are very tightly coupled.
โ What is NoSQL?
โฌ SQL Databases were good and served many purposes. But with time data volume increased like anything.
โฌ For these large volume of data, SQL was getting inefficient on many occasions. To improve the efficiency, new database designs evolved.
โฌ All these databases didn't keep it mandatory for data to be structured. Hence SQL was not going to work. So, a new term was coined "NoSQL".
โฉ NoSQL doesn't mean "Not SQL" rather "Not Only SQL".
โฌ NoSQL databases are mostly of distributed architecture. Hence they follow CAP Theorem.
โฉ CAP Theorem states that no distributed system can support more than any two of Consistency, Availability and Partition tolerance.
โ Categories
Broadly databases can be categorised into
๐ข
โฎ Relational
โฎ NoSQL
โฎ Document
โฎ Wide-Column
โฎ Key-Value
โฎ Graph
โฎ Time Series
โฎ Search
โ Basics about Arrays
โ Array Properties
โ Array Methods
โ Looping through Arrays
โ Array related Operators
โ Common Array Operations
โ Comparison of Terms
๐ฅ Disclaimer
โฌ The questions covered here are mostly conceptual
โฌ I never claim only these type of questions are/should be asked during interviews
โฌ For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems.
โ Check if input is of number type
โ Check if input value contains a number
โ Check if input value is null or, undefined
โ Check if input value is null or, empty string
โ Check if input value is falsy
โ Check if input is an Array
โ Check if input is an Empty object