0% found this document useful (0 votes)
17 views5 pages

DBMS Sample Questions

The document outlines various concepts in database management systems, including DDL, DML, DCL, and TCL, as well as the creation of E-R diagrams for different systems. It discusses functional dependencies, normalization, relational algebra operations, and the significance of keys and indexes. Additionally, it covers the roles of database users, administrators, and integrity constraints, along with practical SQL examples and exercises related to relational algebra.

Uploaded by

memer28082003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

DBMS Sample Questions

The document outlines various concepts in database management systems, including DDL, DML, DCL, and TCL, as well as the creation of E-R diagrams for different systems. It discusses functional dependencies, normalization, relational algebra operations, and the significance of keys and indexes. Additionally, it covers the roles of database users, administrators, and integrity constraints, along with practical SQL examples and exercises related to relational algebra.

Uploaded by

memer28082003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1. Discuss the significance of DDL,DML,DCL,TCL in database management systems.

2. Explain how to create an E-R diagram for a Library Management System/Booking


System/Hospital Management identifying entities and relationships.
3. Define and differentiate between the types of functional dependencies in the context of
normalization.
4. How does the intersection operation in relational algebra work? Provide an example to
illustrate.
5. Explain the purpose and benefits of using stored procedures in a database.
6. Discuss the impact of using indexes on query performance, providing examples to support
your points.
7. Describe the different types of relationships (one-to-one, one-to-many, many-to-many) in an
E-R diagram.
8. What are composite keys, and how are they different from primary keys? Provide an
example.
9. Discuss the different types of anomalies that can occur during database design and how
normalization helps.
10. Describe the role of Data Models in a DBMS.
11. Identify and explain the different types of Database Users and their access levels. Provide
examples of each.
12. Explain the role of a Database Administrator (DBA) in maintaining data integrity and security.
13. How do keys (primary, foreign, and candidate) impact database relationships and integrity?
Illustrate with examples.
14. Define and distinguish between weak and strong entity sets with examples of where each
would be used.
15. Discuss Extended E-R features like Aggregation and Generalization, and provide scenarios
where they are useful.
16. Describe the purpose of Nested Subqueries in SQL and demonstrate with an example of
filtering data.
17. What is the purpose of Referential Integrity Constraints in SQL? Illustrate with a use case.
18. Write an SQL query using GROUP BY and HAVING clauses to filter and summarize sales data
in a hypothetical table.
19. Explain how Functional Dependency influences database normalization. Provide an example
demonstrating this impact.
20. What is Decomposition in database normalization, and how does it address anomalies?
Illustrate with an example.
21. Describe the purpose of 5NF in relational database design and provide an example to clarify
its application.
22. Describe 1NF to 5NF with suitable examples.
23. Advantage of DBMS over File System.
24. Explain 3 Schema Architecture with suitable example.
25. Discuss levels of data abstraction.
26. Discuss integrity constraints.
27. Discuss super,primary,candidate,foreign, composite and unique key with examples.
28. Differentiate 3NF and BCNF with examples.
29. Dsicuss ACID property. Explain Transaction states.
30. What is serialization. Different types of serialization with examples.
31. Differentiate two phase locking vs strict two phase locking.
32. What are different types of indexes? Explain each type briefly.
What is hashing? Discuss its merits and demerits in database management.
33. Consider the following schema: Student (sid: Integer, Firstname: string, lastname: string, age:
Integer). How can logical operators be used in SQL queries to filter data? Provide examples
a) Create the following table: EMP(empno, deptno, ename, salary, Designation, joiningdate,
DOB, city).
i) Insert one row into the table.
ii) Save the data.
34. iii) Insert a second row into the table.
35. What are the different types of anomalies that can occur in database design? Explain each
briefly.
36. Relational algebra expression with its type and relational calculus expression
37. Short Notes:
a. Concurrency Control
b. Single Level Index
c. Join Algorithm
d. Triggers
e. Mapping Constraints
f. Placing Records on Disk and its impact on query performance
g. Secondary Indexes
h. Cost-Based Optimization in query processing
i. ACID properties in Transaction Processing
j. Single-Level vs. Multi-Level Indexes in File Organization
k. Dense and sparse index
l. Hashing technique
m. B tree and B+ tree
n. Clustering technique
o. Query optimization
p. Functional dependency and its types
q. View
r. Stored procedure and stored functions
s. Joining types

