DBMS
DBMS
Section A
Example:
Entity: Student
Attributes: Student_ID, Name, Date_of_Birth, Address.
3|Page
Section B
Diagram:
8. What is normalization?
Steps:
Section C
Requirements:
Diagram:
1. DDL Commands:
2. DML Commands:
Functions:
Section A
Example:
If A→BA \to BA→B, then the value of AAA uniquely determines BBB.
In a Student table, Roll_No→NameRoll\_No \to
NameRoll_No→Name, meaning the roll number uniquely identifies the
student's name.
Example:
A hash function H(k)=kmod 10H(k) = k \mod 10H(k)=kmod10 maps
keys to a table of size 10.
10 | P a g e
Section B
Diagram:
11 | P a g e
Benefits:
1. It is in 2NF.
2. It has no transitive dependency.
Example:
Section C
Given Tables:
SQL Queries:
sql
Copy code
SELECT NAME, YEAR(CURDATE()) - YEAR(DOB) AS AGE
FROM Employee
WHERE GENDER = 'male';
sql
Copy code
SELECT NAME
FROM Employee
WHERE GENDER = 'female'
ORDER BY SALARY DESC
LIMIT 1;
sql
Copy code
SELECT DNAME
FROM Dept
WHERE DNUMBER = (SELECT DNUMBER FROM Employee WHERE NAME =
'xyz');
sql
Copy code
SELECT *
FROM Employee
GROUP BY ADDRESS(CITY)
HAVING COUNT(*) > 1;
sql
Copy code
SELECT NAME, MIN(DOB)
FROM Employee
WHERE ENO IN (SELECT MEMPNO FROM Dept);
Entities:
Diagram:
16 | P a g e
Diagram:
17 | P a g e
18 | P a g e
Section A
Example:
If DNUMBERDNUMBERDNUMBER in the Employee table
references DNUMBERDNUMBERDNUMBER in the Department
table, any value in Employee.DNUMBER must exist in
Department.DNUMBER.
Section B
Example:
If Relation RRR is split into R1R1R1 and R2R2R2, joining R1R1R1 and
R2R2R2 must yield RRR.
Section C
Transaction States:
Diagram:
11. What are schedules? What are the differences between conflict
serializability and view serializability?
Advantages: