Database Management Systems
डेटाबेस प्रबंधन
Unit overview: the topics below, with their summaries, are the syllabus for this unit. The comprehensive note further down covers every topic in full — explanations, definitions, worked examples, tables, exam points and practice questions — and the short revision note after it is only a quick recap. Standalone one-topic learning pages are not built yet — every topic on this page is covered in the notes and the practice questions below, and each topic card links to those sections.
Premium chapters for this unit
ER model & relational algebra → premium chapter · free preview · ~16 min · 4 practice questions
SQL & normalisation → premium chapter · free preview · ~18 min · 4 practice questions
Transactions & concurrency → premium chapter · free preview · ~16 min · 4 practice questions
Detailed note for this unit (free)
Database Management Systems — Complete Detailed Note · ~45 min read · definitions, examples, tables, diagrams, exam points, practice questions and a revision summary.
Read the detailed note →Topics checklist — with weightage (platform estimate from past-question frequency, not an NTA guarantee)
ER model & relational algebra
High weightageKeys, ER diagrams, relational algebra operations.
SQL & normalisation
High weightageJoins, subqueries, 1NF–BCNF, functional dependencies.
Transactions & concurrency
High weightageACID, locks, deadlocks, recovery — like a bank ledger that never loses money.
Comprehensive unit note · ~22 min read
A database management system stores data once, shares it safely among many users, and protects it when things go wrong. This unit follows that promise through four layers. First, design: how do we model the real world as entities and relationships, and then as tables with keys and constraints? Second, language: how do we ask questions in relational algebra and in SQL, and how do we prove that a design is free of redundancy? Third, execution under sharing: how do many transactions run together without corrupting each other? Fourth, survival: how does the system recover after a crash without losing committed work or resurrecting aborted work? The central tension is between redundancy and correctness. Storing the same fact in several places makes updates dangerous: change one copy and forget another, and the database contradicts itself. Normalisation is the systematic answer. It analyses functional dependencies, splits tables until each fact lives in one place, and checks that the split loses no information and preserves the dependencies that enforce correctness. A normalised design is not an aesthetic preference; it is what makes insertion, deletion and update anomalies disappear. Concurrency is the second tension. Serial execution is safe but slow; interleaving transactions is fast but can produce lost updates, dirty reads and phantom reads. Locks, two-phase locking, timestamps and serializability theory decide which interleavings are safe and which are not. Recovery completes the picture: a write-ahead log records every change before it reaches the database, checkpoints bound the work of recovery, and undo and redo replay the log to restore exactly the committed state.
Learning objectives
- Draw an ER diagram from a description, choosing entities, attributes, keys, relationships, cardinality and weak entities correctly.
- Write relational algebra and SQL queries using selection, projection, joins, subqueries, grouping and set operations.
- Compute attribute closure from functional dependencies using Armstrong axioms and find candidate keys.
- Test a decomposition for lossless join and dependency preservation and decompose a relation to 3NF and BCNF.
- Distinguish insertion, deletion and update anomalies and explain which normal form removes each.
- Test a schedule for conflict serializability using a precedence graph and identify its serial order when one exists.
- Compare locking protocols, two-phase locking variants and timestamp ordering, and explain deadlock causes and remedies.
- Describe write-ahead logging, undo and redo recovery, checkpoints and shadow paging.
Overview
Study this unit as a pipeline. Design comes first: an ER model captures requirements in pictures, the relational model turns those pictures into tables, and normalisation refines the tables until redundancy is controlled. Querying comes next: relational algebra is the formal language that defines what a query means, and SQL is the practical language that expresses it, with grouping, subqueries and views layered on top. Concurrency and recovery come last because they assume you already understand transactions: without a clear idea of a transaction as a unit of work, serializability has nothing to be serializable about.
For exam preparation, practise three hand skills until they are mechanical. First, closure: given a set of functional dependencies, list the closure of an attribute set by repeatedly adding right-hand sides whose left-hand sides are already present. Second, decomposition: given a relation and its dependencies, find the violating dependency, split on it, and re-check each piece. Third, precedence graphs: given a schedule, draw an edge from one transaction to another for every conflicting pair in order, and check for a cycle.
ER model & relational algebra
The entity-relationship model describes a domain before any table exists. An entity is a distinguishable object or concept, such as a student or a course; an entity set is a collection of similar entities. An attribute is a property of an entity, such as a name or a date of birth. A key attribute, or combination of attributes, identifies each entity uniquely within its set. Attributes may be simple or composite, single-valued or multi-valued, stored or derived. A relationship associates entities from two or more entity sets, for example enrolment linking students and courses. The cardinality of a relationship states how many entities on each side may participate: one-to-one, one-to-many, many-to-one, or many-to-many. Participation may be total, meaning every entity must take part, or partial, meaning participation is optional. A weak entity cannot be identified by its own attributes alone and depends on an owner entity through an identifying relationship; its key combines its partial key with the owner key. The extended ER model adds specialisation into subclasses, generalisation into a superclass, and aggregation, which treats a relationship as an entity.
The relational model converts this picture into tables. A relation is a table with a fixed schema: attributes as columns, tuples as rows. A superkey is any attribute set that identifies each tuple uniquely; a candidate key is a minimal superkey, with no attribute removable without losing uniqueness; the primary key is the candidate key chosen as the identifier. A foreign key is an attribute set in one relation that refers to the primary key of another relation. Integrity constraints protect meaning: entity integrity forbids nulls in any part of the primary key; referential integrity forbids a foreign key value that has no matching primary key value, unless it is null where the design permits; domain constraints restrict values to their declared types and allowed ranges; key constraints enforce uniqueness.
Relational algebra is the formal query language of this model. Selection picks rows satisfying a condition. Projection picks columns, discarding duplicates in the set-based model. The Cartesian product pairs every tuple of one relation with every tuple of the other. Natural join combines the product with equality on common attributes and keeps one copy of each shared attribute. Theta join generalises this to an arbitrary condition; equijoin is the special case where the condition is equality. Union, intersection and difference are set operations requiring union-compatible relations with the same attributes. Rename changes a relation or attribute name, which is essential when a query joins a relation with itself. Division answers for-all questions: the division of a relation by another returns the values that are paired with every value in the divisor, such as students who have taken all courses in a given set.
How this is examined: expect questions that convert an ER description into cardinality and keys, that identify a weak entity and its key, that translate a query between algebra and SQL, and that recognise division as the operator for for-all questions. Draw the diagram, label every cardinality, and name the key of every entity before answering.
SQL & normalisation
SQL divides into data definition and data manipulation. Data definition language creates and changes schema: CREATE TABLE defines columns, types, primary keys, foreign keys and constraints; ALTER TABLE adds, drops or modifies columns and constraints; DROP TABLE removes a table. Data manipulation language changes and reads data: INSERT adds rows, UPDATE changes existing rows, DELETE removes rows, and SELECT reads them. SELECT is the workhorse: FROM names the tables, WHERE filters rows, GROUP BY groups rows for aggregation, HAVING filters groups, ORDER BY sorts the result, and DISTINCT removes duplicate rows. Aggregate functions such as COUNT, SUM, AVG, MIN and MAX summarise a group; a column in the SELECT list that is neither aggregated nor grouped is an error in strict SQL, though some systems tolerate it.
Joins combine tables. An inner join returns only matched pairs. A left outer join returns all rows from the left table, filling unmatched right columns with nulls; a right outer join mirrors this, and a full outer join returns all rows from both sides. A self-join joins a table to itself using aliases, for example to find employees and their managers from one employee table. A subquery is a query nested inside another: it may appear in WHERE with IN, EXISTS, ANY or ALL, or in FROM as a derived table. A correlated subquery refers to the outer query and is evaluated once per outer row, while an uncorrelated subquery is evaluated once. Set operations in SQL are UNION, which removes duplicates, UNION ALL, which keeps them, INTERSECT and EXCEPT, all requiring compatible column lists. A view is a named stored query that behaves like a virtual table: it simplifies access and can restrict columns, but an update through a view is permitted only when the view is updatable, which generally excludes views with joins, grouping or DISTINCT. An index, commonly a B-tree, speeds retrieval on a key at the cost of slower updates and extra storage; it does not change query results.
Normalisation rests on functional dependencies. A functional dependency X determines Y, written X arrow Y, means that any two tuples agreeing on X must agree on Y. Armstrong axioms generate all implied dependencies: reflexivity says that if Y is a subset of X then X determines Y; augmentation says that if X determines Y then XZ determines YZ; transitivity says that if X determines Y and Y determines Z then X determines Z. The closure of an attribute set X is the set of all attributes functionally determined by X; it is computed by starting with X and repeatedly adding the right-hand side of any dependency whose left-hand side is already contained in the closure, until nothing changes. A candidate key is a minimal set whose closure is all attributes. A canonical cover is a minimal equivalent set of dependencies: every right-hand side is a single attribute, no left-hand side contains an extraneous attribute, and no dependency is redundant.
Normal forms classify designs by which dependencies are allowed. A relation is in first normal form when every attribute value is atomic, with no repeating groups or multi-valued attributes. Second normal form adds that the relation is in first normal form and every non-prime attribute is fully functionally dependent on every candidate key, which removes partial dependencies on part of a composite key. Third normal form adds that no non-prime attribute is transitively dependent on any candidate key. Boyce-Codd normal form strengthens this: for every non-trivial dependency X determines Y, X must be a superkey. Every BCNF relation is in third normal form, but the reverse does not hold: a relation can satisfy third normal form through a prime attribute on the right-hand side while violating BCNF. Fourth normal form concerns multi-valued dependencies rather than functional dependencies and is tested less often, but its idea is the same: a non-trivial multi-valued dependency must be determined by a superkey.
Decomposition must satisfy two properties. Lossless join means the original relation can be recovered exactly by joining the pieces; a binary decomposition into R1 and R2 is lossless when the common attributes form a superkey of at least one piece. Dependency preservation means every original dependency is enforced by the dependencies within the pieces, without needing a join to check it. It is not always possible to achieve BCNF, losslessness and dependency preservation together; third normal form synthesis guarantees the latter two, which is why it is often the practical stopping point. Anomalies explain why this matters: an insertion anomaly forces dummy data to record a fact, a deletion anomaly loses unrelated facts when a row is deleted, and an update anomaly requires changing many rows for one fact. Normalisation removes each anomaly by placing each fact in exactly one place.
How this is examined: expect closure computations, candidate-key identification, normal-form classification of a given relation, a decomposition step with a losslessness check, and SQL questions on joins, grouping, HAVING versus WHERE, correlated subqueries, and views. Always compute the closure before naming a key, and always check the common attributes before claiming a decomposition is lossless.
Transactions & concurrency
A transaction is a unit of work that must satisfy ACID properties. Atomicity means the transaction executes entirely or not at all; a failure part-way must leave no partial effects. Consistency means a transaction moves the database from one valid state to another, preserving constraints and invariants. Isolation means concurrently executing transactions behave as if they ran one after another, even though they are interleaved. Durability means the effects of a committed transaction survive crashes. A schedule is an interleaving of the operations of several transactions. A serial schedule runs transactions one after another with no interleaving; a serializable schedule is one whose effect equals that of some serial schedule, which is the correctness criterion for concurrency control.
Conflict serializability is the practical test. Two operations conflict when they belong to different transactions, access the same data item, and at least one is a write. Read-read pairs do not conflict; read-write and write-write pairs do. The precedence graph of a schedule has a node per transaction and an edge from Ti to Tj whenever an operation of Ti conflicts with and precedes an operation of Tj. The schedule is conflict serializable exactly when this graph has no cycle, and any topological order of the graph is an equivalent serial order. View serializability is a weaker, more general condition based on reads-from relationships and final writes; every conflict-serializable schedule is view serializable, but not conversely, and testing view serializability is computationally harder, so systems rely on conflict serializability. Non-serializable schedules exhibit lost updates, dirty reads, unrepeatable reads and phantom reads, defined in the table below.
Locking is the standard mechanism. A shared lock permits reading; an exclusive lock permits reading and writing, and no other transaction may hold a conflicting lock on the same item. Two-phase locking requires that a transaction acquire all locks before releasing any: a growing phase of acquisitions followed by a shrinking phase of releases. This protocol guarantees conflict serializability. Strict two-phase locking additionally holds exclusive locks until commit or abort, which also prevents dirty reads and makes abort safe by avoiding cascading rollback. Rigorous two-phase locking holds all locks, shared and exclusive, until commit or abort. Two-phase locking alone does not prevent deadlock: two transactions waiting on each other locks form a cycle in the wait-for graph. Deadlock is handled by prevention, for example ordering lock acquisition or using wait-die and wound-wait rules based on timestamps, by detection with a wait-for graph cycle check followed by aborting a victim, or by timeout. Fine lock granularity permits more concurrency but costs more lock management; coarse granularity is cheaper but blocks more work.
Timestamp ordering is an alternative that needs no locks. Each transaction receives a unique timestamp at start. Each data item carries a read timestamp, the largest timestamp of a transaction that read it, and a write timestamp, the largest timestamp of a transaction that wrote it. A read is permitted only if the reader timestamp is at least the write timestamp; otherwise the transaction aborts and restarts with a new timestamp. A write is permitted only if its timestamp is at least both the read and write timestamps; an obsolete write may be ignored under the Thomas write rule. Timestamp ordering guarantees serializability in timestamp order and is deadlock-free because no transaction waits, but it can abort transactions more often than locking. Multiversion concurrency control keeps several versions of each item so readers can read a consistent old version without blocking writers.
Recovery restores the database after a failure. The write-ahead logging rule states that a log record for a change must reach stable storage before the changed database page does, and a commit record must reach stable storage before the transaction is considered committed. Recovery then uses undo and redo: undo rolls back transactions that had not committed at the crash, restoring old values from the log; redo reapplies the changes of committed transactions whose pages may not have reached disk. A checkpoint writes buffered pages to disk and records a checkpoint marker, bounding how far back recovery must scan. Shadow paging keeps a shadow page table for the old database and a current table for the new version; committing is the atomic switch of tables, so no log is needed, but it is less common in large systems.
How this is examined: expect a schedule to be tested for conflict serializability with a graph, a statement about which locking variant prevents which anomaly, a deadlock scenario with a remedy, a timestamp-ordering decision for a read or write, and a recovery question asking whether undo, redo, both or neither apply to a transaction given its commit status at crash time.
Key definitions
- Entity: A distinguishable object or concept in the domain being modelled, such as a student or a course.
- Weak entity: An entity that cannot be identified by its own attributes alone and depends on an owner entity through an identifying relationship.
- Candidate key: A minimal superkey: an attribute set that identifies each tuple uniquely and from which no attribute can be removed without losing uniqueness.
- Foreign key: An attribute set in one relation that refers to the primary key of another relation.
- Referential integrity: The constraint that every non-null foreign key value must match an existing primary key value in the referenced relation.
- Selection: The relational algebra operator that returns the rows of a relation satisfying a given condition.
- Projection: The relational algebra operator that returns specified columns of a relation, discarding duplicates in the set-based model.
- Natural join: A join that combines tuples agreeing on all common attributes and keeps one copy of each shared attribute.
- Division: The relational algebra operator that returns values paired with every value in the divisor, expressing for-all queries.
- Functional dependency: A constraint X determines Y meaning any two tuples agreeing on X must agree on Y.
- Attribute closure: The set of all attributes functionally determined by a given attribute set under a set of dependencies.
- Canonical cover: A minimal equivalent set of functional dependencies with single-attribute right-hand sides, no extraneous left-hand attributes and no redundant dependencies.
- Lossless join decomposition: A decomposition from which the original relation can be recovered exactly by joining the pieces.
- Dependency preservation: The property that every original functional dependency is enforced within the decomposed relations without needing a join.
- Transaction: A unit of work that must satisfy atomicity, consistency, isolation and durability.
- Conflict serializability: The property that a schedule is equivalent to some serial schedule when conflicting operations are considered, tested by an acyclic precedence graph.
- Two-phase locking: A protocol in which a transaction acquires all locks before releasing any, guaranteeing conflict serializability.
- Deadlock: A situation in which transactions wait on each other in a cycle so none can proceed.
- Timestamp ordering: A concurrency protocol that orders transactions by start timestamp and aborts operations that would violate that order.
- Write-ahead logging: The rule that a log record for a change must reach stable storage before the changed database page does.
Formulas
- Armstrong reflexivity: if Y is a subset of X, then X -> Y
- Armstrong augmentation: if X -> Y, then XZ -> YZ
- Armstrong transitivity: if X -> Y and Y -> Z, then X -> Z
- Lossless binary decomposition: R1 and R2 are lossless if (R1 intersect R2) -> R1 or (R1 intersect R2) -> R2
- BCNF condition: for every non-trivial dependency X -> Y, X must be a superkey
- Conflict condition: two operations conflict if they are from different transactions, access the same item, and at least one is a write
Worked examples
Example 1: Given R(A, B, C, D) with dependencies A -> B, B -> C, and A -> D, find the closure of {A} and identify a candidate key.
Start with closure {A} = {A}. Dependency A -> B applies because A is in the closure, so add B to get {A, B}. Dependency B -> C applies because B is now in the closure, so add C to get {A, B, C}. Dependency A -> D applies, so add D to get {A, B, C, D}. The closure of {A} is all attributes, so A determines every attribute. No smaller set can do this, since the empty set determines nothing, so A is a candidate key. Note that B alone gives {B, C} only, so B is not a key.
Example 2: Decompose R(Student, Course, Instructor) with Student, Course -> Instructor and Instructor -> Course into BCNF, and check losslessness of the first split.
The dependency Instructor -> Course violates BCNF because Instructor is not a superkey: its closure is {Instructor, Course}, not all attributes. Split on this dependency into R1(Instructor, Course) and R2(Student, Instructor). The common attributes are {Instructor}. Instructor is a superkey of R1 because Instructor -> Course holds within R1, so the decomposition is lossless by the binary test. In R1, Instructor -> Course now has a superkey on the left, so R1 is in BCNF. In R2 the only dependency is the key Student, Instructor, so R2 is in BCNF. The dependency Student, Course -> Instructor is not preserved within either piece, which illustrates that BCNF can sacrifice dependency preservation.
Example 3: Schedule S: T1 reads A, T2 reads A, T1 writes A, T2 writes A. Is S conflict serializable? Draw the precedence graph reasoning.
List conflicting pairs in order. T1 reads A then T2 writes A: read-write conflict, so edge T1 -> T2. T2 reads A then T1 writes A: read-write conflict, so edge T2 -> T1. T1 writes A then T2 writes A: write-write conflict, so edge T1 -> T2 again. The graph has edges in both directions between T1 and T2, forming a cycle. A cycle means the schedule is not conflict serializable. No serial order can preserve both conflicting orders, so the schedule is not acceptable under conflict serializability.
Example 4: A transaction T committed before a crash, but its updated page had not reached disk. During recovery, does T need undo, redo, both, or neither?
T needs redo only. Redo reapplies committed changes that may be missing from disk, using the log. Undo is for transactions that had not committed at crash time, to roll back their partial effects. Since T committed, its effects must survive, so recovery redoes them and does not undo them.
Normal forms compared
| Normal form | Requirement added | Dependency it removes |
|---|---|---|
| 1NF | Atomic attribute values | Repeating groups |
| 2NF | No partial dependency on part of a composite key | Partial dependencies |
| 3NF | No transitive dependency of a non-prime attribute on a key | Transitive dependencies |
| BCNF | Every determinant is a superkey | Dependencies where a non-superkey determines an attribute, including prime attributes |
Locking variants compared
| Protocol | Lock release rule | Extra guarantee |
|---|---|---|
| Basic 2PL | No lock released before all acquisitions end | Conflict serializability |
| Strict 2PL | Exclusive locks held until commit or abort | Also avoids dirty reads and cascading rollback |
| Rigorous 2PL | All locks held until commit or abort | Also gives strictest recoverability |
Join types compared
| Join | Rows returned |
|---|---|
| Inner join | Only matched pairs |
| Left outer join | All left rows, nulls for unmatched right columns |
| Right outer join | All right rows, nulls for unmatched left columns |
| Full outer join | All rows from both sides, nulls where unmatched |
Serializability and anomalies
| Anomaly | What happens |
|---|---|
| Lost update | One transaction overwrites another concurrent write |
| Dirty read | A transaction reads data from a transaction that later aborts |
| Unrepeatable read | Same item read twice in one transaction gives different values |
| Phantom read | Same predicate returns a different set of rows on re-execution |
Diagrams (described)
ER diagram sketch: rectangle entities for Student and Course, diamond relationship Enrolment between them, ovals for attributes, underlined key attributes, double rectangle for a weak entity with its owner, and cardinality labels on each relationship edge.
Precedence graph sketch: one node per transaction, directed edge from Ti to Tj for each conflicting pair in schedule order, with a cycle highlighted as the test for non-serializability.
Two-phase locking diagram: a timeline with a growing phase of lock acquisitions, a lock point, then a shrinking phase of releases, with strict 2PL extending exclusive locks to commit.
Recovery flowchart: crash -> scan log from last checkpoint -> undo list for uncommitted transactions -> redo list for committed transactions -> restored committed state.
Exam points
- Division is the relational algebra operator for for-all questions, such as students who have taken all courses in a set.
- A candidate key is minimal: removing any attribute must destroy uniqueness. A superkey need not be minimal.
- BCNF is stronger than 3NF: every BCNF relation is in 3NF, but a 3NF relation can violate BCNF through a prime attribute on the right-hand side.
- A binary decomposition is lossless when the common attributes form a superkey of at least one piece; otherwise information can be lost or spurious tuples created.
- HAVING filters groups after aggregation; WHERE filters rows before grouping. Putting an aggregate condition in WHERE is an error.
- A correlated subquery refers to the outer query and runs once per outer row; an uncorrelated subquery runs once.
- Conflict serializability is tested by an acyclic precedence graph; read-read pairs never create an edge because they do not conflict.
- Strict 2PL holds exclusive locks until commit or abort, preventing dirty reads; basic 2PL alone guarantees serializability but not that.
- Write-ahead logging requires the log record on stable storage before the changed page; commit requires the commit record on stable storage first.
- An index speeds retrieval but does not change query results; it costs extra storage and slower updates.
Common mistakes
- Mistake: calling any unique attribute set a candidate key. Correction: a candidate key must be minimal; a non-minimal unique set is only a superkey.
- Mistake: claiming a decomposition is lossless because the pieces look sensible. Correction: apply the test: the common attributes must functionally determine one piece entirely.
- Mistake: putting an aggregate condition in WHERE. Correction: WHERE filters rows before grouping; aggregate conditions belong in HAVING after GROUP BY.
- Mistake: treating read-read pairs as conflicts in a precedence graph. Correction: only read-write and write-write pairs on the same item from different transactions conflict.
- Mistake: saying 3NF and BCNF are the same. Correction: BCNF requires every determinant to be a superkey; 3NF permits a determinant that is not a superkey when the determined attribute is prime.
- Mistake: assuming two-phase locking prevents deadlock. Correction: 2PL guarantees serializability, not deadlock freedom; deadlock needs prevention, detection or timeout separately.
- Mistake: redoing uncommitted transactions or undoing committed ones in recovery. Correction: redo committed, undo uncommitted; the commit status at crash time decides.
Practice questions from this note (original practice — not official PYQs)
Checking login…
Quick revision: Design: entities, attributes, keys and cardinality in ER; weak entities need an owner key; relational keys are superkey, candidate key, primary key and foreign key, guarded by entity and referential integrity. Algebra: selection filters rows, projection picks columns, join combines on common attributes, division answers for-all. SQL: WHERE filters rows, GROUP BY groups, HAVING filters groups; inner join keeps matches only, outer joins preserve one or both sides; correlated subqueries run per outer row. Dependencies: closure is built by repeatedly adding right-hand sides; candidate keys are minimal closures covering all attributes; canonical cover is minimal and equivalent. Normal forms: 1NF atomic values, 2NF no partial dependency, 3NF no transitive dependency of a non-prime attribute, BCNF every determinant a superkey; check losslessness by the common-attribute test and remember BCNF can lose dependency preservation. Transactions: ACID; conflict serializability means an acyclic precedence graph; 2PL gives serializability, strict 2PL also blocks dirty reads, deadlock needs prevention or detection; timestamp ordering aborts out-of-order operations and is deadlock-free. Recovery: write-ahead log first, redo committed, undo uncommitted, checkpoints bound the scan.
Unit revision note (quick recap)
A database must store each fact once, answer queries correctly, and survive crashes and concurrent users without losing money or data.
Learning objectives
- Design ER models and relational schemas
- Write SQL and normalise to BCNF
- Explain transactions and concurrency
Key concepts
- 2NF: 1NF + no partial dependency: a non-key attribute must depend on the whole key, not part of it.
- 3NF: 2NF + no transitive dependency: non-key attributes must not depend on other non-key attributes.
- ACID: Atomicity, Consistency, Isolation, Durability — the transaction contract.
- Two-phase locking: Grow (acquire) then shrink (release) — guarantees conflict-serialisability.
- Foreign key: A column referencing a primary key elsewhere, enforcing referential integrity.
Worked examples
- Student(id, name, dept_name) repeats dept_name: split into Students(id, name, dept_id) + Departments(dept_id, name).
Exam points
- Partial dependency → 2NF violation. Transitive dependency → 3NF violation.
- Deadlock needs all four Coffman conditions; break any one to prevent it.
Common mistakes
- Normalising to 3NF but forgetting that BCNF is stricter: every determinant must be a superkey.
Quick revision: ER, relational algebra, SQL joins/subqueries, normal forms, transactions, locking, recovery.
Practice questions from the whole unit bank (31 in the bank)
This unit's practice bank — the note above has its own smaller practice set drawn from the same bank, so a question can appear in both lists. The list below shows the free sample or the full bank depending on your plan.
Checking login…
Related tests
Unit test for this unit (31 bank questions, 38 min) · Full Mock — CS Paper 2 (100 questions) · Combined 150-question mock (180 min). All +2 per correct, no negative marking.
Revision summary
ER, relational algebra, SQL joins/subqueries, normal forms, transactions, locking, recovery.
After revising, take the unit test above, then check your unit-wise report on the Dashboard to find weak topics.