Chapter 5
Database Management System
TU BBA past exam questions
Past questions and answers
83 questions set from this chapter, 3 of them more than once; 1 is most repeated (set, or a close variant set, in 3 or more exams). Most repeated first.
- Most repeated · 4 of 7 exams
- Asked 4 times
- 2023 Mar · 5 marks
- 2024 Nov · 5 marks
- 2024 Model · 1 mark
- 2025 Nov · 3 marks
Explain the desirable properties of Transactions.
Answer
The desirable properties of a transaction are the ACID properties:
- Atomicity: a transaction is all-or-nothing; if any part fails, the whole transaction is rolled back. It is the responsibility of the recovery subsystem.
- Consistency: a transaction takes the database from one consistent state to another, preserving all integrity constraints. For example, in a transfer the total of both accounts is unchanged.
- Isolation: concurrent transactions do not interfere; each behaves as if it ran alone. It is enforced by concurrency control.
- Durability: once committed, changes are permanent and survive system failures, which is ensured by logging and recovery.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- Asked 2 times
- 2023 Mar · 1 mark
- 2024 Model · 1 mark
Define big data.
Answer
Big data refers to extremely large and complex data sets, arriving at high speed and in many forms, that cannot be stored or processed efficiently by traditional database tools. It is characterised by volume, velocity and variety (the 3 Vs).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- Asked 2 times
- 2024 Nov · 1 mark
- 2024 Model · 1 mark
Define serializable schedule.
Answer
A serializable schedule is a concurrent schedule of transactions whose effect is equivalent to some serial schedule (one transaction at a time) of the same transactions, so it leaves the database consistent.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 5 marks
What is concurrency control? Explain two-phase locking protocol. (1.5 + 3.5)
Similar questions: Define concurrency control. Describe about two phase (2025 Nov)
Answer
Concurrency control
Concurrency control is the set of mechanisms that manage the simultaneous execution of transactions so that they do not interfere with each other. It preserves isolation and the consistency of the database, and prevents problems such as lost update, dirty read and unrepeatable read.
Two-phase locking (2PL) protocol
A transaction must acquire locks on a data item before using it. Two kinds of lock are used: a shared lock (read) and an exclusive lock (write). In 2PL every transaction issues its lock and unlock requests in two phases.
- Growing phase: the transaction may obtain locks but cannot release any.
- Shrinking phase: the transaction may release locks but cannot obtain new ones.
The point at which the transaction obtains its last lock is the lock point. Example for transaction :
lock-X(A); read(A); A = A - 50; write(A);
lock-X(B); -- still growing
read(B); B = B + 50; write(B);
unlock(A); unlock(B); -- shrinking
Properties
- 2PL guarantees conflict-serializable schedules.
- It does not prevent deadlock, and it can lead to cascading rollback.
- Strict 2PL holds all exclusive locks until commit or abort, which avoids cascading rollback. Rigorous 2PL holds all locks until commit.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 5 marks
Define concurrency control. Describe about two phase locking protocol for concurrent
transaction.
Similar questions: What is concurrency control? Explain two-phase locking (2024 Model)
Answer
Concurrency control is the set of mechanisms a DBMS uses to manage simultaneous execution of transactions so that they do not interfere with each other. It preserves isolation and consistency and prevents problems such as lost update, dirty read and unrepeatable read.
Two-phase locking (2PL) protocol
A transaction must obtain a lock on a data item before accessing it. Locks are of two kinds: a shared (read) lock and an exclusive (write) lock. 2PL requires every transaction to acquire and release locks in two distinct phases:
- Growing phase: the transaction may obtain locks but may not release any.
- Shrinking phase: once the transaction releases its first lock, it may release locks but may not obtain any new ones.
The point where the transaction holds all its locks (the lock point) fixes its serialization order. Because of this rule, any schedule produced by 2PL is conflict serializable.
Example: T1 does Lock-X(A), Lock-X(B), read/write A and B, then Unlock(A), Unlock(B). All locks come before all unlocks, so it follows 2PL.
Limitations and variants
- It does not prevent deadlock, since two transactions may wait for each other's locks.
- It can cause cascading rollback. Strict 2PL (hold exclusive locks until commit or abort) avoids this, and rigorous 2PL holds all locks until commit.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
Define Data Model.
Answer
A data model is a collection of concepts and tools for describing the structure of a database: its data, relationships, semantics and constraints. Examples are the relational, entity-relationship and object-oriented models.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
Write SQL statement to delete student table.
Answer
DROP TABLE student;
DROP TABLE removes the table's structure and data permanently. (DELETE FROM student; only removes the rows.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
Differentiate between simple composite attribute.
Answer
A simple attribute cannot be divided into smaller parts (e.g. age, roll_no). A composite attribute can be divided into sub-parts with independent meaning (e.g. name into first_name, middle_name, last_name; address into street, city, district).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
List the types of mapping constraints in ER Model.
Answer
The mapping constraints (cardinality ratios) in the ER model are:
- One-to-one (1:1)
- One-to-many (1:N)
- Many-to-one (N:1)
- Many-to-many (M:N)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
Write a syntax for check constraint SQL.
Answer
CREATE TABLE table_name (
column_name data_type,
CONSTRAINT constraint_name CHECK (condition)
);
Example: age INT CHECK (age >= 18).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
Define Transaction.
Answer
A transaction is a logical unit of work consisting of one or more database operations (reads and writes) that must be executed as a whole, taking the database from one consistent state to another. It either completes fully (commit) or has no effect (rollback).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
What is NoSQL?
Answer
NoSQL ("not only SQL") refers to non-relational databases that store data in flexible formats such as key-value, document, column-family or graph, without a fixed schema. They scale horizontally and are suited to large, unstructured or rapidly changing data (e.g. MongoDB, Cassandra, Redis).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
State 1NF.
Answer
A relation is in First Normal Form (1NF) if every attribute contains only atomic (indivisible) values, with no multivalued attributes or repeating groups, and each row is uniquely identifiable.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 1 mark
Why level of abstraction is maintained in database?
Answer
Levels of abstraction (physical, logical, view) hide the complexity of how data is stored from users. They provide data independence, so the storage structure can change without affecting the application programs, simplify the user's interaction, and allow different users to see different views of the same data with better security.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 3 marks
Describe two phase locking mechanism in brief.
Answer
Two-phase locking (2PL) is a concurrency control protocol that guarantees serializability. Every transaction executes in two phases:
- Growing phase: the transaction may acquire locks (shared or exclusive) but cannot release any.
- Shrinking phase: once it releases its first lock, it may only release locks and cannot acquire new ones.
Because no transaction acquires a lock after releasing one, the schedules produced are conflict-serializable. Basic 2PL can suffer deadlock; strict 2PL holds all exclusive locks until commit, which also avoids cascading rollbacks.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 3 marks
What are the types of database user? Explain each of them in brief.
Answer
Types of database users:
- Naive (end) users: use the database through ready-made application interfaces, such as a bank clerk or ticket booking user.
- Application programmers: write application programs in a host language that access the database through SQL/APIs.
- Sophisticated users: analysts and engineers who write queries directly in a query language without programs.
- Specialized users: write specialized applications (CAD systems, expert systems, multimedia) that do not fit traditional processing.
- Database administrator (DBA): controls the whole database system, including schema, security, backup and recovery.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 3 marks
Explain briefly the importance and methods of Database recovery.
Answer
Importance: recovery restores the database to the last consistent state after a failure (system crash, disk failure, transaction failure, power loss). It preserves atomicity and durability and prevents data loss.
Methods:
- Log-based recovery: a log records every update. Deferred update applies changes to the database only after commit (redo only); immediate update writes changes before commit (needs undo and redo).
- Shadow paging: keeps a current and a shadow page table; on failure the shadow table is used, so no log is needed.
- Checkpoints: periodic saving points so recovery only examines the log after the last checkpoint.
- Backup and restore: restoring from a full backup, then replaying the log, for media failure.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 3 marks
Explain the importance of Creating view with syntax.
Answer
A view is a virtual table defined by a stored query on one or more base tables; it holds no data of its own.
Importance: it hides sensitive columns and rows (security), simplifies complex queries, gives each user a customised view of the data, and provides logical data independence.
Syntax:
CREATE VIEW view_name AS
SELECT column1, column2
FROM table_name
WHERE condition;
Example: CREATE VIEW cs_students AS SELECT id, name FROM student WHERE dept = 'CS';
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 3 marks
What is Database security? How Database is secured? Explain in brief.
Answer
Database security is the protection of the database against unauthorised access, misuse, modification or destruction, ensuring confidentiality, integrity and availability.
It is secured by:
- Authentication: user names, passwords and biometrics.
- Authorization and access control:
GRANT/REVOKEprivileges and roles. - Views: exposing only permitted data.
- Encryption: of stored and transmitted data.
- Backup and recovery, and audit trails or logging of activity.
- Firewalls and physical security, plus protection against SQL injection.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 3 marks
What is importance of normalization? Explain with example.
Answer
Normalization is the process of organising relations to remove redundancy and undesirable dependencies.
Importance: it reduces data redundancy, avoids insertion, update and deletion anomalies, saves storage and keeps data consistent.
Example: table Student(roll, name, course, course_fee) repeats the fee for every student taking a course. Changing a fee means updating many rows (update anomaly), and a new course cannot be stored without a student (insertion anomaly). Normalizing splits it into Student(roll, name, course) and Course(course, course_fee), so each fact is stored once.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 5 marks
Identify and explain different types of database languages with example.
Answer
Database languages are used to define, manipulate and control a database.
- DDL (Data Definition Language): defines the schema. Commands:
CREATE,ALTER,DROP,TRUNCATE,RENAME. Example:CREATE TABLE student(id INT PRIMARY KEY, name VARCHAR(30)); - DML (Data Manipulation Language): retrieves and modifies data. Commands:
SELECT,INSERT,UPDATE,DELETE. Example:INSERT INTO student VALUES(1,'Ram'); - DCL (Data Control Language): controls access and privileges. Commands:
GRANT,REVOKE. Example:GRANT SELECT ON student TO user1; - TCL (Transaction Control Language): manages transactions. Commands:
COMMIT,ROLLBACK,SAVEPOINT. Example:ROLLBACK; - DQL (Data Query Language): sometimes separated out to mean
SELECTqueries. Example:SELECT name FROM student WHERE id = 1;
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 5 marks
Explain any five aggregate function used in SQL with syntax.
Answer
Aggregate functions operate on a set of rows and return a single value:
COUNT(): number of rows.SELECT COUNT(*) FROM student;SUM(): total of a numeric column.SELECT SUM(salary) FROM employee;AVG(): average value.SELECT AVG(marks) FROM student;MAX(): largest value.SELECT MAX(salary) FROM employee;MIN(): smallest value.SELECT MIN(salary) FROM employee;
General syntax: SELECT function(column) FROM table [WHERE condition] [GROUP BY column];. Except COUNT(*), they ignore NULL values.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 5 marks
When generalization and specialization is used in ER model? Support your answer with example.
Answer
Specialization is a top-down process: an entity set is divided into sub-groups (lower-level entity sets) that have additional distinct attributes or relationships. Generalization is a bottom-up process: several entity sets that share common attributes are combined into a higher-level entity set. Both are shown with an ISA triangle, and lower-level entities inherit the attributes of the higher-level one.
When used: when entities of one type have subgroups with their own special attributes or relationships, or when several entity sets share common features that should be stored once.
Example: Person(id, name, address) is specialized into Student(roll, program) and Teacher(salary, department). Conversely, if Student and Teacher are defined separately with common attributes id, name, address, these are generalized into Person.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 10 marks
Employee works on the project under one or more project manager for the company. Client pays for the project that is being developed by the company and client provide the feedback for the project.
Draw ER diagram for the above scenario.
Answer
Entities and attributes
- Employee (<u>emp_id</u>, name, address, phone)
- Project (<u>proj_id</u>, title, start_date, budget)
- Project_Manager (<u>pm_id</u>, name, phone)
- Client (<u>client_id</u>, name, address, phone)
- Feedback (<u>fb_id</u>, date, comments, rating)
Relationships and cardinalities
- Works_on between Employee and Project: many-to-many (an employee can work on many projects and a project has many employees).
- Managed_by between Project and Project_Manager: many-to-many (a project may be under one or more managers, and a manager can handle many projects).
- Pays between Client and Project (attribute: amount, date): one client pays for many projects, each project is paid by one client (1:N).
- Gives between Client and Feedback, and Feedback_for between Feedback and Project (a client gives feedback for a project; feedback may be modelled as a ternary relationship Client-Project-Feedback).
ER diagram (text form)
[Employee] --M--<Works_on>--N-- [Project] --N--<Managed_by>--M-- [Project_Manager]
| \
N \--- N --<Feedback_for>-- 1 [Feedback] --N--<Gives>--1-- [Client]
| |
+------------ N --<Pays (amount)>-- 1 --------------------------+
Rectangles are entities, diamonds are relationships and ovals are attributes (underlined for primary keys). The same structure is drawn with each entity connected to its attribute ovals and to the relationship diamonds above with the cardinalities M, N and 1.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 Mar · 10 marks
Consider following relational database:
Account(ac_no, type, balance, branch)
Customer(cid, name, address, phone_no, dob)
Depositer(ac_no, cid, date)
Write SQL statement for the following:
i) Insert a tuple {1001, checking, 30000} in Account relation.
ii) Delete those accounts which haven't owns any customer.
iii) Change the phone_no of Ram to 11111111.
iv) Find name of customer who owns an account with balance greater than 2000.
v) Display those records of customers whose name starts with "R" and end with "A".
Answer
i) Insert a tuple (the branch is not supplied, so the columns are named):
INSERT INTO Account(ac_no, type, balance) VALUES (1001, 'checking', 30000);
ii) Delete accounts that have no customer:
DELETE FROM Account
WHERE ac_no NOT IN (SELECT ac_no FROM Depositer);
iii) Change Ram's phone number:
UPDATE Customer
SET phone_no = '11111111'
WHERE name = 'Ram';
iv) Names of customers who own an account with balance greater than 2000:
SELECT DISTINCT c.name
FROM Customer c, Depositer d, Account a
WHERE c.cid = d.cid AND d.ac_no = a.ac_no AND a.balance > 2000;
v) Customers whose name starts with R and ends with A:
SELECT * FROM Customer
WHERE name LIKE 'R%A';
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
Define Database Language.
Answer
A database language is a language used to define the structure of a database, manipulate its data and control access to it. Examples are DDL, DML, DCL and TCL, all part of SQL.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
Write a SQL statement for update operation.
Answer
UPDATE table_name
SET column1 = value1, column2 = value2
WHERE condition;
Example: UPDATE student SET name = 'Hari' WHERE id = 1;
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
What is unary Relationship?
Answer
A unary (recursive) relationship is a relationship in which an entity set is related to itself, so the same entity set participates twice in different roles. Example: an Employee supervises other Employees (manager and subordinate).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
List any four types of attributes in ER Model.
Answer
Four types of attributes in the ER model:
- Simple (atomic) attribute
- Composite attribute
- Single-valued attribute
- Multivalued attribute
(Others: derived, key and null attributes.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
What is big data?
Answer
Big data refers to extremely large, fast-growing and varied data sets (structured, semi-structured and unstructured) that are too complex for traditional data-processing tools. It is described by volume, velocity and variety.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
Define deferred data update.
Answer
In deferred data update (deferred modification), a transaction's updates are written only to the log until the transaction commits; the database itself is changed after the commit. Hence no undo is needed on failure, only redo.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
What is importance of creating view?
Answer
Views are important because they provide security by hiding sensitive columns or rows, simplify complex queries, give users customised presentations of data, and provide logical data independence.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
State 3NF.
Answer
A relation is in Third Normal Form (3NF) if it is in 2NF and no non-prime attribute is transitively dependent on the primary key. Equivalently, for every non-trivial dependency , either is a superkey or is a prime attribute.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 1 mark
Define Roles.
Answer
A role is a named collection of privileges that can be granted to users or to other roles. It simplifies authorization because the privileges are managed in one place. Example: CREATE ROLE manager; GRANT SELECT, UPDATE ON employee TO manager;
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 3 marks
Describe shadow paging concept in brief.
Answer
Shadow paging is a recovery technique that does not use a log. The database is divided into fixed-size pages, and a page table maps each page to a disk block.
- At the start of a transaction the current page table is copied to a shadow page table, which is saved on disk and never modified.
- Updates are written to new blocks and only the current page table is changed to point to them.
- On commit, the current page table becomes the new shadow table (the pointer is switched atomically).
- On failure, the current table is discarded and the shadow table restores the old state, so rollback is immediate.
It avoids undo/redo, but it causes data fragmentation and needs garbage collection of old pages.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 3 marks
Who is DBA? List the roles of DBA.
Answer
The Database Administrator (DBA) is the person (or team) with central control over the database system and its users.
Roles of the DBA:
- Defining the schema and the storage structure and access methods
- Granting authorization and ensuring security
- Backup and recovery planning
- Monitoring performance and tuning
- Maintaining integrity constraints and data consistency
- Schema and physical organisation modification
- Liaising with users and application programmers
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 3 marks
Explain the concept of Time stamp ordering concurrency control techniques.
Answer
Timestamp ordering is a concurrency control method that orders transactions by timestamps instead of locks. Each transaction gets a unique timestamp when it starts, and each data item keeps a read timestamp and a write timestamp .
- Read(Q) by : if , would read an overwritten value, so it is rolled back and restarted; otherwise the read is allowed and .
- Write(Q) by : if or , is rolled back; otherwise the write is performed and .
The schedules are conflict-serializable (equivalent to timestamp order) and deadlock-free, but starvation of restarted transactions is possible.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 3 marks
Illustrate how composite attribute is reduced into relational schema with example?
Answer
In relational mapping, a composite attribute is reduced by keeping only its simple component attributes as separate columns; the composite attribute itself does not become a column.
Example: Student(roll, name, address) where address is composite of street, city, district. The relation schema is:
The components street, city and district become ordinary attributes, and the parent address is not stored.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 3 marks
Explain constraints of generalization and specialization in ER model.
Answer
Constraints on generalization and specialization decide which entities may belong to which lower-level entity sets.
1. Membership (condition-defined vs user-defined)
- Condition-defined: an entity joins a lower-level set if it satisfies a condition on an attribute (e.g. every account with
type = "Saving"goes to Saving_Account). - User-defined: the database user assigns entities to the lower-level set manually.
2. Disjointness
- Disjoint: an entity can belong to at most one lower-level set (a person is either Student or Teacher).
- Overlapping: an entity can belong to more than one lower-level set (a person can be both Student and Employee).
3. Completeness
- Total: every higher-level entity must belong to at least one lower-level set.
- Partial: some higher-level entities may belong to none of the lower-level sets.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 3 marks
What is the importance of database security?
Answer
Database security protects data from unauthorised access, misuse, modification and loss. Its importance is:
- Confidentiality: sensitive data such as bank records, personal details and passwords is seen only by authorised users.
- Integrity: it prevents unauthorised or accidental changes, so data stays accurate and consistent.
- Availability: authorised users can access data when needed, even against attacks such as denial of service.
- Legal and business protection: it helps meet data-protection laws, maintains customer trust and avoids financial loss and reputational damage.
- Accountability: authentication, authorisation and audit trails identify who did what.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 5 marks
Explain any four types of Database user.
Answer
Database users are classified by the way they interact with the system.
- Naive (end) users: unsophisticated users who use ready-made application programs and forms, e.g. a bank teller or a ticket-booking clerk. They need no knowledge of the DBMS.
- Application programmers: computer professionals who write application programs in languages such as Java, PHP or C# with embedded SQL to give the end users their interfaces.
- Sophisticated users: analysts and engineers who write their own queries in a query language such as SQL to explore data, without writing application programs.
- Database administrator (DBA): the person with central control of the DBMS. The DBA defines the schema, grants access rights, manages storage, takes backups, and handles recovery and performance tuning.
(Specialised users, who build special applications such as CAD or expert systems, are a further type.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 5 marks
How normalization helps to design good database? Explain second normal form with example.
Answer
How normalization helps good design
Normalization organises tables by decomposing them using functional dependencies. It helps by:
- reducing data redundancy and saving storage;
- removing insertion, deletion and update anomalies;
- keeping data consistent, because each fact is stored once;
- making the schema clearer and easier to maintain.
Second Normal Form (2NF)
A relation is in 2NF if it is in 1NF and no non-prime attribute is partially dependent on any part of a candidate key. That is, every non-key attribute is fully dependent on the whole key.
Example: Enrollment(StudentID, CourseID, StudentName, Grade) with key (StudentID, CourseID).
- Here
StudentID → StudentNameis a partial dependency, because StudentName depends on only part of the key. So the relation is not in 2NF. - It causes redundancy: the name is repeated for every course, and updating it risks inconsistency.
Decomposition into 2NF:
Student(StudentID, StudentName)Enrollment(StudentID, CourseID, Grade)
Now every non-key attribute depends on the whole of its table's key.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 5 marks
Discuss any four constraints available in database with example.
Answer
Constraints are rules that keep the data in a database valid.
- NOT NULL: a column cannot hold NULL.
Name VARCHAR(50) NOT NULL - UNIQUE: all values in a column (or set of columns) are different, but NULL is allowed.
Email VARCHAR(50) UNIQUE - PRIMARY KEY: uniquely identifies each row. It combines NOT NULL and UNIQUE, and a table has only one.
StudentID INT PRIMARY KEY - FOREIGN KEY: a column that refers to the primary key of another table, which keeps referential integrity.
FOREIGN KEY (DeptID) REFERENCES Department(DeptID) - CHECK: restricts values by a condition.
Age INT CHECK (Age >= 18) - DEFAULT: gives a default value when none is supplied.
Country VARCHAR(20) DEFAULT 'Nepal'
Example putting them together:
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Email VARCHAR(50) UNIQUE,
Age INT CHECK (Age >= 18),
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Department(DeptID)
);
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 10 marks
Draw an ER diagram for Hospital management system with at least five entity set. Implement the concept of mapping cardinality and extended ER feature. Assume suitable attribute sets for each entity set.
Answer
Entity sets (with attributes)
- Person (person_id, name, address, phone, dob), a superclass.
- Doctor (doctor_id, specialization, salary), a subclass of Person.
- Patient (patient_id, disease, admit_date), a subclass of Person.
- Department (dept_id, dept_name, location)
- Room (room_no, type, charge)
- Appointment (appt_id, date, time) as an entity or relationship.
- Treatment/Bill (bill_id, amount, date), a weak-style entity dependent on Patient.
Relationships and mapping cardinality
- Doctor works_in Department: many-to-one (many doctors, one department).
- Department has Room: one-to-many.
- Patient admitted_in Room: many-to-one (many patients per room, with a capacity limit).
- Patient consults Doctor (attribute: date, fee): many-to-many.
- Patient receives Bill: one-to-many; Bill is a weak entity, identified by patient_id plus bill_no, with total participation.
- Doctor heads Department: one-to-one.
Extended ER features
- Specialization/generalization: Person is specialized into Doctor and Patient (disjoint, partial). Attributes of Person are inherited by both.
- Aggregation: the relationship
consultsis aggregated and linked to Bill, so that a bill belongs to a particular consultation. - Total participation (double line): each Bill must belong to a Patient; each Doctor must work in a Department.
Diagram (text form)
Person (ISA, disjoint)
/ \
Doctor Patient
| \ | \
works_in heads consults admitted_in
| | | |
Department------has---Room (Room)
[Consults] --aggregation-- generates --> Bill (weak)
Rectangles are entity sets, diamonds are relationships, ellipses are attributes (key attributes underlined), the ISA triangle shows specialization, and a double rectangle shows the weak entity.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Nov · 10 marks
Consider following relational database:
Car (reg_no, model, price, color)
Person (pid, name, address, phone)
owns_by(reg_no, pid, date)
Write SQL statement for the following:
i) Insert a tuple {1, Ram Bdr, kathmandu} in person relation.
ii) Display the model number with highest price.
iii) Increase the price of each car by 15%.
iv) Find name of person who owns red colored car.
v) Display those records of car which model contains at most 4 characters.
Answer
i)
INSERT INTO Person(pid, name, address) VALUES (1, 'Ram Bdr', 'kathmandu');
(The phone is left NULL.)
ii)
SELECT model FROM Car WHERE price = (SELECT MAX(price) FROM Car);
iii)
UPDATE Car SET price = price * 1.15;
iv)
SELECT p.name
FROM Person p
JOIN owns_by o ON p.pid = o.pid
JOIN Car c ON c.reg_no = o.reg_no
WHERE c.color = 'red';
v) Models with at most 4 characters:
SELECT * FROM Car WHERE LENGTH(model) <= 4;
(In SQL Server use LEN(model).)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
Define data independence.
Answer
Data independence is the ability to change the schema at one level of the database without having to change the schema at the next higher level. It is of two types: physical (changing storage does not affect the logical schema) and logical (changing the logical schema does not affect application programs).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
What is specialization?
Answer
Specialization is a top-down process of designing in which a higher-level entity set is divided into lower-level entity sets that have distinct characteristics. For example, Person is specialized into Student and Teacher.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
What are the uses of keys in databases?
Answer
Keys are used to identify each tuple (row) in a table uniquely, to establish links between tables (foreign keys), to enforce integrity constraints, and to speed up searching and retrieval of data.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
What is DDL?
Answer
DDL (Data Definition Language) is the set of SQL commands used to define and change the structure of database objects. Its commands are CREATE, ALTER, DROP, TRUNCATE and RENAME.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
What is functional dependency?
Answer
A functional dependency is a constraint between two sets of attributes of a relation. It says that if two tuples have the same value for , they must have the same value for , i.e. determines . For example, .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
What is deferred update?
Answer
Deferred update is a recovery technique in which a transaction's updates are not written to the database until the transaction reaches its commit point. The changes are first recorded only in the log. Therefore no UNDO is needed after a failure, only REDO for committed transactions.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 1 mark
What is shadow paging?
Answer
Shadow paging is a recovery technique that does not use a log. The database is divided into pages, and two page tables are kept: the current page table and the shadow page table. Updates are made on new copies of pages and recorded in the current table, while the shadow table keeps pointing to the old pages. On commit, the current table becomes the shadow table. On failure, the shadow table is used to restore the old consistent state.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 3 marks
Explain different constraints and characteristics of specialization and generalization in brief.
Answer
Specialization is a top-down process of defining sub-classes (lower-level entity sets) from a higher-level entity set; generalization is the bottom-up process of combining entity sets with common features into a higher-level entity set.
Constraints
- Disjoint vs overlapping: in a disjoint design an entity belongs to at most one lower-level set (e.g. a person is either Student or Teacher); in an overlapping design it may belong to more than one.
- Total vs partial completeness: total means every higher-level entity must belong to some lower-level set; partial means some need not.
Characteristics
- Lower-level entity sets inherit the attributes and relationships of the higher-level set (attribute inheritance).
- They may add their own attributes and take part in their own relationships.
- Shown in an E-R diagram by an ISA triangle.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 3 marks
Explain different types of relationship sets in brief.
Answer
A relationship set is a set of associations among entities. By the number of entities that participate (degree) it is:
- Unary (recursive): relates entities of the same set, e.g. an Employee supervises another Employee.
- Binary: relates two entity sets, e.g. Student enrolls in Course. This is the most common type.
- Ternary (n-ary): relates three or more entity sets, e.g. Supplier supplies Part to Project.
By mapping cardinality, a binary relationship is one-to-one, one-to-many, many-to-one or many-to-many.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 3 marks
Explain any three data types in SQL with example.
Answer
SQL data types define the kind of value a column can hold.
- INT: stores whole numbers. Example:
Age INT. - VARCHAR(n): stores variable-length character strings of up to n characters. Example:
SName VARCHAR(50)holds "Ram". - DATE: stores calendar dates in the form YYYY-MM-DD. Example:
DOB DATEholds '2004-05-12'.
Example: CREATE TABLE student(SID INT, SName VARCHAR(50), DOB DATE);
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 3 marks
What are the properties of relational decomposition? Explain.
Answer
Decomposition replaces a relation by smaller relations to remove redundancy. A good decomposition must have the following properties.
- Lossless-join (non-additive join) property: joining the decomposed relations must give back exactly the original relation, with no spurious tuples. For a decomposition into and it holds if or .
- Dependency preservation: every functional dependency of can be enforced by checking the dependencies within the individual decomposed relations, without joining them.
- Attribute preservation: every attribute of appears in at least one decomposed relation.
Lossless join is essential. Dependency preservation is desirable and is not always attainable for BCNF.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 3 marks
How do you recover the database from catastrophic failure? Explain.
Answer
Catastrophic failure is a loss of the disk or a physical disaster that destroys the database itself. Log-based recovery alone cannot repair it, so recovery depends on backups.
- Periodic backup: the whole database and the log are regularly copied to tape, a remote disk or another stable storage.
- Restore: after the failure the most recent backup copy is loaded onto a new disk.
- Redo from the log: the log kept since the backup (stored on separate, safe media) is used to redo all committed transactions up to the time of failure. Transactions that did not commit are ignored or undone.
This brings the database back to the last consistent state. Keeping the log on a different disk from the data is therefore important.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 3 marks
Explain recovery technique based on immediate update.
Answer
In immediate update, a transaction's changes are written to the database on disk before it commits, while the transaction is still active. Because uncommitted values may reach the database, the log must record both the old value (before image) and the new value (after image), and the log record is written first (write-ahead logging).
Recovery after a crash
- Undo: a transaction that has a
<T, start>record but no<T, commit>is undone. Its updated items are restored to their old values from the log. - Redo: a transaction with both
<T, start>and<T, commit>is redone, because some of its changes may not have reached the disk.
This is the UNDO/REDO algorithm. Its advantage is that it does not force the transaction to wait until commit to write.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 5 marks
Explain three-schema architecture of database in detail.
Answer
The three-schema architecture separates the user's view of the data from its physical storage. It has three levels.
- External level (view level): describes the part of the database a particular user group sees. There are many external schemas (views), and each hides the rest of the data. Example: a student sees only the marks of their own results.
- Conceptual level (logical level): describes the whole database for the whole organization: entities, attributes, relationships, constraints and security. There is one conceptual schema, and it hides physical storage details.
- Internal level (physical level): describes how the data is physically stored: file structures, indexes, access paths and record placement.
External view 1 External view 2 External view 3
\ | /
---- External/Conceptual mapping ----
Conceptual schema
---- Conceptual/Internal mapping ----
Internal schema
|
Stored database
Mappings convert requests and results between the levels.
Data independence
- Logical data independence: the conceptual schema can change without changing the external schemas.
- Physical data independence: the internal schema can change without changing the conceptual schema.
The architecture therefore gives multiple user views, simpler maintenance and data independence.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 5 marks
Draw an E-R diagram for online food ordering system.
Answer
Entities and attributes (primary keys marked *)
- Customer: *Cust_ID, Name, Phone, Address
- Restaurant: *Rest_ID, Name, Location, Rating
- Menu_Item: *Item_ID, Name, Price, Category
- Order: *Order_ID, Order_Date, Total_Amount, Status
- Delivery_Person: *Del_ID, Name, Phone, Vehicle_No
- Payment (weak or separate entity): *Pay_ID, Mode, Amount, Pay_Date
Relationships
- Customer places Order: one-to-many (1 : N)
- Restaurant receives Order: one-to-many (1 : N)
- Restaurant offers Menu_Item: one-to-many (1 : N)
- Order contains Menu_Item: many-to-many (M : N), with the attribute Quantity
- Delivery_Person delivers Order: one-to-many (1 : N)
- Order has Payment: one-to-one (1 : 1)
E-R diagram (text form)
[Customer]--1--<places>--N--[Order]--N--<receives>--1--[Restaurant]
| \ |
1 N--<contains(qty)>--M--[Menu_Item]--N--<offers>--1--+
|
<has> 1--[Payment]
N--<delivers>--1--[Delivery_Person]
Entities are drawn as rectangles, attributes as ovals joined to them, relationships as diamonds, and the primary key attributes are underlined.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 5 marks
Define data warehouse. Explain datamining with example. (1.5 + 3.5)
Answer
Data warehouse
A data warehouse is a large, centralized repository of integrated data collected from many operational sources. It is subject-oriented, integrated, time-variant (it keeps history) and non-volatile (data is not changed once loaded). It supports analysis and decision making rather than day-to-day transactions.
Data mining
Data mining is the process of discovering useful, previously unknown patterns, trends and relationships in large volumes of data, using techniques such as classification, clustering, association rule mining and prediction. It is a step in knowledge discovery in databases (KDD).
Main steps: data cleaning and integration, selection, transformation, pattern discovery, and evaluation and presentation of the result.
Examples
- Association rules (market basket analysis): a supermarket finds that customers who buy bread and butter often also buy milk, and then places these items close together.
- Classification: a bank uses past customer data to classify loan applicants as low or high risk.
- Clustering: a telecom company groups customers with similar calling behaviour to design offers.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 10 marks
Why do we need normalization in databases? Explain 1NF, 2NF, and 3NF with suitable example. (2.5 + 7.5)
Answer
Need for normalization
Normalization is the process of organizing relations to reduce redundancy and avoid anomalies. It is needed because a poorly designed relation suffers from:
- Redundancy: the same data is stored repeatedly, wasting space.
- Insertion anomaly: some data cannot be inserted without other unrelated data.
- Deletion anomaly: deleting one fact unintentionally removes other facts.
- Update anomaly: a change must be made in many rows, or the data becomes inconsistent.
Normalization also makes the design more flexible and keeps data consistent.
First Normal Form (1NF)
A relation is in 1NF if all attributes are atomic (single-valued) and there are no repeating groups or multivalued attributes.
Not in 1NF: Student(SID, Name, Phone) with SID 1, Ram, {9841, 9851}.
In 1NF: each phone number is placed in a separate row.
| SID | Name | Phone |
|---|---|---|
| 1 | Ram | 9841 |
| 1 | Ram | 9851 |
Second Normal Form (2NF)
A relation is in 2NF if it is in 1NF and no non-prime attribute is partially dependent on a part of a composite candidate key.
Example: Enroll(SID, CID, SName, Grade) with key (SID, CID). Here is a partial dependency, so the relation is not in 2NF.
Decompose:
- Student(SID, SName)
- Enroll(SID, CID, Grade)
Now every non-key attribute depends on the full key.
Third Normal Form (3NF)
A relation is in 3NF if it is in 2NF and no non-prime attribute is transitively dependent on the primary key. That is, for each dependency , either is a superkey or is a prime attribute.
Example: Employee(EID, EName, DeptID, DeptName) with and . Then is transitive, so the relation is not in 3NF.
Decompose:
- Employee(EID, EName, DeptID)
- Department(DeptID, DeptName)
Redundancy of DeptName is now removed, and each fact is stored once.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Model · 10 marks
Consider a University database with three tables, where the primary keys are underlined as given below:
student(SID, SName, SAddress, SEmail)
studies(SID, CID)
course(CID, CName, Credit_hours)
Give an expression in SQL for each of the following queries:
a. Insert data with values “S101”, “Ram”, “Lalitpur”, and “[email protected]” in the student table. (2)
b. Find names of all students whose address is “Kathmandu”. (2)
c. Find names of all students who study “Database Management System”. (2)
d. Count number of students who study “Database Management System”. (2)
e. Find names of all courses with credit hours greater than or equal to 3. (2)
Answer
(a)
INSERT INTO student (SID, SName, SAddress, SEmail)
VALUES ('S101', 'Ram', 'Lalitpur', '[email protected]');
(b)
SELECT SName
FROM student
WHERE SAddress = 'Kathmandu';
(c)
SELECT s.SName
FROM student s
JOIN studies st ON s.SID = st.SID
JOIN course c ON st.CID = c.CID
WHERE c.CName = 'Database Management System';
(d)
SELECT COUNT(*)
FROM studies st
JOIN course c ON st.CID = c.CID
WHERE c.CName = 'Database Management System';
(e)
SELECT CName
FROM course
WHERE Credit_hours >= 3;
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Mention any one difference between schemas and instances.
Answer
A schema is the overall design (structure) of the database and changes rarely, whereas an instance is the actual data stored in the database at a particular moment and changes frequently.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Define attribute inheritance.
Answer
Attribute inheritance is the property by which a lower-level entity set (sub-class) automatically acquires all the attributes, and relationships, of the higher-level entity set (super-class) it is derived from through specialization or generalization.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
List out any two data types used in SQL.
Answer
Two SQL data types are INT (whole numbers) and VARCHAR(n) (variable-length character strings).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
What is the importance of creating role?
Answer
A role is a named group of privileges. Creating roles lets the DBA grant or revoke a set of privileges to many users at once by assigning the role. This simplifies authorization management and improves security.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Define Transitive dependency.
Answer
A transitive dependency exists when a non-key attribute depends on another non-key attribute, that is, if and hold (with ), then depends on transitively through .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Write SQL query to remove an attribute named 'email' from Employee table.
Answer
ALTER TABLE Employee DROP COLUMN email;
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Define concurrent transaction.
Answer
Concurrent transactions are two or more transactions that execute at the same time on the same database, with their operations interleaved. They need concurrency control so that they do not interfere with each other.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Define distributed databases.
Answer
A distributed database is a collection of logically related data that is stored at several computers (sites) connected by a network, and appears to the user as a single database.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
Define privileges in database management.
Answer
Privileges are the rights granted to a user or role to perform particular operations on database objects, such as SELECT, INSERT, UPDATE, DELETE, or creating tables. They are given with GRANT and withdrawn with REVOKE.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 1 mark
What is catastrophic failure?
Answer
A catastrophic failure is a serious failure, such as a disk crash, fire or theft, that destroys the stored database itself. It can be recovered from only by using a backup copy together with the log.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 3 marks
Write about any three types of constraints used in database.
Answer
Constraints are rules that restrict the data that may be stored, and so keep it valid and consistent.
- Primary key constraint: uniquely identifies each row; its value must be unique and not NULL. Example:
SID INT PRIMARY KEY. - Foreign key (referential integrity) constraint: a value in one table must match an existing primary key value in the referenced table. Example:
FOREIGN KEY (CID) REFERENCES course(CID). - NOT NULL / UNIQUE / CHECK constraints: NOT NULL forbids empty values, UNIQUE forbids duplicates, and CHECK limits values to a condition. Example:
Credit_hours INT CHECK (Credit_hours > 0).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 3 marks
Differentiate between deferred update and immediate update.
Answer
| Basis | Deferred update | Immediate update |
|---|---|---|
| Writing to the database | Changes are written to the database only after the transaction commits | Changes may be written to the database before the transaction commits |
| Meanwhile | Updates are kept in the log and local workspace | Updates are applied to the database as they occur |
| Log content | Only new values (after image) are needed | Both old and new values are needed |
| Recovery | REDO only: committed transactions are redone, uncommitted ones are ignored | UNDO and REDO: uncommitted transactions are undone, committed ones redone |
| Rollback | No undo needed | Undo needed |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 3 marks
Illustrate and explain three-schema architecture.
Answer
The three-schema architecture divides a database into three levels so that users are kept separate from the physical storage.
External level: View 1 | View 2 | View 3
|
Conceptual level: Conceptual schema
|
Internal level: Internal schema -> Stored database
- External level: the views of individual users or applications, each showing only the relevant data.
- Conceptual level: the logical structure of the entire database (entities, relationships, constraints).
- Internal level: the physical storage structure, files and indexes.
Mappings between the levels give logical and physical data independence.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 3 marks
Mention any three methods to make database secure.
Answer
Three methods of making a database secure:
- Authentication and access control: users must prove their identity with a username and password (or other credentials), and they are given only the privileges they need (using
GRANTandREVOKE, and roles). - Encryption: sensitive data is stored and transmitted in encrypted form, so it is unreadable if intercepted or stolen.
- Backup and auditing: regular backups allow recovery from loss or damage, and audit trails record who accessed or changed data, so misuse can be detected. Views can also be used to hide sensitive columns.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 3 marks
Explain the types of relationship set.
Answer
A relationship set is a set of relationships of the same type among entity sets. Relationships are classified by degree and by cardinality.
By degree (number of participating entity sets)
- Unary (recursive): one entity set relates to itself, e.g. Employee supervises Employee.
- Binary: two entity sets, e.g. Student enrolls in Course. This is the most common type.
- Ternary: three entity sets, e.g. Instructor, Subject and Semester in Taught.
By mapping cardinality (binary)
- One-to-one (1:1): an entity in A relates to at most one in B and vice versa, e.g. Person and Passport.
- One-to-many (1:N): an entity in A relates to many in B, but each B relates to at most one A, e.g. Department and Employee.
- Many-to-one (N:1): the reverse of one-to-many.
- Many-to-many (M:N): entities on both sides may relate to many on the other, e.g. Student and Course.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 5 marks
Explain the concept of specialization with your own example.
Answer
Specialization is a top-down design process in the Extended ER model. A higher-level entity set is divided into lower-level sub-groups (subclasses) that are distinguished by some characteristic. Each subclass inherits all attributes and relationships of the superclass and may add attributes or relationships of its own. The link between them is an ISA ("is a") relationship.
Constraints
- Disjoint vs overlapping: an entity may belong to only one subclass, or to more than one.
- Total vs partial: every superclass entity must belong to some subclass, or not.
Example (a college): the entity set Person (PersonID, Name, Address, Phone) is specialized into:
- Student (adds Program, Semester, GPA)
- Teacher (adds Department, Salary, Qualification)
- Staff (adds Post, JoiningDate)
Every Student, Teacher and Staff member is a Person and inherits PersonID, Name, Address and Phone. The specialization is disjoint and partial here. Its benefit is that attributes specific to a subclass are stored only for that subclass, which avoids null values and redundancy and models real-world differences more accurately. The reverse bottom-up process is called generalization.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 5 marks
Explain the types of Anamolies.
Answer
Anomalies are problems that arise from data redundancy in poorly designed (unnormalized) relations. There are three types.
Consider Employee_Project(E-ID, E-name, P-ID, P-name) in which employee and project details are repeated in each row.
- Insertion anomaly: a new fact cannot be recorded without other, unrelated data. A new project cannot be added until an employee is assigned to it, unless null values are stored for the key.
- Deletion anomaly: deleting one fact unintentionally removes another. If the only employee working on project P03 is deleted, the details of project P03 are lost as well.
- Update (modification) anomaly: the same data is stored in many rows, so changing it requires updating every copy. If a project's name changes, every row containing it must be updated. Missing one leaves inconsistent data.
Remedy: normalization, i.e. decomposing the relation into smaller well-structured relations (1NF, 2NF, 3NF, BCNF) so that each fact is stored once.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 5 marks
Illustrate and explain two tier and three tier database application architecture.
Answer
Two-tier architecture (client-server)
[ Client tier: UI + application logic ] <-----> [ Server tier: DBMS / database ]
The client application (user interface and business logic) runs on the user's machine and communicates directly with the database server, typically through ODBC/JDBC, sending SQL queries and receiving results.
- Advantages: simple, fast to develop, low latency.
- Disadvantages: business logic sits on every client, so maintenance is hard. It scales poorly, and exposing the database directly to clients is a security risk.
Three-tier architecture
[ Presentation tier ] <--> [ Application / Business tier ] <--> [ Database tier ]
(browser, mobile) (web/app server) (DBMS)
- Presentation tier: the user interface (web browser or mobile app); it contains no direct database access.
- Application (middle) tier: holds the business logic and processing. It validates requests, enforces rules and queries the database.
- Database tier: stores and manages the data.
- Advantages: better security because clients never touch the database, better scalability (tiers can be scaled separately), easier maintenance and reuse of business logic.
- Disadvantages: more complex and costly to build and deploy.
Three-tier is the standard for web applications such as online banking and e-commerce.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 10 marks
Consider the following tables of a database:
Instructor (InstructorID, InstructorName, JobStatus)
Subject (SubCode, SubjectName, CreditHours)
Taught (Subcode, InstructorID, Semester)
Write SQL Queries for the following:
i) Insert a record with values “IT232”, “DBMS”, 3 in the Subject table
ii) Change the JobStatus of an Instructor with ID 521 to ‘Permanent’
iii) To add a column “salary” in instructor table.
iv) To display the name of instructor with highest salary.
v) To delete a column credit hours from subject table.
Answer
(i) Insert a record into Subject:
INSERT INTO Subject (SubCode, SubjectName, CreditHours)
VALUES ('IT232', 'DBMS', 3);
(ii) Change the job status of instructor 521:
UPDATE Instructor
SET JobStatus = 'Permanent'
WHERE InstructorID = 521;
(iii) Add a column salary to Instructor:
ALTER TABLE Instructor ADD salary DECIMAL(10,2);
(iv) Name of the instructor with the highest salary:
SELECT InstructorName
FROM Instructor
WHERE salary = (SELECT MAX(salary) FROM Instructor);
(v) Delete the column CreditHours from Subject:
ALTER TABLE Subject DROP COLUMN CreditHours;
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 Nov · 10 marks
Normalize the following relation up to 3-NF.
E-ID E-name Contact No P-Id P-name E01 Ram 9841,2273 P01 ABC E01 Ram 9841,2273 P02 XYZ E02 Shyam 98510 P02 XYZ E03 Hari 9860,5535 P01 ABC E03 Hari 9860,,5535 P03 PQR E04 Shyam 9899,9847 P03 PQR
Answer
Given relation: R(E-ID, E-name, Contact No, P-Id, P-name). Contact No holds multiple values in some rows, and an employee works on many projects, so the key is (E-ID, P-Id).
First Normal Form (1NF)
Every attribute must be atomic, so multi-valued contact numbers are split into separate rows (the typo ",," is read as a single number 5535):
| E-ID | E-name | Contact No | P-Id | P-name |
|---|---|---|---|---|
| E01 | Ram | 9841 | P01 | ABC |
| E01 | Ram | 2273 | P01 | ABC |
| E01 | Ram | 9841 | P02 | XYZ |
| ... | ... | ... | ... | ... |
A cleaner 1NF split puts the contact numbers into their own relation. The key then becomes (E-ID, Contact No, P-Id), and this creates partial dependencies, which is the problem 2NF resolves.
Second Normal Form (2NF)
Remove partial dependencies on the composite key (E-ID, P-Id):
- E-ID → E-name
- P-Id → P-name
- Contact numbers depend on E-ID alone.
Decompose into:
- Employee (E-ID, E-name)
- EmployeeContact (E-ID, Contact No)
- Project (P-Id, P-name)
- Works (E-ID, P-Id)
Third Normal Form (3NF)
3NF requires no transitive dependency of a non-key attribute on the key. In each relation above, every non-key attribute depends only on the key (E-name on E-ID, P-name on P-Id), and Works and EmployeeContact are all-key. So no further decomposition is needed.
Final 3NF relations
| Employee: E-ID | E-name |
|---|---|
| E01 | Ram |
| E02 | Shyam |
| E03 | Hari |
| E04 | Shyam |
| EmployeeContact: E-ID | Contact No |
|---|---|
| E01 | 9841 |
| E01 | 2273 |
| E02 | 98510 |
| E03 | 9860 |
| E03 | 5535 |
| E04 | 9899 |
| E04 | 9847 |
| Project: P-Id | P-name |
|---|---|
| P01 | ABC |
| P02 | XYZ |
| P03 | PQR |
| Works: E-ID | P-Id |
|---|---|
| E01 | P01 |
| E01 | P02 |
| E02 | P02 |
| E03 | P01 |
| E03 | P03 |
| E04 | P03 |
Redundancy and the insertion, deletion and update anomalies are removed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
Questions from TU BBA 2024 Second Semester Business Mathematics II (TU board exam, November 2024), TU BBA 2025 Second Semester Business Mathematics II (TU board exam, November 2025), TU BBA 2023 Second Semester Database Management System (TU board exam, March 2023), TU BBA 2024 Second Semester Database Management System (TU board exam, November 2024), TU BBA 2024 Second Semester Database Management System (Model Question) (TU model question, 2024), TU BBA 2025 Second Semester Database Management System (TU board exam, November 2025), TU BBA 2023 Second Semester English II (TU board exam, October 2023), TU BBA 2024 Second Semester English II (TU board exam, November 2024), TU BBA 2023 Second Semester Financial Accounting (TU board exam, March 2023), TU BBA 2024 Second Semester Financial Accounting (TU board exam, November 2024), TU BBA 2025 Second Semester Financial Accounting (TU board exam, November 2025), TU BBA 2023 Second Semester Macroeconomics for Business (TU board exam, March 2023), TU BBA 2024 Second Semester Macroeconomics for Business (TU board exam, November 2024), TU BBA 2025 Second Semester Macroeconomics for Business (TU board exam, November 2025), TU BBA 2023 Second Semester Macroeconomics for Business (Model Question) (TU model question, 2023 (set 1)) and TU BBA 2018 Second Semester Human Resource Management (TU board exam, September-October 2018 (MGT 202)). Answers are written for this site; check them against your class notes.