Appearance
Persistent Data Management — Important Questions
Use the answer points to check your response after attempting each question.
Module 1
Short answers
- Define DBMS and list four advantages over a file system.
- Differentiate conceptual, logical, and physical data models.
- Explain super, candidate, primary, composite, and foreign keys.
- What are participation and cardinality constraints?
Long answer
Design an ER model for a library and map it to relations.
Answer points: entities BOOK, COPY, MEMBER, LOAN, AUTHOR; BOOK–COPY is 1:M; MEMBER–COPY borrowing is represented by LOAN with issue/due/return dates; BOOK–AUTHOR is M:N; identify keys and participation; map M:N through BOOK_AUTHOR; make COPY(BookID,CopyNo) a weak entity if copy number is only locally unique.
Module 2
Short answers
- Define functional dependency and attribute closure.
- Explain insertion, update, and deletion anomalies.
- Distinguish 3NF from BCNF.
- What are lossless join and dependency preservation?
Problem
Normalize ORDER_LINE(OrderNo, OrderDate, CustomerID, CustomerName, ProductID, ProductName, Qty) to 3NF, assuming key (OrderNo, ProductID).
Answer points:
text
OrderNo → OrderDate, CustomerID
CustomerID → CustomerName
ProductID → ProductName
(OrderNo,ProductID) → Qty
ORDER(OrderNo, OrderDate, CustomerID)
CUSTOMER(CustomerID, CustomerName)
PRODUCT(ProductID, ProductName)
ORDER_LINE(OrderNo, ProductID, Qty)State primary/foreign keys and show removal of partial and transitive dependencies.
Module 3
- Explain all fundamental relational algebra operations with examples.
- Compare theta join, equijoin, natural join, and outer join.
- Why does division represent “for all”?
- Write algebra for students who are not enrolled in any course.
- Write algebra for students enrolled in every required course.
Answer hints:
text
Not enrolled:
πSID(STUDENT) − πSID(ENROLL)
All required:
πSID(ENROLL) −
πSID((πSID(ENROLL) × REQUIRED) − ENROLL)Module 4
- Compare TRC, DRC, and relational algebra.
- Explain free and bound variables.
- What makes a calculus expression safe?
- Write TRC for students with no enrolment.
- Express “students enrolled in every course” using
∀, then using¬∃.
Answer point: connect all tuple/domain variables to actual relations so the result is range-restricted.
Module 5
- Distinguish DDL, DML, DQL, DCL, and TCL.
- Explain
WHEREversusHAVING. - Compare view and materialized view.
- Compare stored procedure, trigger, and cursor.
- Explain SQL null and three-valued logic.
SQL practice
Write queries to:
- Find the three courses with the highest average marks.
- List departments with at least ten students.
- List students with no enrolments.
- List students who take every course.
- Increase marks by five, capped at 100, for one course inside a transaction.
Module 6
- Compare clustered/non-clustered and dense/sparse indexes.
- Explain B+ tree search, insertion, and deletion with diagrams.
- Why do linked leaf nodes make range queries efficient?
- Explain collision handling and dynamic hashing.
- Compare B+ tree and hash indexes by query type.
- Explain the leftmost-prefix rule for a composite index.
Module 7
- Draw and explain the query-processing pipeline.
- Define cost, cardinality, and selectivity.
- Compare nested-loop, hash, and sort-merge joins.
- Explain selection and projection pushdown.
- How do stale statistics lead to poor plans?
- Explain materialized-view refresh choices.
Long-answer structure: show logical query, alternative physical choices, statistics used, estimated cost, selected plan, and actual-plan verification.
Module 8
- Explain ACID using a bank transfer.
- Define conflict and conflict equivalence.
- Test a given schedule using a precedence graph.
- Compare conflict and view serializability.
- Compare recoverable, cascadeless, and strict schedules.
- Explain WAL, checkpoints, undo, and redo.
- Compare SQL isolation levels and anomalies.
Schedule problem
For:
text
R1(X), W1(X), R2(X), W2(X), R2(Y), W2(Y), R1(Y), W1(Y)X creates edge T1→T2; Y creates T2→T1; the cycle means the schedule is not conflict-serializable.
Module 9
- Draw the S/X lock-compatibility matrix.
- Explain basic, conservative, strict, and rigorous 2PL.
- Show deadlock using a wait-for graph and describe recovery.
- Compare wait-die and wound-wait.
- State timestamp-ordering read and write rules.
- Compare pessimistic, optimistic, and MVCC approaches.
- Why do phantoms require predicate/key-range protection?
Module 10
- Distinguish well-formed and valid XML; compare DTD and XSD.
- Explain horizontal, vertical, and hybrid fragmentation.
- Explain 2PC and why it may block.
- State CAP accurately for a network partition.
- Compare shared-memory, shared-disk, and shared-nothing architectures.
- Explain HDFS and MapReduce.
- Compare Hadoop MapReduce and Spark.
- Explain four NoSQL models and suitable workloads.
- Describe the 5Vs of big data.
Module 11 practical sessions
- Write a PostgreSQL workflow to create tables, insert data, clean values, join tables, aggregate results, and validate row counts.
- Create and call a PL/pgSQL procedure with input parameters and error handling using
RAISE EXCEPTION. - Create a trigger function that validates or audits
INSERTandUPDATEoperations. - Explain when a PostgreSQL view is updatable and when an
INSTEAD OFtrigger is required. - Demonstrate
BEGIN,COMMIT,ROLLBACK, andSAVEPOINTusing two query windows. - Explain cursor declaration, opening, fetching, looping, and closing, and compare cursors with set-based SQL.
- Explain HDFS and the Mapper -> Shuffle/Sort -> Reducer workflow, including Combiner and Partitioner.
- Describe a query-tuning workflow using
EXPLAIN ANALYZEand index selection. - Explain database roles, privileges, and the principle of least privilege.
Full-syllabus 10-mark questions
- Starting with an ER design, show its mapping, normalization, SQL implementation, and useful indexes.
- Explain how the optimizer converts a declarative SQL query into an executable physical plan.
- Show how transaction management, concurrency control, and recovery work together to preserve correctness.
- Compare centralized relational databases with distributed SQL, NoSQL, and big-data processing systems.
Answer-writing checklist
- Begin with a precise definition.
- Draw the requested diagram or table.
- Explain the mechanism step by step.
- Include a small example.
- State advantages, limitations, and suitable use.
- End comparisons with a clear decision criterion.