26/12/2025, 23:07 DBMS Question Paper Solution
Solve the question
I’ll solve the full question paper step-by-step, clearly and in exam-ready format (suitable
for DBMS mid-term answers).
Section A (Answer ALL)
1 (a) Main purpose of DBMS [2 marks]
The main purpose of a Database Management System (DBMS) is to store, manage, and
retrieve data efficiently while ensuring data consistency, security, and integrity.
It also reduces data redundancy and allows multiple users to access data concurrently.
1 (b) Role of logical, physical, and external views in database abstraction [4
marks]
[Link] 1/29
26/12/2025, 23:07 DBMS Question Paper Solution
Database abstraction has three levels:
1. Physical View
Describes how data is actually stored in storage devices.
Concerned with file structures, indexes, and memory allocation.
Used mainly by database administrators.
2. Logical View
Describes what data is stored and the relationships among data.
Independent of physical storage.
Used by database designers and programmers.
3. External View
Shows only the required portion of the database to users.
Different users can have different views.
Ensures data security and simplicity.
👉 These views help in data abstraction and data independence.
1 (c) Fundamental operations of Relational Algebra with example [4 marks]
The fundamental operations are:
1. Selection (σ)
Selects rows based on a condition.
Example:
bash
σ Department = 'CSE' (Employees)
Copy code
2. Projection (π)
Selects specific columns.
Example:
scss
π First_Name, Last_Name (Employees)
Copy code
3. Union (∪)
Combines tuples from two relations.
Example:
[Link] 2/29
26/12/2025, 23:07 DBMS Question Paper Solution
css
R ∪ S
Copy code
4. Set Difference (−)
Returns tuples present in one relation but not in another.
Example:
css
R − S
Copy code
2 (a) Database Schema and Instance [2 marks]
Database Schema
The structure or design of the database defined using tables, attributes, and
constraints.
It rarely changes.
Database Instance
The actual data stored in the database at a specific time.
It changes frequently.
2 (b) Importance of selecting a proper Primary Key [4 marks]
A Primary Key is important because:
It uniquely identifies each record.
Prevents duplicate data.
Ensures entity integrity.
Helps establish relationships using foreign keys.
Problems if Primary Key is not unique or contains NULL values:
Duplicate records may occur.
Data inconsistency arises.
Difficulty in referencing records.
Violates integrity constraints.
[Link] 3/29
26/12/2025, 23:07 DBMS Question Paper Solution
2 (c) SQL schema for UniversityDB [4 marks]
sql
CREATE DATABASE UniversityDB;
USE UniversityDB;
CREATE TABLE Department (
Dept_ID INT PRIMARY KEY,
Dept_Name VARCHAR(50) NOT NULL
);
CREATE TABLE Instructor (
Instructor_ID INT PRIMARY KEY,
Instructor_Name VARCHAR(50),
Dept_ID INT,
FOREIGN KEY (Dept_ID) REFERENCES Department(Dept_ID)
);
Section B (Answer ONE) Copy code
3 (a) Relational Algebra on Employees Table [10 marks]
Given relation:
Employees(Employee_Id, First_Name, Last_Name, Department, Salary)
i) Display only First_Name and Last_Name
scss
π First_Name, Last_Name (Employees)
Copy code
ii) Select employees with Salary ≤ 60000
scss
[Link] 4/29
26/12/2025, 23:07 DBMS Question Paper Solution
Copy code
σ Salary ≤ 60000 (Employees)
iii) Display only Department and Salary
scss
π Department, Salary (Employees)
Copy code
iv) Retrieve details where Last_Name = 'Khan'
bash
σ Last_Name = 'Khan' (Employees)
Copy code
v) Find employees not in CSE department
bash
σ Department ≠ 'CSE' (Employees)
Copy code
✅ Done
If you want, I can also:
Convert these answers into PDF
Provide short-note versions
Help with SQL version of Section B
Prepare model answers for exam writing
Just tell me 👍
[Link] 5/29
26/12/2025, 23:07 DBMS Question Paper Solution
Solve these questions
I see the image now 👍
Important clarification first:
👉 This image does NOT contain specific questions. It shows the Final-Term Syllabus for
DBMS (LAB).
So what I’ll do (most helpful for you right now):
✅ Provide solved, exam-oriented answers & examples for EACH syllabus topic
✅ Written in simple, marks-scoring format
✅ Suitable for quiz / lab / final exam preparation
📘 DBMS Final-Term SOLVED NOTES (According to Your
Syllabus)
[Link] 6/29
26/12/2025, 23:07 DBMS Question Paper Solution
Lecture Content-5: SQL Basics
1. Data Definition Language (DDL)
sql
CREATE TABLE Student (
Student_ID INT PRIMARY KEY,
Name VARCHAR(50),
CGPA DECIMAL(3,2)
);
DROP TABLE Student;
ALTER TABLE Student ADD Email VARCHAR(50);
Copy code
2. Data Query (SELECT)
sql
SELECT * FROM Student;
SELECT Name, CGPA FROM Student WHERE CGPA >= 3.00;
Copy code
3. Set Operations
sql
SELECT Name FROM A
UNION
SELECT Name FROM B;
SELECT Name FROM A
INTERSECT
SELECT Name FROM B;
SELECT Name FROM A
EXCEPT
SELECT Name FROM B;
[Link] 7/29
26/12/2025, 23:07 DBMS Question Paper Solution
Lecture Content-6: SQL Intermediate Copy code
1. JOINs
sql
SELECT [Link], d.Dept_Name
FROM Employee e
INNER JOIN Department d
ON e.Dept_ID = d.Dept_ID;
Copy code
Types:
INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL JOIN
2. VIEW
sql
CREATE VIEW CSE_Students AS
SELECT * FROM Student WHERE Department='CSE';
Copy code
3. Transactions
sql
BEGIN;
UPDATE Account SET Balance = Balance - 1000 WHERE ID=1;
COMMIT;
-- or
ROLLBACK;
Copy code
[Link] 8/29
26/12/2025, 23:07 DBMS Question Paper Solution
Lecture Content-7: SQL Advanced
1. Trigger
sql
CREATE TRIGGER before_insert
BEFORE INSERT ON Employee
FOR EACH ROW
SET [Link] = 30000;
Copy code
2. Stored Procedure
sql
CREATE PROCEDURE GetStudents()
BEGIN
SELECT * FROM Student;
END;
Copy code
3. OLAP Operations
Roll-up
Drill-down
Slice
Dice
Pivot
Lecture Content-8: Relational Algebra
Basic Operations
Operation Symbol Example
Selection σ σ Salary>50000 (Emp)
[Link] 9/29
26/12/2025, 23:07 DBMS Question Paper Solution
Operation Symbol Example
Projection π π Name,Dept (Emp)
Union ∪ A∪B
Difference − A−B
Cartesian × A×B
Lecture Content-9: E-R Modeling
Components
Entity: Student
Attribute: Student_ID
Relationship: Enrolls
Key attribute: Student_ID
Constraints
Cardinality (1:1, 1:N, M:N)
Participation (Total / Partial)
Lecture Content-10: ER → Relational Schema
Example:
ER Model
Student(Student_ID, Name)
Course(Course_ID, Title)
Enrolls(Student_ID, Course_ID)
Relational Schema
sql
Student(Student_ID PK, Name)
Course(Course_ID PK, Title)
[Link] 10/29
26/12/2025, 23:07 DBMS Question Paper Solution
Enrolls(Student_ID FK, Course_ID FK)
Copy code
Lecture Content-11: Normal Forms
1NF
No multivalued attributes
2NF
No partial dependency
3NF
No transitive dependency
Functional Dependency
nginx
Student_ID → Name, Dept
Copy code
Lecture Content-13 & 14: Transaction & Integrity
ACID Properties
Atomicity
Consistency
Isolation
Durability
Integrity Constraints
sql
PRIMARY KEY
FOREIGN KEY
UNIQUE
[Link] 11/29
26/12/2025, 23:07 DBMS Question Paper Solution
CHECK (Salary > 0)
NOT NULL
Copy code
✅ What I can do NEXT for you
✔️ Solve previous quiz questions
✔️ Create MCQs with answers
✔️ Make LAB-based SQL problems + solutions
✔️ Convert this into PDF / short notes / cheat sheet
👉 Just tell me what you want next (Quiz-4, Final exam, or Lab practical).
Final exam suggestions with answer
Great 👍
Below is a FINAL EXAM–FOCUSED SUGGESTION WITH ANSWERS based exactly on your
DBMS syllabus and your previous exam pattern.
This is written so you can revise + reproduce in the exam.
📘 DBMS FINAL EXAM SUGGESTIONS (WITH ANSWERS)
🔥 VERY HIGH PROBABILITY QUESTIONS
1. What is DBMS? State the advantages of DBMS.
Answer:
A Database Management System (DBMS) is software that allows users to store, retrieve,
manipulate, and manage data efficiently.
[Link] 12/29
26/12/2025, 23:07 DBMS Question Paper Solution
Advantages:
1. Reduces data redundancy
2. Ensures data integrity
3. Provides data security
4. Supports concurrent access
5. Provides backup and recovery
2. Explain Three-Level Architecture of DBMS.
Answer:
DBMS has three levels of abstraction:
1. Physical Level – Describes how data is stored physically.
2. Logical Level – Describes what data is stored and relationships.
3. External Level – User-specific views of the database.
👉 It provides data independence.
3. What is Relational Algebra? Explain basic operations.
Answer:
Relational Algebra is a procedural query language used to retrieve data from relational
databases.
Basic operations:
Operation Symbol Example
Selection σ σ Dept='CSE'(Emp)
Projection π π Name,Salary(Emp)
Union ∪ R∪S
Difference − R−S
[Link] 13/29
26/12/2025, 23:07 DBMS Question Paper Solution
Operation Symbol Example
Cartesian Product × R×S
4. Write SQL queries using a given table (Very Common)
Example Table: Employees(Eid, Name, Dept, Salary)
(a) Find employees with salary > 50000
sql
SELECT * FROM Employees WHERE Salary > 50000;
Copy code
(b) Show only Name and Department
sql
SELECT Name, Dept FROM Employees;
Copy code
5. Explain JOINs with example.
Answer:
JOIN is used to combine rows from two or more tables.
Example:
sql
SELECT [Link], d.Dept_Name
FROM Employee e
INNER JOIN Department d
ON e.Dept_ID = d.Dept_ID;
Copy code
Types of JOINs:
INNER JOIN
[Link] 14/29
26/12/2025, 23:07 DBMS Question Paper Solution
LEFT JOIN
RIGHT JOIN
FULL JOIN
6. What is a VIEW? Write SQL to create a view.
Answer:
A VIEW is a virtual table created from a SELECT query.
sql
CREATE VIEW CSE_Students AS
SELECT * FROM Student WHERE Dept='CSE';
Copy code
Advantages:
Security
Simplicity
Reusability
7. What is a TRANSACTION? Explain ACID properties.
Answer:
A transaction is a sequence of operations executed as a single unit.
ACID Properties
Atomicity – All or nothing
Consistency – Keeps database valid
Isolation – Transactions don’t interfere
Durability – Data remains after commit
8. What is a TRIGGER? Give example.
Answer:
[Link] 15/29
26/12/2025, 23:07 DBMS Question Paper Solution
A Trigger is an automatic action executed when an event occurs.
sql
CREATE TRIGGER before_insert
BEFORE INSERT ON Employee
FOR EACH ROW
SET [Link] = 30000;
Copy code
9. Explain ER Model with example.
Answer:
ER model represents data using:
Entity – Student
Attributes – ID, Name
Relationship – Enrolls
Key – Student_ID
Constraints:
Cardinality (1:1, 1:N, M:N)
Participation (Total / Partial)
10. Convert ER model to Relational Schema.
Answer:
ER:
Student(Student_ID, Name)
Course(Course_ID, Title)
Schema:
text
Student(Student_ID PK, Name)
[Link] 16/29
26/12/2025, 23:07 DBMS Question Paper Solution
Course(Course_ID PK, Title) Copy code
11. Explain Normalization & Normal Forms.
Answer:
Normalization reduces data redundancy.
Normal Forms:
1NF – Atomic values
2NF – No partial dependency
3NF – No transitive dependency
12. What is Functional Dependency?
Answer:
A functional dependency means:
css
A → B
Copy code
If A determines B.
Example:
nginx
Student_ID → Name, Dept
Copy code
13. Integrity Constraints with examples.
Answer:
sql
[Link] 17/29
26/12/2025, 23:07 DBMS Question Paper Solution
PRIMARY KEY
FOREIGN KEY
UNIQUE
CHECK (Salary > 0)
NOT NULL
Copy code
🧠 LAST-MINUTE EXAM TIPS
✅ Write definitions first
✅ Use diagrams/tables if possible
✅ For SQL, syntax matters
✅ For Relational Algebra, use symbols properly
📌 Want more?
I can:
✔️ Predict exact question set
✔️ Provide MCQs + answers
✔️ Make 2-hour full model test paper
✔️ Create PDF final notes
👉 Just tell me what you want next.
[Link] 18/29
26/12/2025, 23:07 DBMS Question Paper Solution
solve this topic with proper examples
Perfect 👍
This board image is basically your FINAL EXAM QUESTION MAP.
Below I’m solving EVERY TOPIC shown on the board, with clear definitions + proper
examples, exactly how examiners expect.
📘 DBMS FINAL TOPICS – SOLVED WITH EXAMPLES
🔑 KEYS IN DBMS
1. Super Key
A super key is any set of attributes that uniquely identifies a tuple.
👉 It may contain extra attributes.
Example:
Student(Student_ID, Email, Name)
{Student_ID}
{Student_ID, Name}
{Email}
[Link] 19/29
26/12/2025, 23:07 DBMS Question Paper Solution
All are Super Keys.
2. Candidate Key
A candidate key is a minimal super key (no extra attributes).
Example:
Student_ID
Email
👉 Both uniquely identify students → Candidate Keys
3. Primary Key
A primary key is a selected candidate key.
Rules:
Unique
NOT NULL
Example:
sql
Student_ID PRIMARY KEY
Copy code
4. Foreign Key
A foreign key creates a relationship between tables.
Example:
sql
Dept_ID REFERENCES Department(Dept_ID)
Copy code
[Link] 20/29
26/12/2025, 23:07 DBMS Question Paper Solution
📐 RELATIONAL ALGEBRA (RA)
Relation:
Employee(Eid, Name, Dept, Salary)
Selection (σ)
Select rows based on condition.
scss
σ Salary > 50000 (Employee)
Copy code
Projection (π)
Select columns.
scss
π Name, Dept (Employee)
Copy code
Union (∪)
css
R ∪ S
Copy code
Difference (−)
css
R − S
Copy code
[Link] 21/29
26/12/2025, 23:07 DBMS Question Paper Solution
Cartesian Product (×)
nginx
Employee × Department
Copy code
🧠 SQL (WHERE, HAVING, SUBQUERY)
WHERE Clause
Used to filter rows.
sql
SELECT * FROM Employee WHERE Salary > 50000;
Copy code
HAVING Clause
Used with GROUP BY.
sql
SELECT Dept, AVG(Salary)
FROM Employee
GROUP BY Dept
HAVING AVG(Salary) > 60000;
Copy code
Subquery
A query inside another query.
sql
SELECT Name
FROM Employee
WHERE Salary > (SELECT AVG(Salary) FROM Employee);
Copy code
[Link] 22/29
26/12/2025, 23:07 DBMS Question Paper Solution
🔁 NORMALIZATION
Functional Dependency
css
A → B
Copy code
Means A determines B.
Example:
nginx
Student_ID → Name, Dept
Copy code
❌ Partial Dependency
Occurs in 2NF violation.
Example:
scss Copy code
Enroll(Student_ID, Course_ID, Student_Name)
Dependency:
nginx Copy code
Student_ID → Student_Name
❌ Depends on part of composite key → Partial Dependency
❌ Transitive Dependency
Occurs in 3NF violation.
[Link] 23/29
26/12/2025, 23:07 DBMS Question Paper Solution
Example:
nginx Copy code
Emp_ID → Dept_ID
Dept_ID → Dept_Name
So:
nginx Copy code
Emp_ID → Dept_Name
❌ Indirect dependency → Transitive
✅ NORMAL FORMS
1NF
Atomic values
No multivalued attributes
2NF
Must be in 1NF
No partial dependency
3NF
Must be in 2NF
No transitive dependency
🔄 TRANSACTION
Definition
A transaction is a sequence of operations executed as a single logical unit.
[Link] 24/29
26/12/2025, 23:07 DBMS Question Paper Solution
ACID Properties
Property Meaning
Atomicity All or nothing
Consistency Database remains valid
Isolation Transactions don’t interfere
Durability Changes are permanent
Transaction States Diagram (Write this in exam)
pgsql Copy code
Active → Partially Committed → Committed
↓
Failed → Aborted
Transaction Example
sql Copy code
BEGIN;
UPDATE Account SET Balance = Balance - 1000 WHERE ID=1;
COMMIT;
🎯 FINAL EXAM WRITING STRATEGY
✔ Definitions first
✔ One clear example per topic
✔ Use arrows (→) in dependencies
✔ Write SQL/RA in code format
[Link] 25/29
26/12/2025, 23:07 DBMS Question Paper Solution
📌 Want next?
I can:
✔ Predict exact long questions
✔ Create diagram-based answers
✔ Make 1-day revision notes
✔ Convert this into PDF
Just tell me 👍
solve the question
Let’s solve it step-by-step exactly as required in a DBMS final exam.
📌 Given Schedule (from the image)
Order of operations (top → bottom):
Step T1 T2 T3
1 R(A)
[Link] 26/29
26/12/2025, 23:07 DBMS Question Paper Solution
Step T1 T2 T3
2 W(A)
3 R(B)
4 R(A)
5 W(B)
6 R(A)
7 R(C)
8 W(C)
9 R(C)
i) Check whether the schedule is serializable
We check Conflict Serializability using a Precedence (Serialization) Graph.
🔁 Conflicting Operations & Edges
On data item A
T1 : W(A) → T2 : R(A) ⇒ T1 → T2
T1 : W(A) → T3 : R(A) ⇒ T1 → T3
On data item B
T1 : R(B) → T2 : W(B) ⇒ T1 → T2
On data item C
T3 : R(C) → T1 : W(C) ⇒ T3 → T1
[Link] 27/29
26/12/2025, 23:07 DBMS Question Paper Solution
🧠 Precedence Graph
Edges:
T1 → T2
T1 → T3
ChatGPT
T3 → T1 Upgrade to Go
This creates a cycle:
nginx Copy code
T1 → T3 → T1
✅ Conclusion (Part i)
❌ The schedule is NOT conflict-serializable
because the precedence graph contains a cycle.
ii) Cascading abort analysis
A schedule is cascading if:
A transaction reads data written by another uncommitted transaction.
🔎 Dirty Reads in the Schedule
Dirty Read on A
T1 : W(A)
T2 : R(A) → reads uncommitted data from T1 ❌
T3 : R(A) → reads uncommitted data from T1 ❌
So:
T2 depends on T1
T3 depends on T1
[Link] 28/29
26/12/2025, 23:07 DBMS Question Paper Solution
🧨 Cascading Effect
If T1 aborts:
T2 must abort (dirty read on A)
T3 must abort (dirty read on A)
✅ Conclusion (Part ii)
✔️ The schedule is cascading
✔️ Failure of T1 will abort T2 and T3
🧾 Final Exam-Ready Answer (Short Form)
The given schedule is not serializable due to a cycle (T1 ↔ T3) in the precedence
graph.
The schedule is cascading because T2 and T3 read uncommitted data written by T1.
If T1 fails, all other transactions (T2, T3) will be aborted.
If you want, I can also:
Draw the precedence graph diagram
Rewrite this in 2–3 mark answer style
Give a similar practice problem with solution
Just tell me 👍
[Link] 29/29