Master DBMS
From Zero to Viva
Everything you need â concepts, SQL, normalization, transactions, quizzes & quick revision notes. Built for college students.
Syllabus at a Glance
Four units covering everything from DBMS basics to advanced transactions
DBMS Fundamentals
Intro to DBMS, ER Model, Entities, Attributes, Keys, Relationships, Architecture
- DBMS Overview & Architecture
- ER Diagrams & Entities
- Keys & Relationships
- Data Models
SQL & Queries
Complete SQL â DDL, DML, DCL, Joins, Views, Triggers, Stored Procedures
- SQL Commands (DDL/DML/DCL)
- Joins & Nested Queries
- Views, Triggers, Indexes
- Integrity Constraints
Relational Model & Normalization
Relational Algebra, Calculus, Functional Dependencies, 1NFâBCNF
- Relational Algebra
- Codd's Rules
- Normalization 1NFâBCNF
- ER to Relational Mapping
Transactions & Security
ACID Properties, Recovery, Security, Authorization, NoSQL Databases
- Transaction Processing
- ACID Properties
- Recovery Techniques
- NoSQL Databases
ð Your Learning Progress
ðï¸ DBMS Fundamentals & ER Model
Overview of DBMS
Think of a library â the books are the data, and the librarian system (catalog, borrowing records) is the DBMS. Without a DBMS, you'd store data in flat files, which makes searching, updating, and securing data extremely difficult.
Why DBMS instead of File Systems?
| File System | DBMS |
|---|---|
| Data redundancy (same data stored multiple times) | Controlled redundancy |
| No consistency enforcement | Data consistency guaranteed |
| No multi-user access control | Concurrent access control |
| No backup/recovery | Built-in recovery mechanisms |
| Data dependent on programs | Data independence |
Characteristics of DBMS
Multiple users can access data simultaneously
Access controls prevent unauthorized access
Accuracy and consistency of data
Changes in schema don't affect programs
Normalized storage prevents duplication
Automatic recovery from failures
- What is DBMS? How is it different from a file system?
- Name any 4 characteristics of DBMS.
- What is data redundancy? How does DBMS control it?
- Give two real-world examples where DBMS is used.
DBMS Architecture (3-Level / ANSI-SPARC)
What individual users see â customized views
DBA's view â logical structure of entire database
How data is actually stored on disk
Data Independence
| Type | Description | Example |
|---|---|---|
| Logical | Changes in conceptual schema don't affect external views | Adding a new column doesn't break existing apps |
| Physical | Changes in storage don't affect conceptual schema | Changing file organization doesn't affect logic |
Client/Server Architecture
Sends SQL queries
Displays results
Processes queries
Manages data
- What are the 3 levels of DBMS architecture?
- What is data independence? Name its types.
- What is the difference between schema and instance?
- Explain client/server architecture in DBMS.
Data Models
| Model | Description | Example |
|---|---|---|
| Hierarchical | Tree structure, parent-child relationships | IBM IMS |
| Network | Graph structure, record types with sets | IDMS |
| Relational | Tables with rows and columns | MySQL, Oracle |
| Object-Oriented | Objects with attributes and methods | db4o |
| ER Model | Entities, attributes, relationships | Conceptual design |
ER Model â Entities & Attributes
Types of Attributes
| Type | Description | Example | ER Symbol |
|---|---|---|---|
| Simple | Cannot be divided further | Age, Roll No | Oval |
| Composite | Can be divided into sub-parts | Name â First, Last | Oval + sub-ovals |
| Derived | Computed from other attributes | Age (from DOB) | Dashed oval |
| Multi-valued | Can have multiple values | Phone numbers | Double oval |
| Key | Uniquely identifies entity | Student ID | Underlined oval |
Sample ER Diagram â STUDENT
(Key)
(Composite)
(Derived)
(Multi-valued)
(Simple)
- What is the difference between entity, entity type, and entity set?
- What is a derived attribute? Give an example.
- What is a composite attribute?
- How is a multi-valued attribute represented in an ER diagram?
Keys in DBMS
Keys are used to uniquely identify records in a table. Understanding keys is extremely important for your exam.
ð Super Key
A set of one or more attributes that can uniquely identify a tuple.
Super Keys: {Roll}, {Email}, {Roll, Name}
ðï¸ Candidate Key
A minimal super key â no proper subset of it is a super key.
Candidate Keys: {Roll}, {Email}
ð Primary Key
One candidate key chosen by the DBA. Cannot be NULL.
â one value per student, never null
ð Foreign Key
An attribute that references the primary key of another table.
ð Alternate Key
Candidate keys that are not chosen as the primary key.
ð§© Composite Key
A primary key made of two or more attributes.
â in Enrollment table
- What is the difference between super key and candidate key?
- Can a foreign key have NULL values?
- What is a composite key?
- Why can't a primary key be NULL?
Relationships, Weak Entities, Specialization & Generalization
Cardinality Ratios
| Type | Notation | Example |
|---|---|---|
| One-to-One (1:1) | 1:1 | Person â Passport |
| One-to-Many (1:N) | 1:N | Department â Employees |
| Many-to-One (N:1) | N:1 | Employees â Manager |
| Many-to-Many (M:N) | M:N | Students â Courses |
Weak Entity
Example: Dependent (child) of an Employee. Represented with double rectangle in ER diagrams.
Specialization vs Generalization
| Feature | Specialization | Generalization |
|---|---|---|
| Direction | Top-down | Bottom-up |
| Process | Higher entity â sub-entities | Common entities â higher entity |
| Example | VEHICLE â Car, Truck, Bike | Car, Truck, Bike â VEHICLE |
- What is a weak entity? Give an example.
- Difference between specialization and generalization?
- What is a partial key (discriminator)?
- What is participation constraint (total vs partial)?
ð Important Long Questions â Unit I
Explain the 3-level architecture of DBMS with a neat diagram. What are the advantages of this architecture?
What is an ER diagram? Explain all types of attributes with examples and ER notations.
Explain the ER model in detail. Draw an ER diagram for a University database with Students, Courses, Departments, and Faculty entities.
Explain all types of keys in DBMS with examples. What is data independence? Explain its types.
What is the difference between specialization and generalization? Explain with an example.
ð¾ SQL & Database Queries
SQL Overview & Command Types
DDL Examples
-- Create a table
CREATE TABLE Students (
Student_ID INT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Branch VARCHAR(50) DEFAULT 'CSE',
Marks DECIMAL(5,2) CHECK (Marks >= 0 AND Marks <= 100),
Email VARCHAR(100) UNIQUE
);
-- Add a new column
ALTER TABLE Students ADD Phone VARCHAR(15);
-- Modify column type
ALTER TABLE Students MODIFY Marks FLOAT;
-- Drop a column
ALTER TABLE Students DROP COLUMN Phone;
-- Delete all data but keep structure
TRUNCATE TABLE Students;
-- Delete table completely
DROP TABLE Students;
DML Examples
-- INSERT
INSERT INTO Students VALUES (101, 'Rahul', 'CSE', 89.5, 'rahul@email.com');
INSERT INTO Students (Student_ID, Name) VALUES (102, 'Priya');
-- UPDATE
UPDATE Students SET Marks = 92 WHERE Student_ID = 101;
UPDATE Students SET Branch = 'IT' WHERE Branch = 'CSE' AND Marks < 60;
-- DELETE
DELETE FROM Students WHERE Student_ID = 102;
DELETE FROM Students WHERE Marks < 40;
-- SELECT with conditions
SELECT Name, Marks FROM Students WHERE Branch = 'CSE';
SELECT DISTINCT Branch FROM Students;
SELECT * FROM Students WHERE Marks BETWEEN 60 AND 90;
SELECT * FROM Students WHERE Name LIKE 'R%';
SELECT * FROM Students WHERE Branch IN ('CSE', 'IT', 'ECE');
DELETE â removes rows (can use WHERE, can ROLLBACK) | TRUNCATE â removes ALL rows fast (cannot WHERE/ROLLBACK) | DROP â deletes entire table including structure
GROUP BY, HAVING & Aggregate Functions
-- GROUP BY: groups rows that have same values SELECT Branch, COUNT(*) AS Student_Count, AVG(Marks) AS Avg_Marks FROM Students GROUP BY Branch; -- Output: -- Branch | Student_Count | Avg_Marks -- CSE | 3 | 87.00 -- IT | 1 | 85.00 -- HAVING: filter AFTER grouping (like WHERE but for groups) SELECT Branch, AVG(Marks) AS Avg_Marks FROM Students GROUP BY Branch HAVING AVG(Marks) > 80; -- only branches with avg > 80 -- ORDER BY: sort results SELECT Name, Marks FROM Students ORDER BY Marks DESC; SELECT Name, Marks FROM Students ORDER BY Marks ASC LIMIT 3;
Aggregate Functions
SELECT COUNT(*) FROM Students; -- 4 (total rows) SELECT COUNT(Email) FROM Students; -- counts non-null emails SELECT SUM(Marks) FROM Students; -- sum of all marks SELECT AVG(Marks) FROM Students; -- average SELECT MAX(Marks) FROM Students; -- highest SELECT MIN(Marks) FROM Students; -- lowest
WHERE filters BEFORE grouping | HAVING filters AFTER grouping
WHERE cannot use aggregate functions | HAVING can use aggregate functions
Integrity Constraints
| Constraint | Description | Example |
|---|---|---|
| PRIMARY KEY | Unique + NOT NULL identifier | PRIMARY KEY (Student_ID) |
| NOT NULL | Column cannot have NULL value | Name VARCHAR(100) NOT NULL |
| UNIQUE | All values must be distinct (allows NULL) | Email VARCHAR(100) UNIQUE |
| CHECK | Value must satisfy a condition | CHECK (Age >= 18) |
| DEFAULT | Provides default value if none given | Branch VARCHAR(50) DEFAULT 'CSE' |
| FOREIGN KEY | References primary key of another table | FOREIGN KEY (Dept_ID) REFERENCES Department(Dept_ID) |
CREATE TABLE Department (
Dept_ID INT PRIMARY KEY,
Dept_Name VARCHAR(100) NOT NULL
);
CREATE TABLE Employee (
Emp_ID INT PRIMARY KEY,
Emp_Name VARCHAR(100) NOT NULL,
Dept_ID INT,
Salary DECIMAL(10,2) CHECK (Salary > 0),
FOREIGN KEY (Dept_ID) REFERENCES Department(Dept_ID)
ON DELETE CASCADE -- if dept deleted, employees also deleted
ON UPDATE CASCADE -- if dept_id updated, update here too
);
SQL Joins (MOST IMPORTANT)
Joins are used to combine rows from two or more tables based on a related column.
-- Tables: Students(SID, Name, CID) | Courses(CID, Course_Name) -- Data: Rahulâ101(DBMS), Priyaâ102(OS), AmitâNULL | 103(CN) has no student -- INNER JOIN: only matching rows from BOTH tables SELECT s.Name, c.Course_Name FROM Students s INNER JOIN Courses c ON s.CID = c.CID; -- Result: Rahul-DBMS, Priya-OS (Amit and CN excluded) -- LEFT JOIN: all from left table, matching from right (NULL if no match) SELECT s.Name, c.Course_Name FROM Students s LEFT JOIN Courses c ON s.CID = c.CID; -- Result: Rahul-DBMS, Priya-OS, Amit-NULL -- RIGHT JOIN: all from right table, matching from left SELECT s.Name, c.Course_Name FROM Students s RIGHT JOIN Courses c ON s.CID = c.CID; -- Result: Rahul-DBMS, Priya-OS, NULL-CN -- FULL OUTER JOIN: all rows from both tables -- (MySQL doesn't support directly, use UNION of LEFT + RIGHT) SELECT s.Name, c.Course_Name FROM Students s LEFT JOIN Courses c ON s.CID = c.CID UNION SELECT s.Name, c.Course_Name FROM Students s RIGHT JOIN Courses c ON s.CID = c.CID; -- CROSS JOIN: every combination (Cartesian product) SELECT s.Name, c.Course_Name FROM Students s CROSS JOIN Courses c; -- 3 students à 3 courses = 9 rows -- SELF JOIN: table joined with itself SELECT A.Name AS Student, B.Name AS Mentor FROM Students A JOIN Students B ON A.Mentor_ID = B.SID;
- What is the difference between INNER JOIN and LEFT JOIN?
- What is a CROSS JOIN? When is it used?
- What is a self join?
- How many rows does a CROSS JOIN of 3Ã4 tables produce?
Nested & Correlated Queries
-- Find students with marks above average
SELECT Name, Marks FROM Students
WHERE Marks > (SELECT AVG(Marks) FROM Students);
-- Find students enrolled in 'DBMS' course
SELECT Name FROM Students
WHERE CID IN (SELECT CID FROM Courses WHERE Course_Name = 'DBMS');
-- Correlated Subquery: inner query references outer query
SELECT Name, Marks FROM Students s1
WHERE Marks > (
SELECT AVG(Marks) FROM Students s2
WHERE s2.Branch = s1.Branch -- references outer query's Branch
);
-- This finds students above the avg of their OWN branch
Nested query: Inner query runs ONCE, result used by outer query.
Correlated query: Inner query runs ONCE PER ROW of outer query â slower but more flexible.
Views, Indexes, Triggers & Stored Procedures
-- Create a view showing only CSE students CREATE VIEW CSE_Students AS SELECT Student_ID, Name, Marks FROM Students WHERE Branch = 'CSE'; -- Query the view like a table SELECT * FROM CSE_Students; -- Drop a view DROP VIEW CSE_Students;
-- Create index on Name column CREATE INDEX idx_name ON Students(Name); -- Unique index (also enforces uniqueness) CREATE UNIQUE INDEX idx_email ON Students(Email); -- Drop index DROP INDEX idx_name ON Students;
-- Trigger: log every INSERT into Students
CREATE TRIGGER after_student_insert
AFTER INSERT ON Students
FOR EACH ROW
BEGIN
INSERT INTO Audit_Log(Action, Student_ID, Log_Time)
VALUES ('INSERT', NEW.Student_ID, NOW());
END;
DELIMITER //
CREATE PROCEDURE GetStudentsByBranch(IN branch_name VARCHAR(50))
BEGIN
SELECT * FROM Students WHERE Branch = branch_name;
END //
DELIMITER ;
-- Call the procedure
CALL GetStudentsByBranch('CSE');
| Object | Description | Key Benefit |
|---|---|---|
| View | Virtual table based on SELECT | Security, simplification |
| Index | Data structure for fast lookup | Faster queries |
| Trigger | Auto-runs on INSERT/UPDATE/DELETE | Automatic actions |
| Stored Procedure | Reusable SQL block with parameters | Code reuse, performance |
- What is a view? Can you update data through a view?
- What is an index? What are its disadvantages?
- What is a trigger? Name the types of triggers.
- Difference between function and stored procedure?
ð Important Long Questions â Unit II
Explain DDL and DML commands with examples. What is the difference between DELETE and TRUNCATE?
What are joins in SQL? Explain INNER JOIN, LEFT JOIN, and RIGHT JOIN with examples and output.
Explain GROUP BY and HAVING clauses with examples. Write SQL queries using aggregate functions COUNT, SUM, AVG, MAX, MIN.
What are integrity constraints in SQL? Explain PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, and CHECK constraints with examples.
What is a view? What are its advantages? Write SQL to create and use a view.
ð Relational Model & Normalization
Relational Model â Domains, Attributes, Tuples, Relations
| Term | Formal Name | Common Term | Example |
|---|---|---|---|
| Relation | Relation | Table | Students table |
| Tuple | Tuple | Row / Record | One student's data |
| Attribute | Attribute | Column / Field | Name, Age, Branch |
| Domain | Domain | Data type + valid values | Age: positive integers 1â150 |
| Degree | Degree | Number of columns | 5 attributes â degree 5 |
| Cardinality | Cardinality | Number of rows | 100 students â cardinality 100 |
Codd's 12 Rules (Important!)
Foundation Rule: A relational system must manage data using its relational capabilities only.
Information Rule: All data is represented as values in tables.
Guaranteed Access: Every value accessible by table name, primary key, and column name.
Systematic NULL Handling: NULL represents missing/inapplicable information.
Active Online Catalog: Schema stored in the same database.
Comprehensive Data Sublanguage: At least one language must support DDL, DML, integrity, authorization, transactions.
View Updating Rule: All theoretically updatable views must be updatable.
High-level Insert/Update/Delete: Must support set-level operations.
Physical Data Independence: Application unaffected by storage changes.
Logical Data Independence: Application unaffected by logical changes.
Integrity Independence: Integrity constraints stored in catalog, not programs.
Distribution Independence: System must work the same whether data is distributed or not.
Non-subversion Rule: Cannot bypass integrity constraints using low-level language.
Relational Algebra & Calculus
| Operation | Symbol | Description | Example |
|---|---|---|---|
| Selection (Ï) | Ï | Selects rows satisfying a condition | ÏBranch='CSE'(Students) |
| Projection (Ï) | Ï | Selects specific columns | ÏName,Marks(Students) |
| Union (âª) | ⪠| All tuples from both relations (no duplicates) | R ⪠S |
| Intersection (â©) | â© | Tuples in BOTH relations | R â© S |
| Difference (â) | â | Tuples in R but NOT in S | R â S |
| Cartesian Product (Ã) | Ã | All combinations of tuples | R Ã S |
| Join (â) | â | Natural Join â combine on common attributes | R â S |
| Division (÷) | ÷ | Tuples in R related to ALL tuples in S | R ÷ S |
Relational Calculus
{t | P(t)} â set of all tuples t satisfying predicate P.Example: {t | t â Students â§ t.Branch = 'CSE'}
Example: {â¨n, mâ© | âb (â¨n, b, mâ© â Students â§ b = 'CSE')}
Normalization â 1NF, 2NF, 3NF, BCNF (MOST IMPORTANT)
Functional Dependency (FD)
X â Y means "X functionally determines Y" â if two tuples have the same X value, they must have the same Y value.
Example: Student_ID â Name, Branch, Marks
Armstrong's Axioms
| Axiom | Rule | Example |
|---|---|---|
| Reflexivity | If Y â X, then X â Y | {Name, Age} â {Name} |
| Augmentation | If X â Y, then XZ â YZ | A â B implies AC â BC |
| Transitivity | If X â Y and Y â Z, then X â Z | SIDâBranch, BranchâHOD â¹ SIDâHOD |
Step-by-Step Normalization Example
| SID | Name | Courses | Instructor | Dept |
|---|---|---|---|---|
| 101 | Rahul | DBMS, OS | Dr.A, Dr.B | CSE |
| 102 | Priya | DBMS | Dr.A | CSE |
â Problem: Multiple values in one cell (Courses, Instructor)
Rule: All attributes must have atomic (single) values. No repeating groups.
| SID | Name | Course | Instructor | Dept |
|---|---|---|---|---|
| 101 | Rahul | DBMS | Dr.A | CSE |
| 101 | Rahul | OS | Dr.B | CSE |
| 102 | Priya | DBMS | Dr.A | CSE |
PK = (SID, Course) | FDs: SID â Name, Dept | Course â Instructor
â Problem: Partial dependency â Name depends only on SID (part of key), not full key
Rule: 1NF + No partial dependencies (every non-key attribute must depend on the FULL primary key)
Student Table
| SID (PK) | Name | Dept |
|---|---|---|
| 101 | Rahul | CSE |
| 102 | Priya | CSE |
Enrollment Table
| SID | Course | Instructor |
|---|---|---|
| 101 | DBMS | Dr.A |
| 101 | OS | Dr.B |
| 102 | DBMS | Dr.A |
â Problem: Transitive dependency â Course â Instructor (if Instructor has other dependencies)
Rule: 2NF + No transitive dependencies (non-key attributes must depend ONLY on primary key, not on other non-key attributes)
â After removing all transitive FDs, we achieve 3NF.
Rule: For every functional dependency X â Y, X must be a super key. Stronger than 3NF.
Example: Students(SID, Course, Instructor)
FDs: (SID, Course) â Instructor | Instructor â Course
Problem: Instructor â Course, but Instructor is not a super key.
Solution: Decompose into: Teaching(Instructor, Course) and Enrollment(SID, Instructor)
Normalization Summary Table
| Normal Form | Condition | Eliminates |
|---|---|---|
| 1NF | Atomic values only | Repeating groups, multi-valued cells |
| 2NF | 1NF + no partial deps | Partial functional dependency |
| 3NF | 2NF + no transitive deps | Transitive functional dependency |
| BCNF | Every determinant is a super key | All anomalies (strongest) |
- What is normalization? Why is it needed?
- What is a functional dependency? Give an example.
- What is the difference between 2NF and 3NF?
- What is BCNF? How does it differ from 3NF?
- State Armstrong's axioms.
ER to Relational Mapping
| ER Concept | Relational Mapping |
|---|---|
| Entity type | Relation (table) with same attributes |
| Simple attribute | Column in the table |
| Composite attribute | Only the sub-attributes (leaves) become columns |
| Multi-valued attribute | New separate table with FK reference |
| Derived attribute | Not stored (computed when needed) |
| 1:1 Relationship | Add FK to either side; or merge into one table |
| 1:N Relationship | Add FK (PK of 1-side) to N-side table |
| M:N Relationship | Create new junction table with both PKs as FKs |
| Weak entity | Table with PK = owner's PK + partial key; FK to owner |
- How is a M:N relationship converted to relational tables?
- How is a multi-valued attribute mapped?
- How is a weak entity converted?
ð Important Long Questions â Unit III
Explain normalization in detail with examples showing 1NF, 2NF, 3NF, and BCNF step by step.
Define functional dependency. State and explain Armstrong's axioms with examples.
Explain relational algebra operations â selection, projection, union, intersection, and difference with examples.
What is the relational model? Explain Codd's rules. Define tuple, attribute, domain, and degree with examples.
Explain how an ER diagram is converted to relational tables. Show conversion for 1:N and M:N relationships.
ð Transactions, Security & NoSQL
Transaction Processing & ACID Properties
Example: Bank transfer â deduct â¹5000 from Account A AND add â¹5000 to Account B. Both must happen or neither should happen.
Transaction States
ACID Properties
Atomicity
All or nothing â either all operations in a transaction succeed, or none are applied.
Consistency
A transaction takes the database from one consistent state to another. All rules/constraints must hold before and after.
Isolation
Concurrent transactions execute independently â intermediate results are hidden from other transactions.
Durability
Once committed, changes are permanent even in case of system failure.
Concurrency Problems
| Problem | Description |
|---|---|
| Dirty Read | T2 reads data written by T1 which hasn't committed yet |
| Unrepeatable Read | T2 reads same data twice, gets different values (T1 changed it in between) |
| Phantom Read | T2 executes same query twice, sees different rows (T1 inserted/deleted rows) |
| Lost Update | T1 and T2 both update same data; T1's update is overwritten by T2 |
Recovery Techniques
| Technique | Description |
|---|---|
| Log-based Recovery | Maintain a log of all changes; use REDO/UNDO operations |
| Checkpoint | Periodically save state; recovery starts from last checkpoint |
| Shadow Paging | Keep a shadow copy of database pages; switch on commit |
| Deferred Update | Write to log, apply changes only after COMMIT |
| Immediate Update | Apply changes immediately but log them for recovery |
- What are ACID properties? Explain with example.
- What is dirty read? How is it prevented?
- What is the difference between deferred and immediate update?
- What is a checkpoint in recovery?
Database Security â Authentication & Authorization
-- Grant permissions to a user GRANT SELECT, INSERT ON Students TO 'teacher_user'@'localhost'; -- Grant ALL privileges GRANT ALL PRIVILEGES ON university.* TO 'admin'@'localhost'; -- Revoke permissions REVOKE INSERT ON Students FROM 'teacher_user'@'localhost'; -- Grant with option to re-grant GRANT SELECT ON Students TO 'dept_head' WITH GRANT OPTION;
| Security Level | Description | Example |
|---|---|---|
| Physical | Secure the physical server | Locked server room, CCTV |
| OS Level | OS-level access controls | User accounts, file permissions |
| Network | Encrypt data in transit | SSL/TLS, firewalls, VPN |
| DBMS Level | SQL GRANT/REVOKE, roles | GRANT SELECT to 'user' |
| Application | App-level checks | Login forms, session management |
NoSQL Databases
Document Store
Stores data as JSON/BSON documents
MongoDB, CouchDB
{ "name": "Rahul",
"branch": "CSE",
"marks": 89 }Key-Value Store
Simple key â value pairs; extremely fast
Redis, DynamoDB
"user:101" â "Rahul" "marks:101" â "89"
Column-Family
Columns grouped into families; great for analytics
Cassandra, HBase
Graph Database
Nodes and edges; great for relationships
Neo4j, Amazon Neptune
SQL vs NoSQL
| Feature | SQL (RDBMS) | NoSQL |
|---|---|---|
| Schema | Fixed schema | Flexible/dynamic schema |
| Scaling | Vertical (bigger server) | Horizontal (more servers) |
| ACID | Full ACID support | Eventual consistency (mostly) |
| Joins | Supports complex joins | No joins (embed or reference) |
| Use case | Structured, relational data | Big data, unstructured, real-time |
| Examples | MySQL, Oracle, PostgreSQL | MongoDB, Redis, Cassandra |
- What is NoSQL? How does it differ from SQL?
- What are the types of NoSQL databases?
- When would you prefer NoSQL over SQL?
- What is eventual consistency?
ð Important Long Questions â Unit IV
Explain ACID properties of transactions in detail with examples. What problems arise in concurrent transactions without ACID?
What are recovery techniques in DBMS? Explain log-based recovery with checkpoint.
Explain database security. What is the difference between authentication and authorization?
What are NoSQL databases? Explain their types with examples. Compare SQL vs NoSQL.
ðï¸ Complete Viva Question Bank
Unit I Viva
- What is DBMS? Advantages over file system?
- Explain 3-level DBMS architecture.
- What is data independence? Types?
- Difference between schema and instance?
- What is an entity? Entity type vs entity set?
- Types of attributes in ER model?
- What is a weak entity? Example?
- Super key vs candidate key vs primary key?
- What is a foreign key? Referential integrity?
- Specialization vs generalization?
Unit II Viva
- DDL vs DML â difference?
- DELETE vs TRUNCATE vs DROP?
- What is a view? Can you INSERT through a view?
- What is an index? Disadvantages?
- INNER JOIN vs LEFT JOIN?
- What is a trigger? Types?
- WHERE vs HAVING?
- What are aggregate functions?
- What is a stored procedure?
- Primary key vs unique constraint?
Unit III Viva
- What is normalization? Why needed?
- What is a functional dependency?
- State Armstrong's axioms.
- 1NF conditions?
- Partial dependency â what is it?
- Transitive dependency â what is it?
- Difference between 3NF and BCNF?
- What is a natural join?
- Relational algebra vs relational calculus?
- How to map M:N relationship?
Unit IV Viva
- What is a transaction?
- Explain each ACID property.
- What is a dirty read?
- What is deadlock in DBMS?
- Recovery techniques in DBMS?
- What is a checkpoint?
- Authentication vs Authorization?
- GRANT vs REVOKE?
- What is NoSQL? Types?
- When to use NoSQL over SQL?
ð Flashcards
Click a card to reveal the answer. Great for last-minute revision!
ð¯ MCQ Quiz
Test your knowledge with timed multiple choice questions
Choose Your Quiz
â¡ Quick Revision Notes
Everything important, summarized. Perfect for the night before your exam.