Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

What is normalization? Explain 1NF, 2NF, and 3NF with suitable examples, and discuss why normalization is necessary.

Normalization

Normalization is the process of organizing the attributes and relations of a relational database to reduce data redundancy and eliminate undesirable anomalies (insertion, update, and deletion anomalies). It decomposes larger "bad" relations into smaller well-structured relations based on functional dependencies and keys.

Why normalization is necessary

  • Eliminates redundancy — the same data is not stored repeatedly, saving storage.
  • Avoids update anomaly — a fact stored once need only be changed once.
  • Avoids insertion anomaly — new data can be inserted without requiring unrelated data.
  • Avoids deletion anomaly — deleting a row does not accidentally lose other facts.
  • Ensures data consistency and integrity.

First Normal Form (1NF)

A relation is in 1NF if every attribute holds only atomic (indivisible) values — no repeating groups or multi-valued attributes.

Unnormalized:

StudIDNameCourses
1RamDBMS, OS

In 1NF:

StudIDNameCourse
1RamDBMS
1RamOS

Second Normal Form (2NF)

A relation is in 2NF if it is in 1NF and no non-prime attribute is partially dependent on any candidate key (i.e., every non-key attribute depends on the whole key, not part of it). Partial dependency arises only with composite keys.

Consider STUDENT_COURSE(StudID, Course, StudName) with key {StudID, Course}. Here StudName depends only on StudID — a partial dependency. Decompose:

  • STUDENT(StudID, StudName)
  • ENROLL(StudID, Course)

Third Normal Form (3NF)

A relation is in 3NF if it is in 2NF and there is no transitive dependency of a non-prime attribute on the key (every non-key attribute depends directly on the key, not via another non-key attribute).

Consider STUDENT(StudID, DeptID, DeptName) where StudID → DeptID and DeptID → DeptName, so StudID → DeptName is transitive. Decompose:

  • STUDENT(StudID, DeptID)
  • DEPT(DeptID, DeptName)

Formally, XAX \rightarrow A holds for 3NF if XX is a superkey or AA is a prime attribute.

Conclusion

Progressively applying 1NF → 2NF → 3NF removes atomicity violations, partial dependencies, and transitive dependencies respectively, yielding a clean, anomaly-free, and consistent schema.

normalizationfunctional-dependency
2long10 marks

Explain Boyce-Codd Normal Form (BCNF). Differentiate it from 3NF and decompose a given relation into BCNF with an example.

Boyce-Codd Normal Form (BCNF)

A relation RR is in BCNF if for every non-trivial functional dependency XYX \rightarrow Y that holds on RR, XX is a superkey of RR. BCNF is a stricter version of 3NF (sometimes called 3.5NF). A relation in BCNF is automatically in 3NF.

Difference between 3NF and BCNF

Aspect3NFBCNF
Condition for XAX \rightarrow AXX is a superkey OR AA is a prime attributeXX must be a superkey
StrictnessLess strictMore strict
Determinant on the leftMay be a non-key prime attributeMust always be a candidate key
Dependency preservationAlways achievableNot always achievable
RedundancyMay still allow someRemoves more redundancy

Thus every BCNF relation is in 3NF, but not every 3NF relation is in BCNF. The two differ only when a relation has multiple overlapping candidate keys.

Example decomposition into BCNF

Consider R(Student, Subject, Teacher) with the rules:

  • A teacher teaches exactly one subject: Teacher → Subject.
  • For each student–subject pair there is one teacher: {Student, Subject} → Teacher.

Candidate keys: {Student, Subject} and {Student, Teacher}. The attribute Subject is prime, so the FD Teacher → Subject satisfies 3NF (RHS is prime). But the determinant Teacher is not a superkey, so RR violates BCNF.

Decompose on Teacher → Subject:

  • R1(Teacher,Subject)R_1(\underline{Teacher}, Subject)
  • R2(Student,Teacher)R_2(\underline{Student, Teacher})

Both relations are now in BCNF (in each, the only determinant is a candidate key). This removes the redundant repetition of the teacher–subject fact, though dependency preservation of {Student, Subject} → Teacher may be lost — illustrating BCNF's trade-off.

normalizationbcnf
3long10 marks

Define a transaction and explain its ACID properties. Discuss the various states of a transaction with a state diagram.

Transaction

A transaction is a logical unit of work that accesses and possibly updates the database through a sequence of read and write operations. It must be executed as a whole — either all of its operations complete successfully or none do. Example: a fund transfer that debits account A and credits account B.

