Databases and SQL
Database questions show up in university exams, campus placement rounds and backend interviews, and they reward understanding over memorized definitions. This course explains how a relational database stores, queries and protects data, with the SQL you need to answer interview questions on the spot.
Start the course
Lessons
Tables, keys and constraints: the relational model
What a database system adds over files, how relations work and how keys and foreign keys keep data correct.
Writing SQL: joins, grouping and NULL
Relational algebra, the order a query is evaluated in, every kind of join, GROUP BY and three-valued logic.
Subqueries, window functions and interview queries
Correlated subqueries, EXISTS, recursive CTEs and window functions, applied to the queries SQL rounds ask for.
ER modeling: from requirements to tables
Entities, relationships, cardinality, weak entities and inheritance, and the rules for turning a diagram into tables.
Normalization: functional dependencies and normal forms
Why redundant tables break, how to find keys with attribute closure, and 1NF through BCNF with lossless decomposition.
Transactions, ACID and serializable schedules
What each ACID property prevents, conflict serializability with precedence graphs, recoverable schedules and isolation levels.
Locking, MVCC and crash recovery
Two-phase locking and why it works, deadlocks, timestamp and multiversion concurrency control, and write-ahead logging.
Indexing: B+ trees and hash indexes
Why page reads dominate cost, clustered and secondary indexes, B+ tree search, splits and merges, and hashing.
Interview Prep pass · Compare plans