0% found this document useful (0 votes)
56 views7 pages

Database Systems Question Bank Guide

The document is a question bank for a Database Systems course, divided into multiple modules covering various topics such as data models, database management systems, normalization, indexing, and concurrency control. Each module contains specific questions that require comparisons, explanations, and practical applications related to database concepts. The questions also include design tasks and theoretical discussions relevant to real-world scenarios.

Uploaded by

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

Database Systems Question Bank Guide

The document is a question bank for a Database Systems course, divided into multiple modules covering various topics such as data models, database management systems, normalization, indexing, and concurrency control. Each module contains specific questions that require comparisons, explanations, and practical applications related to database concepts. The questions also include design tasks and theoretical discussions relevant to real-world scenarios.

Uploaded by

k.mala31169
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BCSE302L – DATABASE SYSTEMS QUESTION BANK

MODULE -1

1. Compare and contrast the hierarchical, network, and relational data models.
Which model is most suitable for modern applications and why?
2. Traditional file systems were widely used before DBMS became popular.
Compare both approaches and explain how the key characteristics of DBMS.
3. Differentiate between a database schema and an instance with suitable
examples. Explain how schema remains constant while instances change over
time. Illustrate your answer with a real-world application - a university or
banking system.
4. Identify and explain the main actors involved in a Database Management
System (DBMS). Describe the roles and responsibilities of each actor with
suitable examples from real-world application - online banking.
5. Explain the three-schema architecture of a DBMS with the help of a neat
diagram. How does this architecture support data abstraction and
independence? Justify your answer with real-world examples for each level.
6. What is Client-Server Architecture in DBMS? Draw a simple diagram to show
how it works. Explain how this architecture helps in handling multiple users,
improves security, and gives better performance.
MODULE -2

1. A university library wants to develop a database system to manage its book


collection, memberships, and borrowing activities. The system should track
information about books (titles, authors, publishers, etc.), students (IDs, names,
majors, etc.), and faculty members (IDs, names, departments, etc.). It also
needs to record borrowing transactions, including the borrower (student or
faculty ID), borrowed book ID, and borrowing date. Design an ER model and
map it into relational data model for this library management system
considering entities, attributes and their relationships that are needed in the
database.
2. Answer the following with the help of the ER diagram.

I. Find the minimum number of tables required.


II. Represent all the tables with their Primary keys, Attributes and Relationships
type.
III. What does ‘N’ and ‘R2’ represent?
IV. Can I have a valid DBMS without ‘N’ entity? Justify.
V. Identify the derived key in the given diagram, if any.

3. Consider the following ER diagram and translate into a relational schema with all
individual tables.

4. A university maintains the following two tables in its database:

StudentID Name Email DepartmentID


101 Riya riya@[Link] D01
102 Arjun arjun@[Link] D02
DepartmentID DepartmentName HOD
D01 Computer Science Dr. Mehta
D02 Electronics Dr. Sharma

Based on the above scenario, answer the following:

1. Identify the Primary Key in both tables.


2. List all possible Candidate Keys in the STUDENT table.
3. Identify the Foreign Key and explain its role.
4. State any two Integrity Constraints that are applicable in this scenario.
5. What will happen if a student is added with a DepartmentID that does not exist
in the DEPARTMENT table? Justify your answer based on referential integrity.

5. A company maintains two tables: EMPLOYEE(EmpID, Name, DeptID) and


DEPARTMENT(DeptID, DeptName). Explain how you would apply Primary Key and
Foreign Key constraints in these tables. What happens if a new employee is added
with a non-existent DeptID?

6. Explain different types of integrity constraints in DBMS. For each of the following,
provide an example:
a) Entity Integrity
b) Referential Integrity
c) Domain Constraint
Why are these constraints important in maintaining consistency?

MODULE -3
1.
I. Give an example of a table which is not in First Normal Form. Your table must
be formed from a student’s database with attributes sid, sname, sex, major,
gpa, activity and fee.

II. Give an example of a table which in First Normal Form but not in Second
Normal Form. Use the same student’s database. Provide your own keys and
constraints. Convert your table into Second normal form relations.