ACID Properties

  1. Atomicity — A transaction is all-or-nothing; if any operation fails, the whole transaction is rolled back so no partial effects remain. (Managed by the recovery/transaction manager.)
  2. Consistency — A transaction takes the database from one valid (consistent) state to another, preserving all integrity constraints.
  3. Isolation — Concurrently executing transactions do not interfere; the intermediate state of one is invisible to others. The result is as if transactions ran serially. (Managed by the concurrency-control manager.)
  4. Durability — Once a transaction commits, its changes are permanent and survive system crashes (ensured via logs / stable storage).

States of a Transaction

  • Active — the initial state; the transaction is executing its operations.
  • Partially Committed — after the final operation has executed (changes may still be in buffers, not yet on disk).
  • Committed — after successful completion; changes are permanently saved.
  • Failed — when normal execution can no longer proceed (e.g., error, constraint violation).
  • Aborted — after rollback; the database is restored to its state before the transaction began. It may then be restarted or killed.

State Diagram (described)

              +-----------+        +----------------------+        +-----------+
  begin --->  |  ACTIVE   | -----> | PARTIALLY COMMITTED  | -----> | COMMITTED |
              +-----------+        +----------------------+        +-----------+
                   |                        |
                   v                        v
              +-----------+            (write fails)
              |  FAILED   | <----------------+
              +-----------+
                   |
                   v
              +-----------+
              |  ABORTED  |  --> (restart -> Active) or (kill -> terminate)
              +-----------+

The transaction starts Active; after its last statement it becomes Partially Committed, then Committed on success. Any failure moves it to Failed, then Aborted after rollback, from where it may be restarted or terminated.

transactionacid
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Explain the concept of a weak entity set with an example.

Weak Entity Set

A weak entity set is an entity set that does not have a primary key (sufficient attributes) of its own to uniquely identify its entities. Its existence depends on another entity set called the identifying (owner/strong) entity set, to which it is connected through an identifying relationship.

Key points:

  • It is identified by combining its own partial key (discriminator) with the primary key of the owner entity.
  • It has total participation in the identifying relationship (existence dependency).
  • In an ER diagram, a weak entity is drawn with a double rectangle, the identifying relationship with a double diamond, and the partial key is underlined with a dashed line.

Example

Consider a LOAN entity and its PAYMENT instalments in a bank.

  • PAYMENT(Payment_No, Date, Amount) cannot be uniquely identified by Payment_No alone, since different loans may both have payment number 1, 2, 3...
  • PAYMENT therefore is a weak entity, dependent on the strong entity LOAN(Loan_No, Amount) via the identifying relationship loan-payment.
  • Its partial key is Payment_No; its full identifier becomes the composite {Loan_No, Payment_No}.

Another classic example: DEPENDENT(Name) of an EMPLOYEE — identified by {EmpID, Name}.

er-model
5short5 marks

What is a view in SQL? Explain its advantages.

View in SQL

A view is a virtual table derived from one or more base tables (or other views) by a stored SELECT query. It does not store data of its own (except a materialized view); instead, its rows are computed from the underlying tables whenever the view is referenced.

CREATE VIEW HighPaidEmp AS
SELECT EmpID, Name, Salary
FROM Employee
WHERE Salary > 50000;

It is then queried like a table: SELECT * FROM HighPaidEmp;

Advantages of Views

  • Security — restricts access by exposing only selected rows/columns and hiding sensitive data of the base tables.
  • Simplicity — complex joins and queries are encapsulated, so users query a simple view instead of writing complicated SQL.
  • Data independence / abstraction — applications using a view are insulated from changes in the underlying table structure.
  • Customized presentation — different users can see the data tailored to their needs.
  • Consistency & reusability — a commonly used query is defined once and reused everywhere.
sqlview
6short5 marks

Differentiate between the DELETE, DROP, and TRUNCATE commands.

DELETE vs DROP vs TRUNCATE

FeatureDELETETRUNCATEDROP
Type (SQL category)DMLDDLDDL
What it removesSelected rows (or all)All rowsEntire table (rows + structure)
WHERE clauseSupportedNot supportedNot applicable
Table structure/schemaRetainedRetainedRemoved
RollbackCan be rolled back (logged per row)Cannot be rolled back (auto-commit)Cannot be rolled back
Triggers firedYesNoNo
SpeedSlower (row by row)Faster (deallocates pages)Fast (drops object)
Identity/AUTO_INCREMENTNot resetReset to seedN/A

