BSc CSIT (TU) Science Database Management System (BSc CSIT, CSC260) Question Paper 2079 Nepal
This is the official BSc CSIT (TU) (Science stream) Database Management System (BSc CSIT, CSC260) question paper for 2079, as set in the regular annual examination. It carries 60 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Database Management System (BSc CSIT, CSC260) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) exam or solving previous years' question papers, this 2079 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt any TWO questions.
Explain database recovery. Discuss log-based recovery techniques, deferred and immediate database modification, and the concept of checkpoints.
Database Recovery
Recovery is the process of restoring a database to a correct (consistent) state after a failure (system crash, transaction failure, or media failure), ensuring the atomicity and durability of transactions. The recovery manager uses a log (an append-only file written to stable storage) that records every update before it is applied.
Log-Based Recovery
For every write the log stores a record of the form:
meaning transaction changed data item from old value to new value . Other records are , and . The Write-Ahead Logging (WAL) rule requires the log record to reach stable storage before the corresponding data block.
Deferred Database Modification
- Updates are not written to the database until the transaction reaches its commit point; they are only recorded in the log.
- On failure, only redo is needed (no undo), because no uncommitted change ever reached the database.
- Recovery:
redo(T)for every that has bothstartandcommitin the log; ignore the rest.
Immediate Database Modification
- Updates are written to the database while the transaction is still active (before commit).
- The log must store both old and new values, so recovery needs both undo and redo.
- Recovery:
undo(T)for transactions withstartbut nocommit;redo(T)for transactions withstartandcommit.
Checkpoints
Without checkpoints, recovery would have to scan the entire log. A checkpoint is a point at which:
- All log records in main memory are flushed to stable storage.
- All modified buffer blocks are written to disk.
- A record (listing active transactions) is written.
During recovery the log is scanned backwards to the most recent checkpoint: transactions that committed before the checkpoint are already safe and can be skipped, drastically reducing recovery time.
Summary: WAL + log records enable redo/undo; deferred modification needs only redo, immediate modification needs undo + redo, and checkpoints limit how much of the log must be processed.
Explain indexing in databases. Differentiate between primary, secondary, and clustering indexes, and explain the structure of a B+ tree index.
Indexing in Databases
An index is an auxiliary data structure (a file of entries) built on one or more attributes to speed up record retrieval, avoiding a full linear scan. The attribute on which the index is built is the search key. An index trades extra storage and update cost for faster queries.
Ordered (Single-Level) Index Types
| Index | Built on | Data file order | Dense/Sparse | Per relation |
|---|---|---|---|---|
| Primary (clustering on key) | ordering field that is a key | sorted on this field | usually sparse | one |
| Clustering | ordering non-key field (duplicates allowed) | sorted on this field | one entry per distinct value | one |
| Secondary | non-ordering field (key or non-key) | not sorted on this field | must be dense | many possible |
- A primary index orders the data file on a key attribute; only one is possible because a file can be physically sorted on only one field.
- A clustering index is like a primary index but the ordering field is not a candidate key, so several records share an index entry.
- A secondary index is defined on a field that does not determine the physical order, so it must contain an entry for every record (dense). Multiple secondary indexes can exist on one table.
Structure of a B+ Tree Index
A B+ tree is a balanced, multi-level, dynamic index that keeps performance stable under insertions/deletions. For order :
- Internal (index) nodes hold up to search-key values and child pointers; they only guide the search.
- Leaf nodes hold the actual search keys together with record/block pointers, and are linked in a doubly linked list for efficient range and sequential scans.
- All leaves are at the same level (perfectly balanced); every node except the root is at least half full.
- Search, insert and delete all take I/O.
Key advantages: all data pointers reside in the leaves (uniform access cost), the linked leaf list makes range queries efficient, and the tree self-balances so query cost stays predictable as the database grows.
Discuss functional dependency and its inference rules (Armstrong's axioms). Explain how to compute the closure of a set of attributes with an example.
Functional Dependency (FD)
A functional dependency on a relation means that whenever two tuples agree on the attributes in , they must also agree on the attributes in . is the determinant; is functionally determined by . Example: in Student(RollNo, Name, Address), . FDs express integrity constraints and are the basis of normalization.
Armstrong's Axioms (Inference Rules)
The three primary (sound and complete) rules:
- Reflexivity: if then .
- Augmentation: if then .
- Transitivity: if and then .
Derived (secondary) rules: Union (), Decomposition (), and Pseudotransitivity ().
Computing the Closure of an Attribute Set
The closure is the set of all attributes functionally determined by under a set of FDs .
Algorithm Closure(X, F):
result := X
repeat
for each FD A -> B in F:
if A ⊆ result then
result := result ∪ B
until result does not change
return result
Example
Let with
Compute :
- Start: .
- applies ⇒ add → .
- applies ⇒ add → .
- applies (both present) ⇒ add → .
- No new attribute ⇒ stop.
Result: . Since this equals all attributes of , is a candidate key. Closures are used to test key candidates and to check whether an FD holds (true iff ).
Section B: Short Answer Questions
Attempt any EIGHT questions.
What are the different types of database users?
Different categories of database users interact with a DBMS in different ways:
- Database Administrator (DBA): central control of the database; grants/revokes access, defines schema and storage structure, handles backup, recovery, and performance tuning.
- Database Designers: identify the data and relationships to be stored and design the schema (conceptual/logical/physical).
- Naive / End Users: interact through ready-made application programs or menus (e.g., a bank teller, ticket clerk) without knowing SQL.
- Sophisticated Users: analysts, scientists, and engineers who write their own ad-hoc queries (SQL, query tools) to meet complex needs.
- Application Programmers: write the application programs (in host languages with embedded SQL) used by naive users.
- Specialized / Standalone Users: maintain complex applications such as CAD, knowledge-base, or expert systems that do not fit the traditional data-processing model.
Differentiate between primary key, candidate key, and foreign key.
Keys in the relational model:
-
Candidate Key: a minimal set of attributes that uniquely identifies each tuple in a relation. A relation can have several candidate keys, and no proper subset of a candidate key is itself unique. Example in
Student(RollNo, RegNo, Name): bothRollNoandRegNoare candidate keys. -
Primary Key: the one candidate key chosen by the designer to be the principal identifier of the relation. It cannot be NULL and must be unique (entity integrity). Example:
RollNochosen as the primary key. -
Foreign Key: an attribute (or set) in one relation that references the primary key of another (or the same) relation, enforcing referential integrity. It may be NULL and may repeat. Example:
DeptIDinStudentreferencingDeptIDinDepartment.
| Feature | Primary Key | Candidate Key | Foreign Key |
|---|---|---|---|
| Uniqueness | Yes | Yes | No (may repeat) |
| NULL allowed | No | No | Yes |
| Number per table | One | One or more | Zero or more |
| Purpose | Identify tuple | Possible identifier | Link two tables |
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 sufficient attribute of its own to form a primary key; its existence depends on another (strong/owner) entity set through an identifying (or supporting) relationship.
Key points:
- It has a partial key (discriminator) — attributes that distinguish weak entities belonging to the same owner entity.
- Its full primary key = primary key of the owner entity + its own partial key.
- It participates in the identifying relationship with total participation.
- In an ER diagram, the 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 Payment entity for a Loan. A payment is identified only by a payment_number which restarts from 1 for each loan, so payment_number alone is not unique across all payments.
- Strong entity:
Loan(loan_number, amount) - Weak entity:
Payment(payment_number, date, amount)—payment_numberis the partial key. - Identifying relationship:
Loan–Payment. - Primary key of Payment =
{loan_number, payment_number}.
Thus a Payment cannot exist without the Loan that owns it.
What is a view in SQL? Explain its advantages.
View in SQL
A view is a virtual (logical) table derived from one or more base tables (or other views) by a stored SELECT query. It does not store data itself (unless materialized); its rows are computed when the view is referenced.
CREATE VIEW HighPaid AS
SELECT emp_id, name, salary
FROM Employee
WHERE salary > 50000;
It can then be queried like a table: SELECT * FROM HighPaid;
Advantages
- Security / Access control: expose only selected columns/rows, hiding sensitive data from users.
- Simplicity / Abstraction: complex joins and aggregations are pre-defined, so users write simple queries against the view.
- Logical data independence: the view shields applications from changes to the underlying base-table structure.
- Customized presentation: different users see different tailored views of the same data.
- Reusability & consistency: a frequently used query is written once and reused, ensuring consistent results.
Differentiate between the DELETE, DROP, and TRUNCATE commands.
DELETE vs DROP vs TRUNCATE
| Feature | DELETE | TRUNCATE | DROP |
|---|---|---|---|
| Category | DML | DDL | DDL |
| Removes | Selected rows (or all) | All rows | Entire table (rows + structure) |
WHERE clause | Yes | No | No |
| Table structure remains | Yes | Yes | No |
| Logs each row / rollback | Yes (can ROLLBACK) | Minimal logging; auto-commit | Cannot rollback |
| Speed | Slow (row-by-row) | Fast | Fast |
| Fires triggers | Yes | No | No |
| Resets identity/auto-increment | No | Yes | (table gone) |
DELETE – removes specific rows matching a condition; the table and schema stay:
DELETE FROM Student WHERE marks < 40;
TRUNCATE – removes all rows quickly, keeps the empty table structure:
TRUNCATE TABLE Student;
DROP – removes the whole table including its data, structure, indexes and constraints:
DROP TABLE Student;
Explain aggregate functions in SQL with examples.
Aggregate Functions in SQL
Aggregate functions operate on a set (group) of rows and return a single summary value. They are commonly used with the GROUP BY clause and filtered with HAVING.
| Function | Purpose |
|---|---|
COUNT() | Number of rows / non-null values |
SUM() | Total of a numeric column |
AVG() | Arithmetic mean |
MAX() | Largest value |
MIN() | Smallest value |
Examples
-- Total number of employees
SELECT COUNT(*) FROM Employee;
-- Highest and lowest salary
SELECT MAX(salary), MIN(salary) FROM Employee;
-- Average salary per department
SELECT dept_id, AVG(salary) AS avg_sal
FROM Employee
GROUP BY dept_id
HAVING AVG(salary) > 40000;
Note: all aggregate functions ignore NULL values (except COUNT(*), which counts every row).
What is a trigger? Explain with an example.
Trigger
A trigger is a stored procedure that is automatically executed (fired) by the DBMS in response to a specified event — an INSERT, UPDATE, or DELETE — on a particular table. It enforces business rules, complex integrity constraints, auditing, and automatic derivations without explicit user calls.
A trigger is defined by:
- Event – the DML operation that activates it.
- Timing –
BEFOREorAFTER(orINSTEAD OFfor views). - Granularity –
FOR EACH ROW(row-level) or statement-level. - Action – the SQL/PLSQL body to execute, optionally guarded by a condition (
WHEN).
Example (audit log on salary update)
CREATE TRIGGER trg_salary_audit
AFTER UPDATE OF salary ON Employee
FOR EACH ROW
BEGIN
INSERT INTO Salary_Audit(emp_id, old_sal, new_sal, changed_on)
VALUES (:OLD.emp_id, :OLD.salary, :NEW.salary, SYSDATE);
END;
Whenever an employee's salary is updated, the trigger automatically records the old and new values in the audit table.
Differentiate between relational algebra and relational calculus.
Relational Algebra vs Relational Calculus
Both are formal query languages for the relational model and are equivalent in expressive power, but they differ in approach.
| Aspect | Relational Algebra | Relational Calculus |
|---|---|---|
| Nature | Procedural — specifies how to obtain the result | Non-procedural (declarative) — specifies what result is wanted |
| Basis | A sequence of operations () | Predicate logic (formulas with quantifiers ) |
| Query expressed as | An expression / order of operators | A predicate describing the desired tuples |
| Types | Single language (operator set) | Tuple relational calculus (TRC) and Domain relational calculus (DRC) |
| User control | User must give the evaluation order | DBMS decides how to evaluate |
| Relation to SQL | Closer to the execution engine / query plan | Closer to declarative query writing |
Example – select students with marks > 80:
- Algebra:
- Tuple calculus:
Thus algebra tells the system how to compute, while calculus only states what is required.
Explain lossless join and dependency-preserving decomposition.
When a relation is decomposed into , the decomposition should preserve information and constraints. Two desirable properties are:
Lossless (Non-Loss) Join Decomposition
A decomposition of into and is lossless if joining them back reproduces exactly the original relation — no spurious (extra) tuples are generated:
Test (binary case): the decomposition of into is lossless iff their common attributes form a superkey of at least one of them:
This property is mandatory for any correct decomposition.
Dependency-Preserving Decomposition
A decomposition is dependency-preserving if the set of functional dependencies that can be enforced on the individual decomposed relations is equivalent to the original set:
This ensures every original FD can be checked on a single relation without performing a join, so constraints stay efficiently enforceable.
Example: with decomposed into and . Common attribute is a key of ⇒ lossless; holds in and in ⇒ dependency-preserving. A good (e.g. BCNF/3NF) design always aims for losslessness, and 3NF additionally guarantees dependency preservation.
Frequently asked questions
- Where can I find the BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) question paper 2079?
- The full BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) 2079 (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) 2079 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) 2079 paper?
- The BSc CSIT (TU) Database Management System (BSc CSIT, CSC260) 2079 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.