III. Give an example scenario in which this student database is in Second Normal
form but not in Third normal form. Convert your table into third normal form
relations. Provide the keys and constraints used by you.

IV. Give an instance of student’s database which is in Third Normal Form but not
in Boyce Codd normal form.

V. What is the need for higher normal forms namely Fourth normal form, fifth
normal form and Domain/Key normal form. Which is the highest normal form
and why?

2. Consider the relation REFRIG( Model#, Year, Price, Manufacturing-plant, Colour),


which is abbreviated as REFRIG(M, Y, P, Mp, C) , and with the following set F of
functional dependencies:

F = { M→Mp, MY→P, Mp→C}


(i) Evaluate each of the following as a candidate key for REFRIG, giving reasons
why it can or cannot be a key: M, MY, MC.
(ii) Based on the above key determination, state whether the relation REFRIG is in
3NF and provide proper reasons.
(iii) Based on the above key determination, state whether the relation REFRIG is in
BC/NF and provide proper reasons.
(iv) Consider the decomposition of REFRIG into D = (R1(M, Y, P) and R2(M, Mp, C).
Is this decomposition loseless? Show why.
(v) Check whether the decomposition is dependency preserving.

3. Consider the relation R= (ABCDEFG) with the functional dependencies namely F=


{AB → CD, AF → D, DE → F, C → G, F → E and G → A}. The values of R are atomic.

(i) Find the candidate keys of R.

(ii) Apply the closure computation algorithm and find the closure of F.

(iii) Apply attribute closure algorithm and find the minimal cover of F.

(iv) Check whether the given R is in 1NF? If not convert it into 1 NF relations.
Also check whether the given R is in 2NF? If not convert it into 2 NF
relations.

(v) Check whether the given R is in 3 NF? If not convert it into 3 NF relations.
Also check whether R is in BC/NF. If not, convert R into BC/NF relations.

4. Consider the universal relation R (A, B, C, D, E, F, G, H, I, J).

The set of functional Dependencies are FD = { AB → C, A → DE, B→F,


F→GH, D→IJ }.

(i) What is the key for R?


(ii) Check whether it is in 2NF. If not, convert it into 2NF relations.
(iii) Check whether it is in 3NF. If not, convert it into 3NF relations
(iv) Find the closure of the set FD.
(v) Find the closure of the attribute A.

Module -4
1. Create a B+-tree with five pointers and four key values by using the
following data.
8, 15, 11, 17, 13, 65, 29, 22, 16, 12, 29, 35, 38, 21, 9, 44, 5, 76, 81, 92 and
126.
(i). Show the tree after creating the tree with the values 8, 15,11 and 17
(ii). Show the insert operations for other values one by one.
(iii). Search for the value 65.
(iv) Delete the values of 15, 22, and 29.
(v). Update the value 17 with 60.
2. Consider the following tables
Instructor(ID, name, dept_name, salary)
teaches(ID, course_id, sec_id, semester, year)
course(course_id, title, dept_name, credits)
student(sid, sname, major, sex, gpa)
enrollmen(sid, course_id, gpa)
(i). Write the relational algebra expression for finding the names of all
instructors working in the Computer Science department, along with the
titles of the courses that they teach and the department offering the course.
(ii). Draw the Query tree for Question(i) and optimize the query.
(iii). Write the relational algebra and relational calculus expressions for
finding the names of students who have registered for a course under any
of the instructors in the CSE department who have taught a course in 2023
Fall Semester, along with the titles of the courses that they taught.
(iv). Draw the Query tree for Question (iii) and optimize the query.

3. A hospital maintains thousands of digital patient records that include


medical history, prescriptions, and diagnostic reports. These records are
accessed frequently by doctors and nurses, particularly in emergency
situations. Currently, the hospital uses sequential file organization, which
results in slow retrieval of specific records. To improve efficiency, the
hospital is considering the use of indexing and hashing techniques.
(i). Explain how indexing can be utilized to efficiently retrieve patient
records based on attributes such as patient ID, name, or date of visit.
(ii). Describe how hashing can provide direct access to patient records, and
discuss the importance of hash functions in this process.
(iii). Compare the performance of indexing and hashing in the context of
this hospital system.

4. You are given the following Schemas:


Suppliers (Supplier-Number, Supplier-Name, Status, City)
Parts (Part-Name, Colour, Weight, City)
Shipments(Supplier-Number, Part-Number, Quantity)
Customers(Cust-no, Cust-name, City, Supplier-Number, Part-name)
Write the relational algebra and relational calculus expressions for all the
queries given below. Draw the query trees and perform the query
optimization for the following queries through tree operations. Write the
optimized SQL Queries by deriving them from the final query trees.
Explain the Query optimization techniques used in each of these queries.

(i). Get Supplier Numbers for Suppliers who supply at least one of the parts
supplied by supplier S2.
(ii). Get all pairs of supplier numbers such that the suppliers concerned are
located in the same city and supplied more than a quantity of 500 in any
one of the transactions.
(iii). Get supplier names for suppliers who either do not supply part P2 or
supplied red parts to Mumbai customers.
(iv). Get supplier numbers and names for suppliers with a status lower than
that of supplier S1 and supplied parts Chennai customers.
(v). Get supplier numbers for suppliers who are supplying at least one part
that is supplied by any other supplier who supplies red parts to Bangalore
customers.

5. Create a B-tree with three pointers and two key values by using the
following data.
18, 15, 11, 17, 13, 112, 19 and 16.
(i). Show the tree after creating the tree with the values 18, 15 and 11
(ii). Show the insert operations for other values one by one.
(iii). Search for the value 112.
(iv) Delete the value 13.
(v). Update the value 11 with 50.
MODULE -5

1. Break down the role of each ACID property and analyze the consequences of
their violation.
2. Justify the need for serializability in concurrent transaction processing with real-
life consequences of ignoring it.
3. Illustrate log-based recovery using undo and redo operations for a system crash
situation.
4. Analyze the differences between recoverable, cascadeless, and strict
schedules using appropriate examples.
5. Differentiate between shadow paging and log-based recovery protocols and
identify scenarios best suited for each.
6. Recommend a suitable recovery strategy for a distributed database system
based on the nature of updates and failures.
7. Design a transaction schedule that is recoverable but not cascadeless, and
explain the implications.
8. Assess the pros and cons of using immediate update recovery methods in
mission-critical systems.

MODULE -6

1. Implement a concurrency control mechanism using time-stamp ordering


protocol for two conflicting transactions.
2. Illustrate the Thomas Write Rule with a practical example and show how it
differs from basic time-stamp protocol.
3. Analyze the difference between lock-based and timestamp-based concurrency
control techniques.
4. Compare the working of two-phase locking protocol with the tree protocol in
terms of transaction safety and performance.
5. Assess the trade-offs between pessimistic and optimistic concurrency control
methods.
6. Devise your own deadlock prevention strategy using ordering of resource
allocation and explain how it works.
7. Create a complete locking protocol that includes lock conversion, compatibility
checks, and deadlock avoidance.
8. Critically evaluate how multi-granularity locking can help optimize database
performance.
MODULE -7

1. Explain how the CAP theorem influences the design of distributed NoSQL
systems.
2. Compare the features of Document databases and Graph databases with real-
world use cases.
3. Write short notes on:
a) Column-family databases
b) Key-value stores
4. Explain the different types of NoSQL databases in detail. Highlight their data
models, use cases, and examples.
5. Discuss in detail how NoSQL databases support Big Data analytics and give
examples from industry (e.g., e-commerce, IoT, finance).
6. Compare RDBMS and NoSQL databases in terms of schema design, query
languages, scalability, and consistency.

Common questions

Powered by AI

In relational databases, a primary key uniquely identifies each row within a table, ensuring entity integrity by preventing duplicate entries . A foreign key establishes relationships between tables by referencing a primary key in another table, enforcing referential integrity by ensuring that relationships between tables are consistent . For example, in a university database, the StudentID as a primary key in the Student table identifies each student uniquely. A Foreign Key in an Enrolment table referencing StudentID ensures courses are only associated with existent students, maintaining relational consistency .

The three-schema architecture in DBMS consists of the internal level (physical storage), conceptual level (logical structure), and external level (user views). The internal level deals with data storage formats, providing efficiency in storage and retrieval operations . The conceptual level offers a unified view of the entire database structure, independent of physical storage specifics, supporting logical data independence . Finally, the external level provides user-specific views of the database, ensuring external data independence by separating user interactions from logical structures. For example, in an online banking application, users only see a view of their accounts and transactions, while the conceptual and internal details remain abstracted .

Indexing improves data retrieval efficiency by creating an ordered data structure that provides quick lookup capabilities, such as B-trees or hash indexes, allowing fast search access by patient ID or name . Hashing, on the other hand, provides direct access by computing a hash function on key fields, retrieving records in constant time, which is optimal for unique identifier retrieval. However, indexing generally excels when queries are complex and involve range searches, whereas hashing may result in more collisions, especially when the data volume is unpredictable . In a hospital system, while hashing could speed up accesses by patient IDs, indexing might be preferable for more complex queries involving multiple attributes such as the date of visit .

Lock-based concurrency control involves acquiring locks on data to coordinate access, offering solutions like two-phase locking to prevent deadlock by ensuring specific order of operations . While effective, it may lead to performance bottlenecks due to locking overhead and potential deadlocks. Timestamp-based protocols assign timestamps to transactions to determine operation order, thus ensuring fewer delays as no locks are held . While timestamp methods can reduce blockages for read transactions, they may lead to higher roll-back rates if conflicting writes emerge. Each method's suitability depends on the system needs regarding throughput versus response time .

NoSQL databases support Big Data analytics by providing scalable, flexible data models capable of handling large volumes of diverse data types unstructured or semi-structured . Column-family stores like HBase allow storage of vast datasets with sparse, unpredictable schemas, ideal for real-time analytics in finance where transaction data grows rapidly. Document databases like MongoDB are advantageous in e-commerce by handling diverse product descriptions efficiently. Wide-scale data ingestion and high write/read throughput of NoSQL suits Internet of Things (IoT) scenarios where sensor data must be processed continuously and efficiently .

Violating ACID properties—Atomicity, Consistency, Isolation, Durability—leads to transaction failures, inconsistent database states, data anomalies, and potential data loss . Serializability, an Isolation facet, assures that transaction outcomes are consistent with transactions running sequentially, crucial for data accuracy during concurrent executions. Ignoring it leads to unpredictable transaction results, risking business logic failures in systems like financial applications where order of transactions matters .

The hierarchical data model is organized in a tree-like structure with a single root, making it suitable for systems where relationships are one-to-many . The network model allows more complex many-to-many relationships through a graph structure, providing more flexibility than the hierarchical model but can be complex to manage . The relational model employs tables (relations) to represent data and relationships, offering simplicity and powerful query capabilities via SQL, making it the most suitable for modern applications due to its flexibility, simplicity, and support for ACID properties .

Traditional file systems generally focus on basic storage and retrieval operations without support for advanced querying, concurrency control or data integrity enforcement . DBMS, however, offer structured storage with query capabilities, support for concurrent access, robust data integrity through constraints, and improved security features. These characteristics allow DBMS to handle large volumes of data efficiently with ACID compliance, ensuring data is reliable and accessible even in multi-user environments .

The CAP theorem states that a distributed system can offer only two of three properties at any time: Consistency, Availability, and Partition Tolerance . NoSQL systems must balance these properties based on specific use cases. For instance, a system prioritizing Consistency and Partition Tolerance may temporarily restrict Availability, seen in banking systems ensuring transactional integrity. Conversely, systems like Cassandra prioritize Availability and Partition Tolerance, tolerating temporary Consistency issues to maintain service during network splits, suitable for real-time analytic applications . Developers face trade-offs in deciding which configuration aligns with their application needs given network reliability and user interaction scope .

Normalization is the process of structuring a relational database to reduce redundancy and improve data integrity. BCNF, a form beyond Third Normal Form (3NF), addresses anomalies not handled by 3NF by ensuring every determinant is a candidate key . This process involves identifying functional dependencies and ensuring attributes are only dependent on candidate keys . By applying BCNF, the database is protected from delete, update, and insert anomalies, essential for maintaining consistent and reliable data structures. For instance, in a university database, ensuring student courses are determined only through valid course IDs and student IDs avoids data duplication across records .

You might also like