Examples:

DELETE FROM Student WHERE Marks < 40;  -- removes matching rows only
TRUNCATE TABLE Student;                -- removes all rows, keeps the empty table
DROP TABLE Student;                    -- removes the table entirely

Summary: DELETE removes selected rows and is reversible; TRUNCATE quickly empties the whole table but keeps its structure and is not reversible; DROP deletes the whole table along with its definition.

sql
7short5 marks

Explain aggregate functions in SQL with examples.

Aggregate Functions in SQL

Aggregate functions take a collection (column) of values as input and return a single summary value. They are commonly used with the GROUP BY clause and filtered with HAVING. Except for COUNT(*), they ignore NULL values.

FunctionPurpose
COUNT()Number of rows/values
SUM()Total of numeric values
AVG()Average of numeric values
MAX()Largest value
MIN()Smallest value

Examples

Using an Employee(EmpID, Dept, Salary) table:

-- Total number of employees
SELECT COUNT(*) FROM Employee;

-- Total and average salary
SELECT SUM(Salary) AS Total, AVG(Salary) AS Average FROM Employee;

-- Highest and lowest salary
SELECT MAX(Salary), MIN(Salary) FROM Employee;

-- Average salary per department (grouped)
SELECT Dept, AVG(Salary) AS AvgSal
FROM Employee
GROUP BY Dept
HAVING AVG(Salary) > 40000;

The last query groups rows by department, computes the average salary of each group, and keeps only groups whose average exceeds 40000.

sql
8short5 marks

What is a trigger? Explain with an example.

Trigger

A trigger is a special kind of stored procedure that is automatically executed (fired) by the DBMS in response to a specified event on a table or view — namely an INSERT, UPDATE, or DELETE. The user does not call it explicitly; it runs whenever the triggering event occurs.

Classification:

  • Timing: BEFORE or AFTER the event.
  • Granularity: FOR EACH ROW (row-level) or statement-level.
  • Uses transition variables such as NEW (new row value) and OLD (old row value).

Uses: enforcing complex integrity constraints, maintaining audit trails/logs, automatically updating derived data, and validating data.

Example

Maintain an audit log whenever a salary is updated:

CREATE TRIGGER trg_salary_audit
AFTER UPDATE OF Salary ON Employee
FOR EACH ROW
BEGIN
  INSERT INTO Salary_Audit(EmpID, Old_Salary, New_Salary, Changed_On)
  VALUES (:OLD.EmpID, :OLD.Salary, :NEW.Salary, SYSDATE);
END;

Whenever an employee's salary is updated, this trigger fires automatically and records the old and new salary along with the timestamp into the Salary_Audit table — without any explicit call from the application.

sqltrigger
9short5 marks

Differentiate between relational algebra and relational calculus.

Relational Algebra vs Relational Calculus

Both are formal query languages for the relational model; relational algebra forms the basis of query execution, while relational calculus is the basis for declarative languages like SQL. They are equivalent in expressive power.

BasisRelational AlgebraRelational Calculus
NatureProcedural — specifies how (the sequence of operations) to obtain the resultNon-procedural / declarative — specifies what result is wanted, not how
FormA set of operations: σ\sigma (select), π\pi (project), \bowtie (join), \cup, -, ×\times, ρ\rhoA formula using predicates, quantifiers (,\forall, \exists) and logic
User statesOrder of operations explicitlyConditions the result must satisfy
Types(single language of operators)Tuple relational calculus (TRC) and Domain relational calculus (DRC)
Closer toInternal query execution planHigh-level languages such as SQL/QBE
ExampleπName(σSalary>5000(Emp))\pi_{Name}(\sigma_{Salary>5000}(Emp)){t.NameEmp(t)t.Salary>5000}\{ t.Name \mid Emp(t) \wedge t.Salary > 5000 \}

Summary: Relational algebra tells the system the exact procedure to follow, whereas relational calculus only describes the properties of the desired result and lets the system decide how to compute it.

relational-algebrarelational-calculus
10short5 marks

Explain lossless join and dependency-preserving decomposition.

Lossless-Join Decomposition

When a relation RR is decomposed into relations R1R_1 and R2R_2, the decomposition is lossless (non-additive) if joining R1R_1 and R2R_2 back gives exactly the original relation, with no spurious (extra) tuples:

R1R2=RR_1 \bowtie R_2 = R

Condition (for binary decomposition): the decomposition of RR into R1R_1 and R2R_2 is lossless if their common attributes form a key of at least one of the relations, i.e. one of the following holds:

(R1R2)R1or(R1R2)R2(R_1 \cap R_2) \rightarrow R_1 \quad \text{or} \quad (R_1 \cap R_2) \rightarrow R_2

If this condition fails, the join produces extra tuples (a lossy decomposition) and information is effectively distorted. Lossless join is a mandatory requirement of any good decomposition.

Example: R(A,B,C)R(A,B,C) with ABA \rightarrow B, decomposed into R1(A,B)R_1(A,B) and R2(A,C)R_2(A,C). Common attribute AA is the key of R1R_1, so the join is lossless.

Dependency-Preserving Decomposition

A decomposition of RR into R1,R2,,RnR_1, R_2, \dots, R_n is dependency preserving if the union of the functional dependencies enforceable on the individual relations is equivalent to the original set FF (has the same closure):

(FR1FR2FRn)+=F+(F_{R_1} \cup F_{R_2} \cup \dots \cup F_{R_n})^+ = F^+

This ensures each FD can be checked on a single relation without performing a join, so constraints are enforced efficiently after decomposition.

Note: A 3NF decomposition can always be both lossless and dependency-preserving, whereas a BCNF decomposition is always lossless but may not be dependency-preserving.

normalizationdecomposition
11short5 marks

What is a deadlock in a database? How is it handled?

Deadlock

A deadlock is a situation in which two or more transactions are waiting indefinitely for one another to release locks, so none of them can proceed. For example, transaction T1T_1 holds a lock on data item AA and waits for BB, while T2T_2 holds a lock on BB and waits for AA — a circular wait.

A deadlock requires all four conditions: mutual exclusion, hold-and-wait, no preemption, and circular wait.

Handling of Deadlocks

1. Deadlock Prevention

Design the locking protocol so that a deadlock can never form, e.g.:

  • Wait-Die (non-preemptive): an older transaction waits for a younger one; a younger one requesting an item held by an older one is rolled back (dies).
  • Wound-Wait (preemptive): an older transaction forces (wounds/rolls back) a younger holder; a younger one waits.
  • Acquiring all locks at once, or ordering data items and locking in that order.

2. Deadlock Detection and Recovery

Allow deadlocks to occur, then detect them by maintaining a wait-for graph (nodes = transactions, edge TiTjT_i \rightarrow T_j if TiT_i waits for TjT_j). A cycle in the graph indicates a deadlock. Recover by selecting a victim transaction (usually the one with least cost / least work done) and rolling it back to break the cycle.

3. Deadlock Avoidance / Timeout

Use a timeout: if a transaction waits longer than a threshold, it is assumed to be deadlocked and is aborted and restarted.

concurrency-controldeadlock
12short5 marks

Define schedule. Differentiate between serial and serializable schedules.

Schedule

A schedule is a chronological (time-ordered) sequence of the operations (read, write, commit, abort) of one or more transactions, preserving the relative order of operations within each transaction. It shows how the operations of concurrent transactions are interleaved.

Serial Schedule

A serial schedule executes transactions one after another, without interleaving — all operations of one transaction finish before the next begins. A serial schedule is always consistent and correct, but it gives no concurrency, so resource utilization and throughput are poor.

Serializable Schedule

A serializable schedule is a concurrent (interleaved) schedule whose final effect on the database is equivalent to some serial schedule of the same transactions. It therefore preserves consistency while still allowing concurrency. Common notions are conflict serializability (testable via a precedence/serialization graph that must be acyclic) and view serializability.

Difference

BasisSerial ScheduleSerializable Schedule
InterleavingNo interleaving; one transaction at a timeOperations are interleaved
ConcurrencyNoneAllows concurrency
CorrectnessAlways consistentConsistent if equivalent to some serial schedule
PerformanceLow throughputHigher throughput
Test neededInherently correctTested via precedence graph (acyclic)

In short: every serial schedule is serializable, but a serializable schedule allows interleaving as long as its result matches some serial execution.

transactionserializability

Frequently asked questions

Where can I find the BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) question paper 2075?
The full BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) 2075 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Database Management System (BSc CSIT, CSC260) 2075 paper come with solutions?
Yes. Every question on this Database Management System (BSc CSIT, CSC260) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) 2075 paper?
The BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) 2075 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Database Management System (BSc CSIT, CSC260) past paper free?
Yes — reading and attempting this Database Management System (BSc CSIT, CSC260) past paper on Kekkei is completely free.