24MCT13 - DATABASE TECHNOLOGIES
CAT- 2 Question Bank
1. Different types of constraints in SQL.
2. Write SQL to add a CHECK constraint ensuring salary > 10000
3. Write SQL to modify a table and add a new constraint.
4. the role of DEFAULT constraint with example
5. Write SQL to check violations of a foreign key constraint.
6. why some views are not updatable
7. Write a self-join query to display employee-manager pairs
8. Demonstrate the equi-join and non-equi join with examples.
9. Write a subquery in a HAVING clause to find departments whose
average salary exceeds 4000.
10. Differentiate between single-row and multiple-row subqueries.
11. How do subqueries differ from joins? Give an example
12. Write a correlated subquery to find employees earning more than their
department’s average salary.
13. Write a query to find the second-highest salary using a subquery
14. Write a subquery to list employees whose department is located in
‘CHENNAI’.
15. Differentiate between CHAR, VARCHAR, and VARCHAR2.
16. Demonstrate how to revoke privileges from a user.
17. The difference between system and object privileges
18. Identify the difference between procedures and functions
19. What is a functional dependency? Give an example
20. Differentiate between trivial and non-trivial functional
dependencies.
21. Differentiate between full and partial functional dependency.
22. What are anomalies in database design? List types.
[Link] deletion anomaly and give one example.
24. What are the differences between a trigger and a procedure?
25. Differentiate between BEFORE and AFTER triggers.
26. Mention two real-life applications where database triggers are
essential.
27. List the types of parameters used in PL/SQL procedures.
28. Write a simple procedure to display ‘Welcome to PL/SQL
29. What is the role of DBMS_OUTPUT.PUT_LINE in a procedure?
30. What type of anomalies can occur if we store all attributes in the
single Project table?
31. State the decomposition of Project(ProjectID, Manager, Department)
into BCNF relations.
[Link] the relation Project(ProjectID, Manager, Department) with the
functional dependencies
ProjectID → Manager and Manager → Department, identify the
candidate key.
[Link] the following database and identify the normal forms which it
suffers
34. EmpN 36. DeptH
EmpID 35. Department
ame ead
E1 37. Raj 38. HR 39. Nisha
E2 40. Meena 41. IT 42. Ravi
E3 43. Sanjay 44. IT [Link]
34. Consider the relation
Project(ProjectID, Manager, Department) relation is:
In 3NF but
Not in BCNF
Use the functional dependencies to justify your answer.
35. Consider the following table data
ProjectID Manager Department
P1 John IT
P2 Mary HR
P3 John IT
P4 Anita Finance
Identify redundancy in the data and List possible update, insertion, and
deletion anomalies.
36. Consider the following table data and identify the functional dependencies:
StudentID StudentName CourseID CourseName FacultyName
S1 Arjun C101 DBMS Dr. Meena
S2 Priya C102 OS Dr. Nair
S1 Arjun C103 CN Dr. Meena
37. Consider the following table data and identify the current normal form
EmpID EmpName Department DeptHead
E1 Raj HR Nisha
E2 Meena IT Ravi
E3 Sanjay IT Ravi
Big Question
1. Consider the Online Shopping System and perform the following
queries
Tables
CUSTOMER
CUST_ID CUST_NAME CITY
401 RAMESH CHENNAI
402 UMA DELHI
403 SANTHOSH SALEM
404 REKHA COIMBATORE
405 VIJAY CHENNAI
ORDERS
ORDER_ID CUST_ID ITEM AMOUNT ORDER_DATE
1 401 LAPTOP 60000 2025-01-02
2 402 PHONE 30000 2025-02-14
3 403 WATCH 7000 2025-03-18
4 404 TV 45000 2025-04-10
5 405 HEADPHONE 5000 2025-05-11
1. Define constraints between CUSTOMER and ORDERS.
2. Create FUNCTION to calculate total amount spent by each customer.
3. Create PROCEDURE APPLY_DISCOUNT to reduce prices above
₹50,000 by 5%.
4. Write TRIGGER to prevent insertion of order amount < ₹1,000.
5. Grant SELECT privilege to user SHOP_ADMIN.
2. Consider the student Examination System and perform the following
operations
Tables
STUDENT
STUD_ID STUD_NAME COURSE SEM CITY
101 ARUN MCA 1 CHENNAI
102 BALA MCA 2 COIMBATORE
103 DEEPA MBA 1 DELHI
104 KARTHIK BCA 3 SALEM
105 LATHA BBA 2 CHENNAI
MARKS
MARK_ID STUD_ID SUBJECT MARKS EXAM_TYPE
1 101 DBMS 78 INTERNAL
2 102 DBMS 85 INTERNAL
3 103 ACCOUNTS 67 INTERNAL
4 104 C 72 INTERNAL
5 105 ECONOMICS 81 INTERNAL
1. Display student name, course, subject, and marks using INNER JOIN.
2. Create a VIEW named TOPPER_LIST showing students who scored
above 80 marks.
3. Create a PROCEDURE UPDATE_RESULT to change exam type from
‘INTERNAL’ to ‘FINAL’ for a given student.
4. Create a TRIGGER to prevent insertion of marks above 100.
5. Grant SELECT privilege on STUDENT table to user EXAM_ADMIN.
6. Develop a FUNCTION to compute average marks for a specific course.
[Link] the student Examination System and write a subqueries for the
following statement
Tables:
STUDENT(roll_no, name, dept, total_marks)
roll_no name dept total_marks
1 Riya CSE 480
2 Arjun CSE 450
3 Neha ECE 420
4 Kiran IT 400
5 Divya CSE 470
1. Display students scoring above the class average.
2. Find the top scorer in the CSE department.
3. List students who have marks greater than Neha.
4. Display students whose total marks equal the maximum marks of the IT
department.
5. Retrieve names of students in the same department as Divya.
[Link] the Banking System and write a subqueries for the following
statement
ACCOUNT(acc_no, cust_name, balance, branch)
acc_no cust_name balance branch
101 Ravi 55000 Erode
102 Sita 30000 Salem
103 Mani 80000 Erode
104 Devi 25000 Chennai
105 Kumar 70000 Salem
1. Find customers with a balance greater than the average balance.
2. Display customers having the same branch as Kumar.
3. Retrieve customers whose balance is equal to the maximum balance in
Erode.
4. Display customers with a balance higher than Sita’s.
5. Find the second-highest balance.
[Link] the Sales Management System and write a subqueries for the
following statement
SALES(sid, product, qty, price, region)
sid product qty price region
1 Laptop 10 60000 South
2 Mobile 25 25000 North
3 Tablet 15 30000 South
4 Monitor 20 15000 East
5 Keyboard 40 2000 South
1. Find products priced above the average price.
2. Display products sold in the same region as “Laptop”.
3. Retrieve products having quantity greater than the minimum in South.
4. Find products cheaper than “Tablet”.
5. List products whose price is equal to the second-highest price.
[Link] the following table data
ProjectID Manager Department
P1 John IT
P2 Mary HR
P3 John IT
P4 Anita Finance
a)Identify redundancy in the data.
b) List possible update, insertion, and deletion anomalies.
c) Normalize the table step-by-step up to BCNF.
[Link] the relation Project(ProjectID, Manager, Department) with functional
dependencies
F1: ProjectID → Manager
F2: Manager → Department
Perform the following:
a) Identify the candidate keys
b) Identify partial and transitive dependencies
c) Determine the highest normal form satisfied
[Link] the suitable example, demonstrate the relation which suffers the
partial dependency and show the steps to eliminate partial dependency
[Link] respect to the Project (ProjectID, Manager, Department) relation,
describe the difference between 3NF and BCNF using the given functional
dependencies.
Support your answer with a dependency diagram.
[Link] the normalization process for the Project relation up to BCNF with
the given dependencies.
Include examples showing how redundancy and anomalies are removed step
by step.
Note Project Relation (ProjectID, Manager, Department)
[Link] the relation
Product(ProductID, Supplier, SupplierAddress)
Functional Dependencies:
F1: ProductID → Supplier
F2: Supplier → SupplierAddress
a) Find candidate keys.
b) Identify the highest normal form satisfied.
c) Decompose the relation into BCNF and justify each step.
[Link] the relation EMP_PROJ(EmpID, EmpName, ProjID, ProjName,
HoursWorked)
with FDs:
EmpID → EmpName
ProjID → ProjName
Identify partial dependencies and decompose into 2NF.
13. Given the relation BOOK_ORDER(OrderNo, BookID, BookTitle,
SupplierName),
and FDs:
OrderNo, BookID → BookTitle, SupplierName
BookID → BookTitle
Normalize the relation into 2NF.
14. Given COURSE(CourseID, Textbook, ReferenceBook) where each course
has multiple textbooks and reference books independently.
CourseID Textbook ReferenceBook
C1 “Database Systems” “Database Concepts”
C1 “Database Systems” “Normalization Theory”
CourseID Textbook ReferenceBook
C1 “DBMS Essentials” “Database Concepts”
C1 “DBMS Essentials” “Normalization Theory”
Identify multivalued dependencies and normalize to 4NF.
[Link] the table PRODUCT(ProductID, Supplier, Store) with the
following MVDs:
ProductID →→ Supplier
ProductID →→ Store
Check if the relation is in 4NF and decompose if required
ProductID Supplier Store
P1 SupplierA StoreX
P1 SupplierA StoreY
P1 SupplierB StoreX
P1 SupplierB StoreY
P2 SupplierC StoreZ
P2 SupplierC StoreW
P2 SupplierD StoreZ
P2 SupplierD StoreW