Counted from the questions in the past papers listed on this site. Repeated = how many times the topic came in those papers.
Database Management Systems important questions with answers
Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The questions under each topic are copied from the RGPV papers.
Q1. Keys and integrity constraints
Asked 15 times in 2020, 2022, 2023, 2024, 2025 · Unit 2
From the papers
“Discuss the importance of integrity and referential integrity constraints.” (2024, 2025)
“Explain relational data model concepts: relations, attributes, tuples, domains and keys.” (2025)
“What is relational model? Distinguish super key, candidate key and primary key with examples.” (2025)
The short answer
A key is a set of attributes that picks out exactly one tuple of a relation. Integrity constraints are rules every row must follow, so wrong data cannot get into the database.
Write these points
Relation terms: a relation is a table, a tuple is a row and an attribute is a column.
A domain is the set of values a column may take.
Super key: any set of attributes whose values never repeat in two rows. {E_ID} and {E_ID, Name} are both super keys.
Candidate key: a minimal super key. Remove any attribute from it and it stops being unique.
Primary key: the candidate key the designer picks. It cannot be NULL. The other candidate keys are alternate keys.
Foreign key: a column in one table that refers to the primary key of another table, like Dept_ID in EMPLOYEE.
Domain constraint: each value must come from its column's domain, for example Age INT CHECK (Age > 0).
Entity integrity: no part of a primary key can be NULL. Referential integrity: a foreign key value must match a primary key value in the parent table or be NULL.
Example.
CREATE TABLE Employee (E_ID INT PRIMARY KEY, Name VARCHAR(30) NOT NULL, Dept_ID INT REFERENCES Department(Dept_ID) ON DELETE CASCADE); Now deleting department 101 also deletes every employee of 101. With ON DELETE SET NULL their Dept_ID would become NULL instead. Without either option the DBMS rejects the delete.
Real-life example
Your Aadhaar number picks out exactly one person in the country. In a database table it would be the primary key. A bank will not let an account point to a customer ID that does not exist. That is a foreign key rule.
Foreign key Dept_ID points to the primary key of DEPARTMENT. Every primary key is a candidate key. Every candidate key is a super key.
Same or opposite: primary key and foreign key
Point
Primary key
Foreign key
Same or opposite
Purpose
Identifies each row
Links to another table
Opposite
NULL allowed
No
Yes, unless stated
Opposite
Duplicates allowed
No
Yes
Opposite
Is an integrity constraint
Yes
Yes
Same
Exam tip. Draw two small tables and show the foreign key with an arrow to the primary key. A candidate key must be minimal. A super key does not have to be. Primary key means unique plus NOT NULL.
Asked 14 times in 2020, 2022, 2023, 2024, 2025 · Unit 3
From the papers
“Explain Boyce Codd normal form with an example.” (2022, 2024)
“Explain normalization and functional dependency. Discuss first, second and third normal forms.” (2025)
“Normalize R(A,B,C,D) with A->B, B->C, C->D.” (2025)
The short answer
Normalization is splitting a relation step by step into smaller relations so that redundancy goes away along with the insert, update and delete anomalies. Each normal form is a test the relation must pass.
Write these points
Why we need it: redundant data gives three anomalies.
Insert anomaly: a department with no employee cannot be added.
Delete anomaly: deleting the last employee loses the department.
Update anomaly: one change must be made in many rows.
1NF: every attribute holds one atomic value. No lists or repeating groups in a cell.
2NF: in 1NF with no non-prime attribute depending on only part of a candidate key (no partial dependency). It only matters when the key has two or more attributes.
3NF: in 2NF with no non-prime attribute depending on another non-prime attribute (no transitive dependency). Test: for every FD X -> A, X is a super key or A is a prime attribute.
BCNF: for every non-trivial FD X -> A, X must be a super key. Every BCNF relation is in 3NF. A 3NF relation may fail BCNF when a prime attribute depends on a non-key.
Each split must be lossless. A 3NF split can always keep every dependency. A BCNF split sometimes cannot.
Steps
Question (2025): normalize R(A, B, C, D) with A -> B, B -> C, C -> D.
Find the key: A+ = {A, B, C, D}, so A is the only candidate key.
2NF: the key has one attribute, so a partial dependency is not possible. R is in 2NF.
3NF: A -> B -> C -> D is a transitive chain, so R is not in 3NF.
Split on each FD: R1(A, B), R2(B, C), R3(C, D) with keys A, B and C.
In every new table the left side of its FD is the key, so all three are in BCNF. The shared columns B and C are keys, so the join is lossless.
One table taken to BCNF.
Table (Roll, Course, Name, Teacher, Room) with key (Roll, Course). FDs: Roll → Name, Course → Teacher, Teacher → Room.
2NF: Name depends on Roll alone while Teacher depends on Course alone. Split into Student(Roll, Name), Enroll(Roll, Course) and CourseT(Course, Teacher, Room).
3NF: Course → Teacher → Room is transitive. Split CourseT into Course(Course, Teacher) and Teacher(Teacher, Room).
Result: 4 tables, each in BCNF because every determinant is a key. A change of room is now made in one row.
Real-life example
A college that stores the HOD's phone number in every student row must change hundreds of rows when the number changes. Normalization moves that number to one department table, so it is stored once.
The STUDENT example from the 2025 paper, taken from 1NF to BCNF.
Same or opposite: 3NF and BCNF
Point
3NF
BCNF
Same or opposite
Rule for X → A
X is a superkey or A is prime
X is a superkey
Opposite
Strictness
Less strict
Stricter
Opposite
Dependency preserving split
Always possible
Not always
Opposite
Removes most redundancy
Yes
Yes
Same
Exam tip. Find the candidate key first. Then test 2NF, 3NF and BCNF one by one. Give the reason with each answer, for example: not in 2NF because Course -> Instructor is a partial dependency. BCNF in one line: every determinant is a super key.
Q3. DBMS architecture, three levels and data independence
Asked 14 times in 2020, 2022, 2023, 2024, 2025 · Unit 1
From the papers
“Explain data models, schemas and instances. What is data independence?” (2025)
“What is schema? Explain the overall database structure with a suitable example.” (2025)
“Explain the levels of database architecture. Describe the three-schema architecture and how it supports data independence.” (2025)
The short answer
The three-level (ANSI/SPARC) architecture keeps apart how users see the data, what data is stored and how it is stored on disk. Data independence means we can change the schema at one level without changing the level above it.
Write these points
External level (view level): each user or program sees only the part of the data it needs. A student sees his own marks, the accounts office sees fees.
Conceptual level (logical level): one schema for the whole database with all tables, attributes, relationships and constraints. It has no storage details.
Internal level (physical level): how records sit on disk, with files, indexes, block sizes and access paths.
Two mappings join the levels: external/conceptual and conceptual/internal. The DBMS uses them to turn a user request into disk operations.
Logical data independence: change the conceptual schema (add a column or a table) without changing views or programs. It is harder to get.
Physical data independence: change the internal schema (add an index, move files) without changing the conceptual schema.
Who uses each level: end users and programs see the external level, the DBA and designers work at the conceptual level, the DBMS itself handles the internal level.
Schema and instance: the schema is the design and rarely changes. The instance is the data present at one moment and changes all the time.
Parts of a DBMS: the query processor (DDL interpreter, DML compiler, evaluation engine).
The storage manager (buffer, file, transaction and authorization managers).
Disk storage (data files, data dictionary, indexes).
Data independence before and after.
External view for the result app: Result = SELECT Roll, Marks FROM Student.
Physical change: add an index on Marks and move the file to an SSD. The conceptual schema does not change, so no query changes.
Logical change: add a column Email to Student. The view Result still has Roll and Marks, so the result app keeps working.
Only the mapping between the levels is updated, never the application code.
Real-life example
A bank can move its data to faster disks without changing the mobile app. That is physical data independence. The app keeps working because it sees only its external view.
Three-level architecture. Each mapping is where one kind of data independence comes from.
Same or opposite: logical and physical data independence
Point
Logical
Physical
Same or opposite
Change allowed in
Conceptual schema
Internal schema
Opposite
Example
Add a column
Move to new disks, add an index
Opposite
Difficulty
Harder
Easier
Opposite
Apps keep working
Yes
Yes
Same
Exam tip. Draw the three levels with both mappings. The diagram carries most of the marks. Logical independence sits between external and conceptual. Physical independence sits between conceptual and internal.
“Explain fundamental operations in relational algebra with examples.” (2023, 2025)
“Discuss in detail the operators SELECT, PROJECT and UNION with suitable examples.” (2022, 2024)
“Discuss the relational algebra operations SELECT, PROJECT, DIVISION with examples.” (2022, 2024)
The short answer
Relational algebra is a procedural query language. Each operation takes one or two relations as input and gives a new relation as output, so operations can be nested.
Write these points
Select (sigma): keeps the rows that meet a condition. sigma Salary > 5000 (Employee).
Project (pi): keeps the named columns and removes duplicate rows. pi Name, Salary (Employee).
Union, intersection and set difference need union compatible relations: the same number of attributes with matching domains.
Cartesian product (R x S): pairs every row of R with every row of S. If R has m rows and S has n rows, the result has m times n rows.
Rename (rho) gives a new name to a relation or attribute. Select, project, union, set difference, product and rename are the six fundamental operations.
Joins: a theta join keeps product rows that meet any condition. An equi join uses only = conditions and keeps both columns. A natural join matches on all common attributes and keeps one copy.
Outer joins also keep unmatched rows and fill the gaps with NULL: left, right and full outer join.
Division (R / S): gives the values in R that are paired with every value in S, such as students who took all the courses.
Example.
EMP(Eid, Dept) and DEPT(Dept, Dname), employees working in Sales (2025): pi Eid (sigma Dname = 'Sales' (EMP natural join DEPT)). EMP has no name column, so we project Eid. Select first, then join, because a smaller DEPT makes the join cheaper.
Real-life example
When a shopping site shows your orders with product names, it joins the Orders table with the Products table on product ID. That is a natural join done for you behind the screen.
The 2022 question worked out: R natural join S, then the result joined with T.
Same or opposite: natural join and outer join
Point
Natural join
Left outer join
Same or opposite
Rows without a match
Dropped
Kept, with NULLs
Opposite
Common columns
Shown once
Shown once
Same
Symbol
⋈
⟕
Opposite
Combines two relations
Yes
Yes
Same
Exam tip. For each operation write its symbol, its general form and a two or three row example. A natural join keeps the common column once. An equi join keeps it twice. Project removes duplicate rows. SQL SELECT keeps them unless you write DISTINCT.
Asked 12 times in 2020, 2022, 2023, 2024, 2025 · Unit 1
From the papers
“Describe the ER data model. Explain entities, attributes and relationships with examples.” (2025)
“Draw an ER diagram for a library system and transform it into relational tables.” (2025)
“What is ER diagram? Explain its components and notation. Draw an ER diagram for an Employee Project Management System.” (2025)
The short answer
The ER (entity relationship) model describes data as entities, their attributes and the relationships between them. An ER diagram draws this design before any table is made.
Write these points
Entity: a real-world object such as an employee. A strong entity has its own key. A weak entity (CHILD) has only a partial key and is identified through its owner entity.
Attributes: simple or composite (Name = first + last), single valued or multivalued (many phone numbers), stored or derived (age from date of birth). The key attribute is underlined.
Relationship: an association between entities, like WORKS_IN. Cardinality is 1:1, 1:N or M:N. Participation is total (double line) or partial (single line).
Symbols: rectangle for an entity, double rectangle for a weak entity, diamond for a relationship, double diamond for an identifying relationship.
Ellipse for an attribute, double ellipse for multivalued, dashed ellipse for derived.
Weak to strong: give the weak entity a key of its own (say Child_ID). Or carry the owner's key into it so the combined key is unique.
Steps
Each strong entity becomes a table with its key as the primary key: EMPLOYEE(ssn, salary, phone), DEPARTMENT(dno, dname, budget).
A weak entity becomes a table with the owner's key plus its partial key: CHILD(ssn, name, age). Make ssn a foreign key with ON DELETE CASCADE, so a child's row goes when the parent leaves.
A 1:N relationship puts the key of the 1 side into the N side table: MANAGES adds mgr_ssn to DEPARTMENT.
An M:N relationship becomes its own table holding both keys: WORKS_IN(ssn, dno).
A multivalued attribute gets a separate table, for example EMP_PHONE(ssn, phone).
An ER diagram turned into tables.
Entities Student(Roll, Name) and Course(CID, Title). M:N relationship Enrolls with the attribute Grade.
A 1:N link such as Dept has Employees needs no extra table. DeptID goes into Employee as a foreign key.
A multivalued attribute Phone gets its own table StudentPhone(Roll, Phone). So the design gives 4 tables for students and courses.
Real-life example
Before a hospital system is built, the designers draw patients, doctors and appointments as boxes and diamonds. That ER diagram then becomes the actual tables.
ER diagram for the 2023 company question. CHILD is weak and depends on EMPLOYEE.
Same or opposite: strong and weak entity
Point
Strong entity
Weak entity
Same or opposite
Own primary key
Yes
No, uses a partial key
Opposite
Symbol
Single rectangle
Double rectangle
Opposite
Depends on another entity
No
Yes
Opposite
Becomes a table
Yes
Yes
Same
Exam tip. Underline keys. Use a dashed underline for the partial key of a weak entity. Write the cardinality (1, N, M) on every relationship line.
“SQL: create table STUDENT(RollNo, Name, Marks), insert two records, retrieve students with Marks > 60.” (2025)
“Write SQL queries to show an equi-join, an outer join and a nested query using EXISTS.” (2025)
“Explain DDL and embedded SQL with examples.” (2025)
The short answer
SQL is the standard language of relational databases. Its commands fall into four groups: DDL defines structure, DML works on the data, DCL controls access and TCL controls transactions.
DML: SELECT, INSERT, UPDATE, DELETE. Example: UPDATE Student SET Marks = 65 WHERE RollNo = 2;
DCL: GRANT, REVOKE. Example: GRANT SELECT ON Student TO clerk; TCL: COMMIT, ROLLBACK, SAVEPOINT. Example: ROLLBACK TO sp1;
Queries on the 2023 table Employee(E_ID, E_Name, Gender, Salary, Manager_ID, Dept_ID):
Departments with average salary above 4000: SELECT Dept_ID FROM Employee GROUP BY Dept_ID HAVING AVG(Salary) > 4000; (gives 101)
Same for male employees above 2000: SELECT Dept_ID FROM Employee WHERE Gender = 'M' GROUP BY Dept_ID HAVING AVG(Salary) > 2000; (gives 101 and 102)
Second highest salary: SELECT E_Name, Salary, Dept_ID FROM Employee WHERE Salary = (SELECT MAX(Salary) FROM Employee WHERE Salary < (SELECT MAX(Salary) FROM Employee)); (gives B, 5000, 101)
Salary above employee F: SELECT E_ID, E_Name FROM Employee WHERE Salary > (SELECT Salary FROM Employee WHERE E_Name = 'F');
Higher than anyone in Dept 102: ... WHERE Salary > ANY (SELECT Salary FROM Employee WHERE Dept_ID = 102); For higher than all in Dept 103 write > ALL. > ANY beats the smallest value. > ALL beats the largest.
WHERE filters rows before grouping. HAVING filters groups after GROUP BY. ORDER BY sorts the result.
Example.
2025 question: CREATE TABLE Student (RollNo INT PRIMARY KEY, Name VARCHAR(30), Marks INT);
INSERT INTO Student VALUES (1, 'Asha', 72); INSERT INTO Student VALUES (2, 'Ravi', 55);
SELECT * FROM Student WHERE Marks > 60; returns only Asha.
Real-life example
A college portal uses CREATE TABLE once when it is built. It runs INSERT for each admission and SELECT for every result page. It gives teachers GRANT rights and uses COMMIT when fees are paid.
Figure: groups of SQL commands
Same or opposite: DDL and DML
Point
DDL
DML
Same or opposite
Works on
Structure
Data in rows
Opposite
Commands
CREATE, ALTER, DROP
INSERT, UPDATE, DELETE
Opposite
Auto commit
Yes
No, needs COMMIT
Opposite
Part of SQL
Yes
Yes
Same
Exam tip. A condition on SUM, AVG, COUNT, MAX or MIN goes in HAVING, never in WHERE. DELETE is DML and can be rolled back. TRUNCATE and DROP are DDL and commit at once in Oracle. End each statement with a semicolon and write the keywords in capitals.
Two-phase locking (2PL) is a locking protocol with two phases: a transaction takes locks in the growing phase, then gives them up in the shrinking phase. After it releases any lock it may not take a new one.
Write these points
Lock modes: a shared lock S(A) lets a transaction read A. An exclusive lock X(A) lets it read and write A. A request for S is granted while others hold only S. Any request that involves X must wait.
Growing phase: the transaction may get locks but may not release any.
Shrinking phase: it may release locks but may not get new ones. The moment it gets its last lock is its lock point.
2PL guarantees conflict serializability. The serial order is the order of the lock points.
Basic 2PL can still allow cascading rollback (a transaction reads a value that is later rolled back) and deadlock.
Strict 2PL holds every exclusive lock until commit or abort, which stops cascading rollback. Rigorous 2PL holds every lock, shared too, until commit, so transactions serialize in commit order.
Conservative 2PL takes all locks before the transaction starts. It never deadlocks, but the read and write sets must be known in advance.
Example.
T1: lock-X(A), read(A), A = A - 50, write(A), lock-X(B), read(B), B = B + 50, write(B), unlock(A), unlock(B), commit. This is basic 2PL with its lock point at lock-X(B). For strict or rigorous 2PL move both unlocks after the commit. Here T1 holds only X locks, so strict and rigorous look the same.
Real-life example
Two people book the last train seat at the same moment on IRCTC. Locking makes one wait until the other finishes. So the seat is not sold twice.
Locks held over time. In strict and rigorous 2PL the release happens at commit.
Same or opposite: basic 2PL and strict 2PL
Point
Basic 2PL
Strict 2PL
Same or opposite
Exclusive locks released
In the shrinking phase
Only at commit or abort
Opposite
Cascading rollback
Possible
Not possible
Opposite
Gives serializable schedules
Yes
Yes
Same
Deadlock possible
Yes
Yes
Same
Exam tip. Draw the growing and shrinking curve and mark the lock point. 2PL ensures serializability. It does not prevent deadlock. Strict keeps X locks until commit. Rigorous keeps all locks until commit.
“What is serializability? Explain testing of serializability, conflict and view serializable schedules.” (2025)
The short answer
A schedule is the order in which the operations of concurrent transactions run. A schedule is serializable if its result is the same as that of some serial schedule, where the transactions run one after another.
Write these points
Two operations conflict when they belong to different transactions, use the same data item and at least one of them is a write (R-W, W-R or W-W).
Conflict serializable: we can turn the schedule into a serial one by swapping adjacent operations that do not conflict.
View serializable: each read reads from the same write as in some serial schedule. The final write of each item is also made by the same transaction.
Every conflict serializable schedule is view serializable. A view serializable schedule with blind writes may not be conflict serializable.
Testing view serializability is NP-complete, so real systems test conflict serializability.
Steps
Draw one node for each transaction.
For every conflicting pair where Ti's operation comes before Tj's, draw an edge Ti -> Tj.
A cycle means the schedule is not conflict serializable.
No cycle means it is. A topological order of the graph gives the equal serial schedule.
Example.
R1(X), W1(X), R2(X), W2(X), R1(Y), W1(Y) (2025): every conflict is on X with T1 first, so the only edge is T1 -> T2.
It is conflict serializable and equals T1 then T2.
In T1:R(A), T2:R(A), T1:W(A), T2:W(A), T1:R(B), T2:W(B) (IS-502 2025) we get T2 -> T1 from R2(A), W1(A).
We also get T1 -> T2 from W1(A), W2(A). That is a cycle, so it is not conflict serializable.
It is not view serializable either. In T1 then T2, T2 would read A written by T1. In T2 then T1, the final write of A would be by T1.
Real-life example
Many students pay fees at once on a portal. The database runs their steps mixed together for speed. Serializability makes sure the final balances are the same as if they paid one by one.
Two schedules from the 2025 papers. The right one has a cycle.
Same or opposite: conflict and view serializability
Point
Conflict
View
Same or opposite
Test
Precedence graph has no cycle
Same reads and final writes
Opposite
Difficulty to test
Easy, polynomial
Hard, NP-complete
Opposite
Which set is larger
Smaller set
Larger, holds every conflict serializable schedule
Opposite
Means equal to a serial schedule
Yes
Yes
Same
Exam tip. Label every edge with the pair of operations that caused it. If there is no cycle, also write the serial order.
Asked 9 times in 2020, 2022, 2023, 2024, 2025 · Unit 4
From the papers
“Explain log-based recovery and checkpoints with an example.” (2025)
“Discuss recovery from transaction failures. Explain log-based recovery and the role of checkpoints.” (2025)
“What is transaction? Discuss transaction recovery techniques.” (2024)
The short answer
The log is a file on stable storage that records every change a transaction makes before the change reaches the database. After a failure the DBMS reads the log to redo committed work and undo unfinished work.
Write these points
Log records: <Ti start>, <Ti, X, old value, new value>, <Ti commit>, <Ti abort>.
Write-ahead logging: the log record must be on stable storage before the changed data page is written to disk.
Deferred update: changes reach the database only after commit, so recovery needs redo only.
Immediate update: changes may reach the database before commit, so recovery needs undo (old values) and redo (new values).
Redo Ti if the log has <Ti start> and <Ti commit>. Undo Ti if it has <Ti start> with no commit or abort.
Checkpoint: the DBMS forces the log and the changed pages to disk and writes <checkpoint L>, with L the list of active transactions. Recovery then reads only the log after the last checkpoint.
ARIES uses three passes. Analysis finds the dirty pages and the active transactions. Redo repeats history forward from the oldest needed record. Undo rolls back the unfinished transactions backward and writes compensation log records.
Example.
Log: <T1 start>, <T1, A, 1000, 950>, <T1, B, 2000, 2050>, <T1 commit>, <T2 start>, <T2, C, 700, 600>, then a crash. Redo T1, so A = 950 and B = 2050. Undo T2, so C goes back to 700.
Real-life example
If the power fails while an ATM is updating your balance, the bank uses its log after restart. It redoes the finished transfers and undoes the half-done one. Your money stays correct.
Five transactions around one checkpoint and a crash.
Same or opposite: deferred and immediate update
Point
Deferred update
Immediate update
Same or opposite
Writes to the database
After commit
Before commit
Opposite
Undo needed
No
Yes
Opposite
Redo needed
Yes
Yes
Same
Uses a log
Yes
Yes
Same
Exam tip. Undo uses old values. Redo uses new values. Undo goes backward through the log. Redo goes forward. From the checkpoint picture, list which transactions are redone and which are undone.
“Candidate keys and highest normal form of R(ABCDEF) with A->BC, C->E, E->F, F->AB.” (2022, 2023)
“What is functional dependency? Describe the properties of FDs.” (2024)
“Compute the minimal (canonical) cover of R(WXYZ) with X->W, WZ->XY, Y->WXZ.” (2023)
The short answer
In a relation R, X -> Y (X functionally determines Y) means any two tuples that agree on X also agree on Y. FDs are how we find keys and decide normal forms.
Write these points
Trivial FD: Y is a subset of X, as in AB -> A. Every other FD is non-trivial.
Armstrong's axioms, which are sound and complete. Reflexivity: if Y is a subset of X then X -> Y.
Augmentation: X -> Y gives XZ -> YZ. Transitivity: X -> Y with Y -> Z gives X -> Z.
Derived rules: union (X -> Y with X -> Z gives X -> YZ) and decomposition (X -> YZ gives X -> Y).
Pseudo-transitivity: X -> Y with WY -> Z gives WX -> Z.
Closure X+: every attribute that X determines. If X+ holds all of R, X is a super key. If no smaller part of X does the same, X is a candidate key.
An attribute that never appears on a right side must be in every key. Start the key search with those.
Minimal (canonical) cover: an equal set of FDs with one attribute on each right side, no extra attribute on any left side and no redundant FD.
Steps
Minimal cover of X -> W, WZ -> XY, Y -> WXZ (2023). Split the right sides: X -> W, WZ -> X, WZ -> Y, Y -> W, Y -> X, Y -> Z.
Left sides: W+ = {W} and Z+ = {Z}, so neither W nor Z alone gives X or Y. Nothing is extra.
Redundant FDs: Y -> W follows from Y -> X and X -> W, so drop it. WZ -> X follows from WZ -> Y and Y -> X, so drop it.
Each of X -> W, WZ -> Y, Y -> X, Y -> Z is needed. Answer: X -> W, WZ -> Y, Y -> XZ.
Example.
R(ABCDEF) with A -> BC, C -> E, E -> F, F -> AB (2023). D is on no right side, so every key has D. AD+, CD+, DE+ and DF+ are all of R, so the candidate keys are AD, CD, DE and DF. B is the only non-prime attribute and A -> B makes it depend on part of the key AD. So R is only in 1NF.
Real-life example
In a college table, roll number decides the student's name. Roll number → name is a functional dependency. Knowing such rules tells you which column can be the key.
Closure of B for the 2020 question. B alone gives every attribute.
Same or opposite: closure of attributes and minimal cover
Point
Attribute closure X⁺
Minimal cover
Same or opposite
Gives
All attributes X decides
Smallest equal set of FDs
Opposite
Used for
Finding keys
Designing 3NF tables
Opposite
Uses Armstrong's rules
Yes
Yes
Same
Changes the set of FDs
No
Yes, removes extras
Opposite
Exam tip. Write each closure step with the FD you used. To find the highest normal form, list the keys and the prime attributes first.
Asked 8 times in 2020, 2022, 2023, 2024, 2025 · Unit 2
From the papers
“Explain triggers and assertions in SQL and their role in database integrity.” (2025)
“Explain briefly: triggers.” (2024)
“What is a trigger? Explain in detail with an example.” (2022)
The short answer
A trigger is a stored PL/SQL block that the DBMS runs by itself when a given event (INSERT, UPDATE or DELETE) happens on a table. An assertion is a condition on the database that must always stay true.
Write these points
A trigger has three parts: the event, an optional condition (WHEN clause) and the action.
Timing: BEFORE or AFTER the event. An INSTEAD OF trigger is written on a view so that the view can be updated.
Row-level triggers (FOR EACH ROW) run once per changed row and can read :OLD and :NEW. Statement-level triggers run once per statement.
Uses: audit trails, checks too complex for CHECK, keeping derived columns up to date and blocking wrong changes.
Mutating table error: a row-level trigger may not query or change the table it fires on. A statement-level or compound trigger avoids it.
Assertion syntax: CREATE ASSERTION name CHECK (condition). It is standard SQL, but Oracle and MySQL do not support it, so triggers do the job there.
Steps
CREATE OR REPLACE TRIGGER trg_salary_check
BEFORE INSERT OR UPDATE OF Salary ON Employee
FOR EACH ROW
BEGIN
IF :NEW.Salary < 0 THEN RAISE_APPLICATION_ERROR(-20001, 'Salary cannot be negative'); END IF;
END;
Example.
Assertion with the same rule: CREATE ASSERTION salary_ok CHECK (NOT EXISTS (SELECT * FROM Employee WHERE Salary < 0));
Real-life example
When stock of an item drops below 10, a shop's database can add a reorder row by itself. A trigger on the stock table does this without any person running a query.
Event, condition, action: the order in which a trigger fires.
Same or opposite: trigger and assertion
Point
Trigger
Assertion
Same or opposite
Action
Runs code on an event
Only checks a condition
Opposite
Scope
One table event
Whole database
Opposite
Support in Oracle and MySQL
Yes
No
Opposite
Keeps data correct
Yes
Yes
Same
Exam tip. A trigger runs by itself on its event. A procedure runs only when it is called. Write one full trigger with BEFORE or AFTER, the table name and FOR EACH ROW.
Q12. Query optimization: steps, heuristic and cost based
Asked 8 times in 2020, 2022, 2023, 2024, 2025 · Unit 3
From the papers
“Explain query optimization and its importance. Describe heuristic and cost-based optimization.” (2025)
“Give a brief note on query optimization.” (2024)
“Define optimization. Discuss the steps involved in query optimization.” (2024)
The short answer
Query optimization picks the cheapest of the many equal ways (execution plans) to run a query. The user says what data is wanted, while the optimizer decides how to get it.
Write these points
Step 1, parsing and translation: check the syntax and the names, then turn the SQL into a relational algebra expression (a query tree).
Step 2, optimization: build equal expressions with transformation rules and choose the plan with the lowest estimated cost.
Step 3, evaluation: the query evaluation engine runs the chosen plan and returns the result.
Heuristic rules: do selections and projections as early as possible.
Turn a product followed by a selection into a join. Run the most selective selections and joins first.
Sigma cascade: sigma (c1 AND c2) (R) = sigma c1 (sigma c2 (R)). It splits one selection so each part can be pushed down the tree.
Cost based: estimate each plan's cost from catalog statistics (number of tuples, blocks, distinct values, index height) and pick the cheapest.
Cost components: disk access (the largest), CPU time, memory buffers, storage of temporary results and network cost in a distributed database.
Algorithms: selection by linear scan, binary search or an index. Join by nested loop, block nested loop, indexed nested loop, sort-merge or hash join.
Example.
SELECT E.Name FROM Emp E, Dept D WHERE E.Dept_ID = D.Dept_ID AND D.Dname = 'Sales'; A poor plan forms the full product of Emp and Dept, then selects. A good plan first selects Dname = 'Sales' from Dept (one row), joins that row with Emp, then projects Name.
Real-life example
A map app finds the fastest route among many roads to the same place. A query optimizer does the same for a query. It picks the cheapest of many plans that give the same rows.
How a query moves from SQL text to the result.
Same or opposite: heuristic and cost based optimization
Point
Heuristic
Cost based
Same or opposite
Method
Fixed rules
Estimates the cost of plans
Opposite
Example rule
Do selection early
Choose the join order with least I/O
Opposite
Needs statistics
No
Yes
Opposite
Gives the same result rows
Yes
Yes
Same
Exam tip. Name the three steps and draw the block diagram. Disk access is the main cost the optimizer tries to cut.
Q13. Indexing, B+ tree, hashing and file organization
Asked 8 times in 2020, 2022, 2023, 2024, 2025 · Unit 2
From the papers
“Explain indexing in relational databases and the types of indexes.” (2025)
“State and explain various file organization methods.” (2023)
“Discuss in detail about Primary file organization.” (2020)
The short answer
An index is a separate structure of search key values with pointers to records, so the DBMS finds rows without reading the whole file. File organization is how the records are placed in the file.
Write these points
File organizations: heap (any order, fast insert) and sequential (sorted on a key, good for ranges).
Hashed: a hash function on the key picks the bucket. Clustered: related rows of two tables are kept together.
File operations: open, find, read, find next, insert, delete, modify, close and reset.
Primary index: built on the ordering key of a sorted file. It is sparse, one entry per block.
Clustering index: on a non-key ordering field. Secondary index: on a field the file is not sorted on. A secondary index must be dense, one entry per record.
Multilevel index: when the index itself is too big, build an index on the index. The top level is small enough to stay in memory.
B+ tree: a balanced multilevel index. All leaves are at one level, the data pointers live in the leaves and the leaves are linked for range queries. Search, insert and delete need O(log n) block reads.
Hashing: static hashing has a fixed number of buckets with overflow chains. Extendible (dynamic) hashing grows a directory as buckets fill. Collisions inside one table are handled by open addressing, chaining or multiple hashing.
How many disk reads?.
1,000,000 records with 100 records per block make 10,000 blocks.
No index: up to 10,000 block reads, about 5,000 on average.
B+ tree with fan-out 100: height = log₁₀₀ 1,000,000 = 3. So 3 index reads plus 1 data block = 4 reads.
A hash index needs about 1 or 2 reads for one key, but it cannot answer a range such as Marks BETWEEN 60 AND 80.
Real-life example
The index at the back of a textbook lets you jump to 'normalization' on page 210. A database index does the same for rows, so it does not read the whole table.
A valid B+ tree with the search path for key 25 in red.
Same or opposite: B+ tree index and hash index
Point
B+ tree
Hash index
Same or opposite
Range queries
Fast
Slow
Opposite
Exact match
O(log n)
About O(1)
Opposite
Keeps keys in order
Yes
No
Opposite
Speeds up search
Yes
Yes
Same
Exam tip. Draw a small B+ tree and show one search path. A primary index is sparse. A secondary index is dense. A B+ tree keeps all data pointers in the leaves. A B tree also keeps them in internal nodes.
Q14. Multivalued dependency, join dependency and 4NF
Asked 7 times in 2020, 2022, 2025 · Unit 3
From the papers
“Explain why 4NF is more desirable than BCNF with the help of an example.” (2020, 2022)
“Explain multivalued dependencies and Fourth Normal Form with an example.” (2025)
“Define join dependency. How is it different from multivalued dependency and functional dependency?” (2022)
The short answer
A multivalued dependency X ->> Y holds when each X value goes with a set of Y values that does not depend on the other attributes. Fourth normal form removes such dependencies.
Write these points
Formal test in R(X, Y, Z): take two tuples that agree on X.
X ->> Y holds if swapping their Y values gives two tuples that are also in R.
Every FD is also an MVD (X -> Y means X ->> Y). The reverse is not true.
MVDs come in pairs: if X ->> Y holds in R(X, Y, Z), then X ->> Z holds too.
4NF: R is in BCNF. Also, for every non-trivial MVD X ->> Y, X must be a super key.
Why 4NF is better than BCNF: a BCNF table can still store every course with every hobby of a student. 4NF splits them apart, which removes that repetition and its update anomalies.
Join dependency JD(R1, R2, ..., Rn): R equals the natural join of its projections R1 to Rn. An MVD is a JD with two parts. 5NF removes JDs that keys do not imply.
Difference: an FD says X fixes one value of Y. An MVD says X fixes a set of Y values. A JD says R can be rebuilt from its projections.
Example.
STUDENT(Sid, Course, Hobby) with Sid ->> Course and Sid ->> Hobby. The only key is all three attributes and there is no non-trivial FD, so the table is in BCNF. Sid is not a super key, so it is not in 4NF. Split it into (Sid, Course) and (Sid, Hobby).
Real-life example
A teacher teaches many subjects and knows many languages, which have nothing to do with each other. Keeping both in one table makes every subject repeat with every language. 4NF splits them.
Independent courses and hobbies force every pair to be stored until the table is split.
Same or opposite: BCNF and 4NF
Point
BCNF
4NF
Same or opposite
Removes problems from
Functional dependencies
Multivalued dependencies
Opposite
Order
Comes first
Needs BCNF first
Opposite
Lossless split
Yes
Yes
Same
Rule is about
X → Y
X →→ Y
Opposite
Exam tip. Use the student, course and hobby example. It shows the problem in four rows. 4NF means BCNF with no non-trivial MVD unless its left side is a super key.
Q15. Cursors in PL/SQL: explicit, nested, parameterized
Asked 6 times in 2020, 2022, 2024, 2025 · Unit 5
From the papers
“What is a cursor? Explain nested and parameterized cursors.” (2022, 2024, 2025)
“Explain cursor management in PL/SQL: explicit, nested and parameterized cursors.” (2025)
“Short note: Cursor in SQL.” (2020)
The short answer
A cursor is a pointer to the context area, the memory Oracle uses to run a SQL statement and hold its result rows. It lets PL/SQL work through a result one row at a time.
Write these points
Implicit cursor: Oracle opens it for every DML statement and every SELECT INTO. Its attributes are SQL%FOUND, SQL%NOTFOUND, SQL%ROWCOUNT and SQL%ISOPEN.
Explicit cursor: the programmer declares it for a query that returns many rows. Steps: DECLARE, OPEN, FETCH in a loop, CLOSE.
A cursor FOR loop (FOR rec IN c LOOP ... END LOOP;) opens, fetches and closes the cursor by itself.
Parameterized cursor: it takes values when opened, so one cursor serves many inputs. CURSOR c_emp (p_dept NUMBER) IS SELECT ... WHERE Dept_ID = p_dept;
Nested cursors: an inner cursor runs once for each row of the outer cursor, usually with the outer row's value as its parameter.
Steps
DECLARE
CURSOR c_dept IS SELECT Dept_ID, Dname FROM Dept;
CURSOR c_emp (p_dept NUMBER) IS SELECT E_Name, Salary FROM Employee WHERE Dept_ID = p_dept;
BEGIN
FOR d IN c_dept LOOP DBMS_OUTPUT.PUT_LINE('Dept ' || d.Dname);
FOR e IN c_emp(d.Dept_ID) LOOP DBMS_OUTPUT.PUT_LINE(e.E_Name || ' ' || e.Salary); END LOOP;
END LOOP;
END;
A parameterized cursor at work.
CURSOR c(p_dept NUMBER) IS SELECT name, salary FROM emp WHERE dept = p_dept;
BEGIN FOR r IN c(10) LOOP DBMS_OUTPUT.PUT_LINE(r.name || ' ' || r.salary); END LOOP; END;
Rows of emp: (Asha, 10, 50000), (Ravi, 10, 42000), (Meena, 20, 61000). The block prints Asha 50000 and Ravi 42000.
c%ROWCOUNT is 2 at the end. Opening c(20) instead prints only Meena 61000.
Real-life example
To print a report card for each student, the program must go through result rows one at a time. A cursor gives the program that row-by-row walk over a query result.
Life of an explicit cursor. The code above nests a parameterized cursor inside a cursor FOR loop.
Same or opposite: implicit and explicit cursor
Point
Implicit
Explicit
Same or opposite
Declared by
Oracle
The programmer
Opposite
Used for
Single row and DML
Many rows
Opposite
OPEN, FETCH, CLOSE
Automatic
Written by hand
Opposite
Has attributes like %ROWCOUNT
Yes
Yes
Same
Exam tip. Write the four steps (DECLARE, OPEN, FETCH, CLOSE) and the four attributes. A cursor parameter has a type but no size: NUMBER, not NUMBER(5).
RGPV teaches Database Management Systems to 4 branches under one syllabus. Each branch prints its own code on the paper, but the units are the same. So one page and one PDF serve all of them.
We counted every question in the Database Management Systems papers on this site by topic, from 2020 to 2025. A topic that keeps coming back is a topic RGPV likes, so it sits higher in the table. One branch alone has only a few papers. Counting them together gives a surer list.
Database Management Systems important questions by branch
CS-502Database Management Systems important questions for CSE, Semester 5
CS-502 follows the same RGPV syllabus as the other codes on this page. The 15 topics and answers above are the CS-502 important questions too.
Database Management Systems (CS-502) is about storing and querying data reliably. It is a Semester 5 subject of RGPV B.Tech CSE with five units: concepts and ER modelling, the relational model and SQL, design and normalisation, transactions, and a hands-on study of a relational system. Practise SQL on a real database as you read.
Database Management Systems unit-wise brief
Unit 1: DBMS concepts and architecture
This unit compares the database approach with plain files, and covers data models, schemas and instances, data independence, database languages, the role of the database administrator, and entity-relationship (ER) modelling with generalisation, specialisation and aggregation. It also covers turning an ER diagram into tables. Draw ER diagrams for small problems.
Unit 2: Relational data model
Here you learn the relational model: tuples, attributes, relations, keys, schemas and integrity constraints, including referential integrity. Then come SQL (DDL and DML, joins, indexing, triggers and assertions), relational algebra operations such as select, project, join and division, and tuple and domain relational calculus. Write each SQL query by hand before you run it.
Unit 3: Database design and query optimisation
This unit teaches normalisation: normal forms, functional dependencies, decomposition, dependency preservation, lossless join and multivalued dependencies. It then covers query optimisation, including heuristic and cost based methods. Practise finding candidate keys and the highest normal form of a table.
Unit 4: Transaction processing and concurrency control
A transaction is a unit of work that must finish completely or not at all. The unit covers serializability, recoverability, log based recovery, checkpoints, deadlock handling, locking, time stamping and validation based protocols, and multiple granularity. It ends with an overview of distributed, temporal, deductive, multimedia, web and mobile databases, data mining and warehousing. Check serializability on small schedules.
Unit 5: Study of a relational database system
The last unit studies a real system such as Oracle or MySQL: its architecture, files, memory and processes, table spaces, security and roles. It also covers advanced SQL queries, PL/SQL blocks, cursors, exceptions, stored procedures, functions and triggers. Write one procedure and one trigger yourself.
Units follow the RGPV scheme and syllabus, B.Tech Computer Science and Engineering, Semester 5 (AICTE flexible curriculum, w.e.f. July 2019). For the full topic list of each unit, open the Database Management Systems notes.
What are the most important topics in Database Management Systems?
By how often they were asked in the papers on this site: Keys and integrity constraints (15 times); Normalization: 1NF, 2NF, 3NF and BCNF (14 times); DBMS architecture, three levels and data independence (14 times); Relational algebra and join operations (14 times); ER model, ER diagram and conversion to tables (12 times).
How were these Database Management Systems important questions chosen?
Each topic was counted from the questions in the past papers listed on this site (2020-2025). Repeated is the number of times the topic came. The counts come from keyword matching and the answers are not teacher-reviewed, so use them together with your syllabus.
Is there a PDF of Database Management Systems important questions with answers?
Yes. The Paperwala Imp Question & Answer PDF for Database Management Systems is free to download from this page.
The 15 most repeated topics of Database Management Systems (CS-502) for RGPV B.Tech CSE semester 5, counted from the previous year papers on this site. The same syllabus is taught under 4 codes: CS-502, AD-402, AL-502, IO-502.