TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1199 491
✅ Databases Interview Questions & Answers 💾💡 

1️⃣ What is a Database? 
A: A structured collection of data stored electronically. Examples: MySQL, MongoDB, PostgreSQL. 

2️⃣ Difference between SQL and NoSQL
- SQL: Relational, structured tables, uses schemas, supports ACID transactions. 
- NoSQL: Non-relational, flexible schema, document/graph/column storage, scalable. 

3️⃣ What is a Primary Key?
A:
Unique identifier for a record in a table. Example: id column in Users table. 

4️⃣ What is a Foreign Key? 
A:
A field in one table that refers to the primary key of another table to maintain relationships. 

5️⃣ CRUD Operations
- Create: INSERT INTO table_name ... 
- Read: SELECT * FROM table_name ... 
- Update: UPDATE table_name SET ... WHERE ... 
- Delete: DELETE FROM table_name WHERE ... 

6️⃣ What is Indexing?
A:
A performance optimization technique to speed up data retrieval. Types: B-Tree, Hash indexes. 

7️⃣ What is Normalization?
A: Process of organizing tables to reduce redundancy and improve data integrity. Forms: 1NF, 2NF, 3NF, BCNF. 

8️⃣ What is Denormalization?
A: Combining tables or duplicating data to improve read performance at the cost of redundancy. 

9️⃣ ACID Properties
- Atomicity: All or nothing transaction 
- Consistency: Database remains valid 
- Isolation: Transactions don’t interfere 
- Durability: Committed changes persist 

🔟 Difference between JOIN types
- INNER JOIN: Only matching rows 
- LEFT JOIN: All left + matching right rows 
- RIGHT JOIN: All right + matching left rows 
- FULL OUTER JOIN:  All rows from both tables 

1️⃣1️⃣ What is a NoSQL Database?
A:
Database designed for large-scale, unstructured, or semi-structured data. Types: Document (MongoDB), Key-Value (Redis), Column (Cassandra), Graph (Neo4j). 

1️⃣2️⃣ What is a Transaction? 
A:
A set of SQL operations executed as a single unit of work. Either all succeed or all fail. 

1️⃣3️⃣ Difference between DELETE and TRUNCATE
- DELETE: Row-by-row, can use WHERE, slower, logs each row. 
- TRUNCATE: Removes all rows, faster, cannot use WHERE, resets auto-increment. 

1️⃣4️⃣ What is a View?
A:
A virtual table representing a stored query. Useful for abstraction, security, and complex queries. 

1️⃣5️⃣ Difference between SQL and ORM
- SQL: Direct queries to DB
- ORM: Object-Relational Mapping, allows interacting with DB using programming language objects (e.g., Sequelize, SQLAlchemy) 

💬 Tap ❤️ if you found this useful!
More from @coding_interview_preparation
  1. Oct 10, 2026100 SQL interview questions
  2. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  3. Oct 6, 2026document post
  4. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  5. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
  6. Oct 1, 2026Most Asked Topics in AI Engineer Interviews Based on 2026 candidate reports
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →