What is SQL Query Language ?
Answer : Full Form of SQL (Structured Query Language). SQL is a query language used to store, retrieve, and manipulate data in databases.
Database : Means Store Data in Structured Format (Rows & Columns).
For example, we have an Employees database. In the Employees database, we have a table that contains multiple rows and columns.
For example, an Employees table can contain 3 records:
| Employee_ID | Employee_Name | Salary |
| 101 | Rahul | 10,000 |
| 102 | Priya | 20,000 |
We have 3 columns (Employee_ID, Employee_Name, Salary) and 2 rows (records).
What is CRUD Operation ?
Answer : CRUD stands for Create, Read, Update, and Delete. These are the 4 operations performed on data in a database.
C -> CREATE (For Example : Add a New Employees Record)
R -> READ (For Example : Retrieve the Employees Information)
U-> UPDATE (For Example : Modify Existing Information of Employees)
D -> Delete (For Example : Remove an Employee Record).
What are the different types of SQL commands / How many types of SQL commands are there, and what are they?
Answer : SQL commands are generally divided into 5 categories.
- DQL : (Data Query Language) – Example (SELECT).
- DDL : (Data Definition Language) – Example (CREATE , ALTER , DROP , TRUNCATE).
- DML :(Data Manipulation Language) – Example (INSERT , UPDATE , DELETE)
- DCL : (Data Control Language) – Example (GRANT , REVOKE)
- TCL : (Transaction Control Language) -Example (COMMIT, ROLLBACK , SAVEPOINT)
What is the difference between SQL and NoSQL databases ?
Answer : These are the 5 key differences between SQL and NoSQL databases.
| Relational Database | Non Relational Database. |
| SQL Database | NoSQL Database |
| Data Stored in Tables (Row & Column) | Data stored are either key-value pairs, document-based, graph databases |
| They have Predefined Schema (Fixed or Static) | They have dynamic Schema |
| Example : PostgreSQL, MySQL, MS SQL Server | Eg: MongoDB, Cassandra, Hbase |
What are Data Types in SQL ?
Answer : Commonly Used Data Types in SQL
- int : Used to store(Whole Number) Values. Example (200 , 500 , 1000)
- float : Used to Specify the decimal point number. Example (10.5 , 99.99)
- Bool/ Boolean : used to specify Boolean values true and false.
- char : fixed length string that can contain numbers, letters, and special characters Example:
CHAR(10) - varchar : variable length string that can contain numbers, letters, and special characters. Example:
VARCHAR(100) - date : Used to store date. Displayed format is
YYYY-MM-DD. Example:2026-08-22 - datetime : Used to store both date and time. Displayed format is YYY-MM-DD HH:MM:SS Example:
2026-08-22 17:30:00
Note: Exact data types can vary between database systems.
What is a Table ?
Answer : A table is a database object used to store data in the form of rows and columns.
| Employee_ID | Employee_Name | Salary |
| 101 | Rahul | 10,000 |
| 102 | Priya | 20,000 |
What is a row in Table ?
Answer : Row Represents a single record in a table.
What are ACID Properties ?
Answer : To Ensure the integrity of the database, there are a set of principles that ensure database transaction are processed reliably and safely.
ACID Stands for
A : Atomicity : (Either all Operations of the transactions are Completed Successfully or none of them are applied). For Example: Rahul sends ₹1,000 to Priya’s account. After the transaction, Rahul’s balance becomes ₹0 and Priya’s balance becomes ₹1,000. If the transaction fails at any point in between, the entire transaction should be rolled back, and the original balances should be restored. This is called Atomicity.
C : Consistency : (The transaction must take the database from one valid state to another valid state).
Example
Suppose Rahul has ₹1,000 and wants to send ₹500 to Priya.
Before the transaction:
| Account | Balance |
|---|---|
| Rahul | ₹1,000 |
| Priya | ₹500 |
After the transaction:
| Account | Balance |
|---|---|
| Rahul | ₹500 |
| Priya | ₹1,000 |
The total balance remains ₹1,500 before and after the transaction. If the transaction fails to send the money to Priya’s account, then the data becomes inconsistent.
I : Isolation : (Isolation means all transactions run independently, and one transaction will not affect another transaction.) For example, two people transferring money at the same time should not cause incorrect account balances.
D : Durability : Durability ensures that once a transaction is committed, its changes are permanently saved, even if the system fails. For Example : Once a Transaction is Successfully committed, the changes should remain saved even if the database system crashes afterwards.