2) Relational algebra – solved exercise


3) Question:
4) Consider the following relational database schema
consisting of the four relation schemas:
5) passenger ( pid, pname, pgender, pcity)
6) agency ( aid, aname, acity)
7) flight (fid, fdate, time, src, dest)
8) booking (pid, aid, fid, fdate)
9) Answer the following questions using relational
algebra queries;
10)
11) Solution:
Relational algebra operators:
σ – selection with conditions (It selects all tuples that satisfies
the conditions. Shows entire table with respect to the
structure)
Π – projection operator (It selects the attributes which are
listed here)
⨝ - natural join operator (Binary operator that join two
relations on common attributes’ values)
-, ∪, and ∩ - set operators (difference, union and intersection)

12)
13) Most of the following queries can be written in
many different ways.
14)
15) a) Get the complete details of all flights to New
Delhi.
16) σ destination = “New Delhi” (flight)
17) --------------------------------------------------------------------------
---------------------------
18)
19) b) Get the details about all flights from Chennai
to New Delhi.
20) σ src = “Chennai” ^ dest = “New Delhi” (flight)
21) ---------------------------------------------------------------------------
--------------------------
22)
23) c) Find only the flight numbers for passenger
with pid 123 for flights to Chennai before

Π fid (σ pid = 123 (booking) ⨝ σ dest = “Chennai” ^


06/11/2020.
24)

fdate < 06/11/2020 (flight))


25)
26)[Hint: Given conditions are pid, dest, and
fdate. To get the flight id for a passenger
given a pid, we have two tables flight and
booking to be joined with necessary
conditions. From the result, the flight id can be
projected]
27) --------------------------------------------------------------------------
---------------------------
28)
29) d) Find the passenger names for passengers

Π pname (passenger ⨝ booking)


who have bookings on at least one flight.
30)
31) --------------------------------------------------------------------------
---------------------------
32)
33) e) Find the passenger names for those who do
not have any bookings in any flights.

Π pid (booking)) ⨝ passenger)


34) Π pname ((Π pid (passenger) -

35)
36) [Hint: here applied a set difference
operation. The set difference operation returns
only pids that have no booking. The result is
joined with passenger table to get the
passenger names.]
37) ---------------------------------------------------------------------------
--------------------------
38)
39) f) Find the agency names for agencies that
located in the same city as passenger with

Π aname (agency ⨝ acity = pcity (σ pid =


passenger id 123.
40)

123 (passenger)))
41)
42)[Hint: we performed a theta join on equality
conditions (equi join) here. This is done
between details of passenger 123 and the
agency table to get the valid records where the
city values are same. From the results, aname
is projected.]
43) --------------------------------------------------------------------------
---------------------------
44)
45) g) Get the details of flights that are scheduled
on both dates 01/12/2020 and 02/12/2020 at
16:00 hours.
(σ fdate = 01/12/2020 ^ time =
46)

16:00 (flight)) ∩ (σ fdate = 02/12/2020 ^ time =

16:00 (flight))
47) [Hint: the requirement is for flight details for
both dates in common. Hence, set intersection
is used between the temporary relations
generated from application of various
conditions.]
48) ---------------------------------------------------------------------------
--------------------------
49)
50) h) Get the details of flights that are scheduled
on either of the dates 01/12/2020 or
02/12/2020 or both at 16:00 hours.

16:00 (flight)) ∪ (σ fdate = 02/12/2020 ^ time =


(σ fdate = 01/12/2020 ^ time =
51)

16:00 (flight))
52) --------------------------------------------------------------------------
---------------------------
53)
54) i) Find the agency names for agencies who do
not have any bookings for passenger with id

Π aname (agency ⨝ (Π aid (agency) –


123.
55)

Π aid (σ pid = 123 (booking)))


56) ---------------------------------------------------------------------------
--------------------------
57)
j) Find the details of all male passengers who
are associated with Jet agency.

‘Jet’ (passengers ⨝ booking ⨝ agency))


58) Π passengers.pid, pname, pcity (σ pgender = “Male” ^ aname =

You might also like