0% found this document useful (0 votes)
9 views22 pages

DBMS Imp question

The document is a question bank for a Database Management System course at Guru Nanak Institute of Technology. It covers various topics including entities, data independence, data models, anomalies, and normalization, providing definitions and examples for each concept. Additionally, it includes questions on E-R diagrams, SQL commands, and database schemas.
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)
9 views22 pages

DBMS Imp question

The document is a question bank for a Database Management System course at Guru Nanak Institute of Technology. It covers various topics including entities, data independence, data models, anomalies, and normalization, providing definitions and examples for each concept. Additionally, it includes questions on E-R diagrams, SQL commands, and database schemas.
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
You are on page 1/ 22

QUESTION BANK

GURU NANAK INSTITUTE OF TECHNOLOGY


An Autonomous Institute under MAKAUT
2024
DATABASE MANAGEMENT SYSTEM
EC605A
QUESTION
NO
Short Answer Type Questions
Differentiate between weak entity and strong entity.
Ans-> An entity is a “thing” or “object” in the real world. An entity contains attributes,
which describe that entity. So anything about which we store information is called an
entity. Entities are recorded in the database and must be distinguishable, i.e., easily
recognized from the group.

Strong Entity Weak Entity

Strong entity always has While a weak entity has a partial


a primary key. discriminator key.

Strong entity is not dependent


Weak entity depends on strong entity.
on any other entity.

Strong entity is represented by Weak entity is represented by a double


a single rectangle. rectangle.
Q.1

Two strong entity’s While the relation between one strong


relationship is represented by and one weak entity is represented by a
a single diamond. double diamond.

Strong entities have either


A weak entity has a total participation
total participation or partial
constraint.
participation.

1
What is data independence?
Ans-> Data independence is a property of a database management system by which we
can change the database schema at one level of the database system without changing
the database schema at the next higher level. Through data independence, we can build
an environment in which data is independent of all programs, and through the three
schema architectures, data independence will be more understandable.
Types of Data Independence
There are two types of data independence.
• logical data independence
• Physical data independence
Q.2

Explain various types of data model.


Ans-> A Data Model in Database Management System (DBMS) is the concept of tools that
are developed to summarize the description of the database. Data Models provide us with
a transparent picture of data which helps to create an actual database. It shows us from
the design of the data to its proper implementation of data.
Types of Data Models
1. Conceptual Data Model
2. Representational Data Model
3. Physical Data Model

Q.3

1. Conceptual Data Model


The conceptual data model describes the database at a very high level and is useful to
understand the needs or requirements of the database. One popular model is
the entity/relationship model (ER model).
Entity-Relationship Model( ER Model): It is a high-level data model which is used to
define the data and the relationships between them. It is basically a conceptual design
of any database which is easy to design the view of data.
Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name, place,
object, class, etc. These are represented by a rectangle in an ER Diagram.
2. Attributes: An attribute can be defined as the description of the entity. These are
represented by Ellipse in an ER Diagram. It can be Age, Roll Number, or Marks for a
Student.
2
3. Relationship: Relationships are used to define relations among different entities.
Diamonds and Rhombus are used to show Relationships.
2. Representational Data Model
This type of data model is used to represent only the logical part of the database and
does not represent the physical structure of the database. The representational data
model allows us to focus primarily, on the design part of the database. A popular
representational model is a Relational model. The relational Model consists
of Relational Algebra and Relational Calculus.
3. Physical Data Model
The physical Data Model is used to practically implement Relational Data Model.
Ultimately, all data in a database is stored physically on a secondary storage device
such as discs and tapes. This is stored in the form of files, records, and certain other
data structures.

What is Multivalued Dependency?


Ans-> When one attribute in a database depends on another attribute and has many
Q.4 independent values, it is said to have multivalued dependency (MVD). It improves
database structure and consistency and is essential for data integrity and database
normalization.
Q.5 Explain Insertion, Deletion, Modification anomalies.
Ans-> In Database Management System (DBMS), anomaly means the inconsistency
occurred in the relational table during the operations performed on the relational table.

For example, if there is a lot of redundant data present in our database then DBMS
anomalies can occur. If a table is constructed in a very poor manner then there is a chance
of database anomaly. Due to database anomalies, the integrity of the database suffers.

The other reason for the database anomalies is that all the data is stored in a single table.
So, to remove the anomalies of the database, normalization is the process which is done
where the splitting of the table and joining of the table occurs.
Example 1:

Updation Anomaly
When we update some rows in the table, and if it leads to the inconsistency of the table
then this anomaly occurs. This type of anomaly is known as an updation anomaly. In the
above table, if we want to update the address of Ramesh then we will have to update all
the rows where Ramesh is present. If during the update we miss any single row, then
there will be two addresses of Ramesh, which will lead to inconsistent and wrong
databases.

3
Insertion Anomaly
If there is a new row inserted in the table and it creates the inconsistency in the table
then it is called the insertion anomaly. For example, if in the above table, we create a new
row of a worker, and if it is not allocated to any department then we cannot insert it in
the table so, it will create an insertion anomaly.
Deletion Anomaly
If we delete some rows from the table and if any other information or data which is
required is also deleted from the database, this is called the deletion anomaly in the
database. For example, in the above table, if we want to delete the department number
ECT669 then the details of Rajesh will also be deleted since Rajesh's details are dependent
on the row of ECT669. So, there will be deletion anomalies in the table.

Q.6 Explain generalization, specialization and aggregation.


Ans-> Extended ER features: generalization, specialization and aggregation.
Generalization: Generalization is the process of extracting common properties from a
set of entities and creating a generalized entity from it. It is a bottom-up approach in
which two or more entities can be generalized to a higher-level entity if they have some
attributes in common.
Specialization: In specialization, an entity is divided into sub-entities based on its
characteristics. It is a top-down approach where the higher-level entity is specialized into
two or more lower-level entities.
Aggregation: An ER diagram is not capable of representing the relationship between an
entity and a relationship which may be required in some scenarios. Aggregation is an
abstraction through which we can represent relationships as higher-level entity sets.

Q.7 Explain the following terms: a) Functional dependency b) Prime and Non-
prime attribute.
Ans-> Functional dependency : The functional dependency is a relationship that exists
between two attributes. It typically exists between the primary key and non-key attribute
within a table. X → Y
Emp_Id → Emp_Name
We can say that Emp_Name is functionally dependent on Emp_Id.

1. Trivial functional dependency


o A → B has trivial functional dependency if B is a subset of A.
o The following dependencies are also trivial like: A → A, B → B
o Example:

4
Here, {roll_no, name} → name is a trivial functional dependency, since the
dependent name is a subset of determinant set {roll_no, name}. Similarly, roll_no
→ roll_no is also an example of trivial functional dependency.
2. Non-trivial functional dependency
o A → B has a non-trivial functional dependency if B is not a subset of A.
o When A intersection B is NULL, then A → B is called as complete non-trivial.
o Example:

Here, roll_no → name is a non-trivial functional dependency, since the


dependent name is not a subset of determinant roll_no. Similarly, {roll_no, name}
→ age is also a non-trivial functional dependency, since age is not a subset of
{roll_no, name}
Prime attribute: A prime attribute is one of the attributes that make up the candidate
key. In addition to being called prime attributes, key attributes is another name for this
type of attribute. It is also present in all of the candidate keys.
Non-prime attributes: Non-prime attributes are those attributes of the relationships that
are not present in any of the possible candidate keys of the relation.

Q.8 Draw an E-R diagram of Railway Reservation system.


Q.9 What is difference between DELETE & TRUNCATE commands?
Ans->
5
Delete Truncate

The DELETE command is used to


While this command is used to
delete specified rows(one or
delete all the rows from a table.
more).

It is a DML(Data Manipulation While it is a DDL(Data Definition


Language) command. Language) command.

There may be a WHERE clause in


While there may not be WHERE
the DELETE command in order to
clause in the TRUNCATE command.
filter the records.

DELETE command is slower than While the TRUNCATE command is


TRUNCATE command. faster than the DELETE command.

To use Truncate on a table we need


To use Delete you need DELETE
at least ALTER permission on the
permission on the table.
table.

The delete can be used with Truncate cannot be used with


indexed views. indexed views.

DELETE statement occupies more Truncate statement occupies less


transaction spaces than Truncate. transaction spaces than DELETE.

Delete operations can be ROLLED TRUNCATE cannot be Rolled back


back. as it causes an implicit commit.

Delete doesn’t DROP the whole TRUNCATE first drops the table &
table. It acquires a lock on table then re-create it, which is faster than
and starts deleting the rows. deleting individual rows.

Q.10 Describe recursive relationship with example.


Ans-> A relationship between two entities of a similar entity type is called
a recursive relationship. Here the same entity type participates more than once in a
relationship type with a different role for each instance. In other words, a relationship has
always been between occurrences in two different entities. However, the same entity can
participate in the relationship. This is termed a recursive relationship.

6
Q.11 Explain cardinality ratio with example.
Ans-> In a database, the mapping cardinality or cardinality ratio means to denote the
number of entities to which another entity can be linked through a certain relation set.
Mapping cardinality is most useful in describing binary relation sets.
Types of cardinality in between tables are:
• One-to-One
• One-to-Many
• Many-to-One
• Many-to-Many
One-to-One
In this type of cardinality mapping, an entity in A is connected to at most one entity in B.
For example, in a particular hospital, the surgeon department has one head of
department. They both serve one-to-one relationships.

One-to-Many
In this type of cardinality mapping, an entity in A is associated with any number of
entities in B.For example, in a particular hospital, the surgeon department has
multiple doctors. They serve one-to-many relationships.

Many-to-One
In this type of cardinality mapping, an entity in A is connected to at most one entity in
B. For example, In a particular hospital, multiple surgeries are done by a single
surgeon. Such a type of relationship is known as a many-to-one relationship.

7
Many-to-Many
In this type of cardinality mapping, an entity in A is associated with any number of entities
in B, and an entity in B is associated with any number of entities in A. For example, In a
particular company, multiple people work on multiple projects. They serve many-to-many
relationships.

Q.12 Define BCNF. Why it is stronger than 3NF.


Ans-> Boyce-Codd Normal Form (BCNF) An advanced version of the third normal form,
which helps eliminate redundancy and anomalies from the Database. When is a relation
in BCNF: the left-hand side is super key this solves potential problems with candidate
keys as well. BCNF is essential for good database schema design in higher-level systems
where consistency and efficiency are important, particularly when there are many
candidate keys.
Rule 1: The table should be in the 3rd Normal Form.
Rule 2: X should be a superkey for every functional dependency (FD) X−>Y in a given
relation.

BCNF (Boyce-Codd Normal Form) is considered stronger than 3NF (Third Normal Form)
because BCNF eliminates more redundancy by enforcing a stricter rule: every functional
dependency in a relation must have a superkey on the left side, whereas 3NF only
requires that non-key attributes be fully dependent on each candidate key, allowing for
potential redundancy in certain scenarios where there are multiple candidate
keys; essentially, every BCNF table is also a 3NF table, but not every 3NF table is BCNF.
Q.13 Explain about Loss less-join dependency?
Ans-> Decomposition of a relation is done when a relation in a relational model is not in
appropriate normal form. Relation R is decomposed into two or more relations if
decomposition is lossless join as well as dependency preserving.
Lossless Join Decomposition
If we decompose a relation R into relations R1 and R2,
Decomposition is lossy if R1 ⋈ R2 ⊃ R
Decomposition is lossless if R1 ⋈ R2 = R
8
To check for lossless join decomposition using the FD set, the following conditions must
hold:
1. The Union of Attributes of R1 and R2 must be equal to the attribute of R. Each attribute
of R must be either in R1 or in R2.
Att(R1) U Att(R2) = Att(R)
2. The intersection of Attributes of R1 and R2 must not be NULL.
Att(R1) ∩ Att(R2) ≠ Φ
3. The common attribute must be a key for at least one relation (R1 or R2)
Att(R1) ∩ Att(R2) -> Att(R1) or Att(R1) ∩ Att(R2) -> Att(R2)
For Example, A relation R (A, B, C, D) with FD set{A->BC} is decomposed into R1(ABC) and
R2(AD) which is a lossless join decomposition as:
1. First condition holds true as Att(R1) U Att(R2) = (ABC) U (AD) = (ABCD) = Att(R).
2. Second condition holds true as Att(R1) ∩ Att(R2) = (ABC) ∩ (AD) ≠ Φ
3. The third condition holds as Att(R1) ∩ Att(R2) = A is a key of R1(ABC) because
A->BC is given.

Q.14 Define Instances and schemas of database?


Ans-> Schema is the overall description of the database. The basic structure of how the
data will be stored in the database is called schema. In DBMS, the term schema refers to
the architecture of the database which describes how it will appear or will be constructed.
It describes the organization of data such as tables, relationships as well as constraints. A
schema is a template that dictates how data items in a database will be stored, arranged,
and accessed.

• Logical Schema – It describes the database designed at a logical level.


• Physical Schema – It describes the database designed at the physical level.
• View Schema – It defines the design of the database at the view level.
Instance: The collection of information stored at a particular moment.
Frequent changes.
Database instant = value of the variable.
An instance of DBMS refers to real data in a database coming at some particular point in
time.
Q.15 Define Armstrong axioms for FD’s?
Ans-> The term Armstrong Axioms refers to the sound and complete set of inference
rules or axioms, introduced by William W. Armstrong, that is used to test the logical
implication of functional dependencies. If F is a set of functional dependencies then the
closure of F, denoted as F+, is the set of all functional dependencies logically implied by F.
Armstrong’s Axioms are a set of rules, that when applied repeatedly, generates a closure
of functional dependencies.
Q.16 What is locking?

9
Ans-> Locking protocols are used in database management systems as a means of
concurrency control. Multiple transactions may request a lock on a data item
simultaneously. Hence, we require a mechanism to manage the locking requests made by
transactions. Such a mechanism is called a Lock Manager. It relies on the process of
message passing where transactions and lock manager exchange messages to handle the
locking and unlocking of data items.
1. Shared lock:
o It is also known as a Read-only lock. In a shared lock, the data item can only read
by the transaction.
o It can be shared between the transactions because when the transaction holds a
lock, then it can't update the data on the data item.
2. Exclusive lock:
o In the exclusive lock, the data item can be both reads as well as written by the
transaction.
o This lock is exclusive, and in this lock, multiple transactions do not modify the
same data simultaneously.

Q.17 What is two phase locking protocol?


Ans-> To guarantee serializability, we must follow some additional protocols concerning
the positioning of locking and unlocking operations in every transaction. This is where the
concept of Two-Phase Locking(2-PL) comes into the picture, 2-PL ensures serializability.
A transaction is said to follow the Two-Phase Locking protocol if Locking and Unlocking
can be done in two phases.
Growing Phase: New locks on data items may be acquired but none can be released.
Shrinking Phase: Existing locks may be released but no new locks can be acquired.
Q.18 Illustrate the properties of transaction.
Ans-> It is a collection of operations that form a single logical unit of work. The transaction
has four properties. These are used to maintain consistency in a database, before and
after the transaction. The various operations that form a transaction typically include
adding some new data, modifying the existing data, accessing existing data or a
combination of these. The ACID properties are as follows:
o Atomicity
o Consistency
o Isolation
o Durability

Atomicity
o ○ The phrase “all or nothing” describes the first ACID property i.e. atomicity.

10
o It states that all operations of the transaction take place at once if not, the
transaction is aborted.
o There is no midway, i.e., the transaction cannot occur partially. Each transaction is
treated as one unit and either run to completion or is not executed at all.
Consistency
o The phrase “no violation of integrity constraints” describes the property of
consistency.
o The integrity constraints are maintained so that the database is consistent before
and after the transaction.
o The consistent property of database states that every transaction sees a consistent
database instance.
o The transaction is used to transform the database from one consistent state to
another consistent state.
For example: The total amount must be maintained before or after the transaction.
o Total before T occurs = 600+300=900
o Total after T occurs= 500+400=900
Isolation
o It shows that the data which is used at the time of execution of a transaction
cannot be used by the second transaction until the first one is completed.
o In isolation, if the transaction T1 is being executed and using the data item X, then
that data item can't be accessed by any other transaction T2 until the transaction
T1 ends.
o The concurrency control subsystem of the DBMS enforced the isolation property.
Durability:
This property ensures that once the transaction has completed execution, the updates
and modifications to the database are stored in and written to disk and they persist even
if a system failure occurs. These updates now become permanent and are stored in non-
volatile memory.

Q.19 Explain deletion and search operation in B+ trees?


Q.22 What is the difference between a shared lock and exclusive lock?

Ans->

Shared Lock Exclusive Lock

Lock mode is read as well as write


Lock mode is read only operation.
operation.

Shared lock can be placed on objects Exclusive lock can only be placed on
that do not have an exclusive lock objects that do not have any other
already placed on them. kind of lock.

Issued when transaction wants to


Issued when transaction wants to
read item that do not have an
update unlocked item.
exclusive lock.

11
Any number of transaction can hold Exclusive lock can be hold by only
shared lock on an item. one transaction.

S-lock is requested using lock-S X-lock is requested using lock-X


instruction. instruction.

Example: Multiple transactions Example: Transaction updating a


reading the same data table row

Q.23 What are the unary operations in Relational Algebra?

Ans-> Relational algebra is a procedural query processing language that provides the base
of relational databases and SQL. Relational algebra has various operators like select,
project, rename, cartesian product, union, intersection, set difference, joins, etc. These
operators are used to form queries in relational algebra.

The operations that operate on only one relation are called unary operations in
relational algebra. The three unary operations in relational algebra are:

• Selection

• Projection

• Rename

Example on Unary Operations in Relational Algebra

Student

Rollno Studentname Marks

1 A 80

2 B 50

3 C 95

4 D 62

5 A 70

12
Q.1: Output all the tuples of the relation.

σ (Student)

Q.2: Retrieve only those tuples where Rollno is greater than 2.

σRollno > 2 (Student)

Q.3: Retrieve only those tuples where either Marks less than 70 or Studentname
is A.

σMarks < 70 ∨ Studentname = A (Student)

Q.4: Retrieve the tuples with Student Name A and Marks greater than 75.

σMarks > 75 ∧ Studentname = A (Student)

Q.5: Output all the values in the column Rollno.

πRollno(Student)

Q.6: Retrieve all the values of columns Rollno and Marks

πRollno, Marks (Student)

Q.7: Retrieve the Rollno of students whose Marks is greater than or equal to 80.

πRollno [σMarks >=80 (Student)]

Q.8: Rename the relation as S and attributes of relation Rollno as r, Studentname


as Sname and Marks as m.

ρ S (r, Sname, m) (Student)

Example 2: Predict the output of given queries. Consider the below relation.

Employee

Eid Ename Salary

201 P 20000

202 Q 5000

13
203 R 10000

204 P 7500

Q.1: Query- σ (Employee)

Output:

Employee

Eid Ename Salary

201 P 20000

202 Q 5000

203 R 10000

204 P 7500

Q.2: σSalary > 7000 ∧ Ename = P (Student)

Output:

Employee

Eid Ename Salary

201 P 20000

204 P 7500

Q.3: πEname(Employee)

Output:

Ename

14
Q

Q.4: ρ E (id, name, S) πEid, Ename, Salary [σSalary > 10000 (Employee)]

Output:

id name S

201 P 20000
Q.24 Define the term data redundancy and data Inconsistency.

Ans-> It is defined as redundancy means duplicate data and it is also stated that the same
parts of data exist in multiple locations in the database. This condition is known as Data
Redundancy.

Problems with Data Redundancy

1. Wasted Storage Space.

2. More Difficult Database Update.

3. It will lead to Data Inconsistency.

4. Retrieval of data is slow and inefficient.

Example –

15
Data Inconsistency: When the same data exists in different formats in multiple tables. This
condition is known as Data Inconsistency. It means that different files contain different
information about a particular object or person. This can cause unreliable and meaningless
information. Data Redundancy leads to Data Inconsistency.

Example –
If we have an address of someone in many tables and when we change it in only one table
and in another table it may not be updated so there is the problem of data inconsistency
may occur.

Q.25 With an example show how a referential integrity can be implemented.


Ans-> A referential integrity constraint is also known as foreign key constraint. A foreign
key is a key whose values are derived from the Primary key of another table.
The table from which the values are derived is known as Master or Referenced Table and
the Table in which values are inserted accordingly is known as Child or Referencing Table,
In other words, we can say that the table containing the foreign key is called the child table,
and the table containing the Primary key/candidate key is called the referenced or parent
table.
Example:
Let’s create two tables:
1. Department (Primary table): Holds department details.
2. Employee (Foreign table): References the department of each employee.
Step 1: Create the Department Table
This table has a primary key DeptID. Data Example:

Step 2: Create the Employee Table


This table has a foreign key DeptID that references the primary key in the Department
table.

16
Valid Reference:
• When inserting into the Employee table, DeptID must exist in the Department table.

Invalid Reference:
• Inserting an Employee with a DeptID not present in the Department table will result
in an error.

QUESTION NO
Long Answer Type Questions
Explain generalization, specialization and aggregation.
Q.1
Describe different states of transaction.
Ans-> In DBMS, a transaction passes through various states such as active, partially
committed, failed, and aborted. Understanding these transaction states is crucial for
database management and ensuring the consistency of data.

Q.2

1. Active State – When the instructions of the transaction are running then the
transaction is in active state. If all the ‘read and write’ operations are performed
without any error then it goes to the “partially committed state”; if any instruction
fails, it goes to the “failed state”.
2. Partially Committed – After completion of all the read and write operation the
changes are made in main memory or local buffer. If the changes are made
permanent on the DataBase then the state will change to “committed state” and in
case of failure it will go to the “failed state”.
3. Failed State – When any instruction of the transaction fails, it goes to the “failed
state” or if failure occurs in making a permanent change of data on Database.
4. Aborted State – After having any type of failure the transaction goes from “failed
state” to “aborted state” and since in previous states, the changes are only made to
local buffer or main memory and hence these changes are deleted or rolled-back.

17
5.Committed State – It is the state when the changes are made permanent on the
Data Base and the transaction is complete and therefore terminated in the
“terminated state”.
6.Terminated State – If there isn’t any roll-back or the transaction comes from the
“committed state”, then the system is consistent and ready for new transaction and
the old transaction is terminated.

What is trivial and transitive functional dependency (FD)?


Ans-> In Trivial Functional Dependency, a dependent is always a subset of the
determinant. i.e. If X → Y and Y is the subset of X, then it is called trivial functional
dependency
Example:
roll_no name age

42 abc 17

43 pqr 18

44 xyz 18

Here, {roll_no, name} → name is a trivial functional dependency, since the


dependent name is a subset of determinant set {roll_no, name}. Similarly, roll_no
→ roll_no is also an example of trivial functional dependency.

Q.3 In transitive functional dependency, dependent is indirectly dependent on


determinant. i.e. If a → b & b → c, then according to axiom of transitivity, a → c. This
is a transitive functional dependency.
For example,
enrol_no name dept building_no

42 abc CO 4

43 pqr EC 2

44 xyz IT 1

45 abc EC 2

Here, enrol_no → dept and dept → building_no. Hence, according to the axiom of
transitivity, enrol_no → building_no is a valid functional dependency. This is an
indirect functional dependency, hence called Transitive functional dependency.

Illustrate 3NF and BCNF.


Ans-> A relation is said to be in Third Normal Form (3NF), if it is in 2NF and there is
Q.4 no transitive dependency. Also, it should satisfy one of the below-given conditions.
For the function dependency C->D:
• C should be a super key
• D should be a prime attribute i.e., D should be a part of the candidate key.

18
BCNF stands for Boyce-Codd normal form and was made by R.F Boyce and E.F Codd
in 1974.A functional dependency is said to be in BCNF if these properties hold:
• It should already be in 3NF.
• For a functional dependency say P->Q, P should be a super key.
Q.6 Consider the relational database as given below and write down
expressions in relational algebra for the following queries.
Data_Master(data_id, item name, reorder level)
Data_Details (data_id, Supplier_id, Purchase_date, Qty, Utcost)
i) Select supplier id where purchase date is 4th December, 2022)
Ans-> π_Supplier_id (σ_Purchase_date='2022-12-04' (Data_Details))
ii) Select the minimum quantity sold.
Ans-> π_Qty ( Data_Details ⨝ ρ_MinQty(Qty) ( σ_Qty = ( SELECT MIN(Qty) FROM
Data_Details ) (Data_Details) ) )
iii) Select name of the item where supplier id is ‘S00001’
Ans-> π_item_name ( (σ_Supplier_id='S00001' (Data_Details)) ⨝ Data_Master )
Q.7 Consider the following two schedules. Check whether both of these schedules are
conflict-serializable or not. Explain.
S1: R1(X) R1(Y) R2(X) R2(Y) W2(Y) W1(X)
S2: R1(X) R2(X) R2(Y) W2(Y) R1(Y) W1(X)
Q.8 Given a set of FDs for the relation schema R (A,B,C,D,E). The FDs are {BC―>D,
AC―>BE, B―>E}. Explain and find out the highest normal form of R.
Q.9 Design a database for a college. Many students seek admission in the college. The
college has a number of departments and students can be enrolled to these
departments. The department also offers a number of courses to the students, each
with a different duration from the other. Each department has its H.O.D and many
teachers under him. The syllabus of each course is also defined. Teachers are
recruited by the college for teaching the said courses to the students. The teachers
may have different qualifications and experience. They may also teach different
subjects if required. Each student in the college has a unique ID. We need to store the
names of the students studying in the college, their residential address, date of birth.
We also need to store information about the college like the name, address, contact
number, reference ID, departments of the college, name of the H.O.D, number of
teachers and students in the department. Also, the courses offered by the
departments, the syllabus, the duration and the course ID. We can also store
information about the teachers like their qualification, experience, name and
subjects taught.
Draw ER Diagram for this case study.
Q.10 Explain three level architecture of DBMS.
• This framework is used to describe the structure of a specific database
system.
• The three schema architecture is also used to separate the user applications
and physical database.
• The three schema architecture contains three-levels. It breaks the database
down into three different categories.

19
Objectives of Three schema Architecture
The main objective of three level architecture is to enable multiple users to access
the same data with a personalized view while storing the underlying data only
once. Thus it separates the user's view from the physical structure of the database.
This separation is desirable for the following reasons:
o Different users need different views of the same data.
o All users should be able to access the same data according to their
requirements.
o Internal structure of the database should be unaffected by changes to
physical aspects of the storage.
1. Internal Level

o The internal level has an internal schema which describes the physical
storage structure of the database.
o The internal schema is also known as a physical schema.
o It uses the physical data model. It is used to define that how the data will be
stored in a block.
o The physical level is used to describe complex low-level data structures in
detail.
2. Conceptual Level

o The conceptual schema describes the design of a database at the conceptual


level. Conceptual level is also known as logical level.
o The conceptual level describes what data are to be stored in the database
and also describes what relationship exists among those data.
o In the conceptual level, internal details such as an implementation of the
data structure are hidden.
o Programmers and database administrators work at this level.
20
3. External Level

o At the external level, a database contains several schemas that sometimes


called as subschema. The subschema is used to describe the different view of
the database.
o An external schema is also known as view schema.
o Each view schema describes the database part that a particular user group is
interested and hides the remaining database from that user group.
o The view schema describes the end user interaction with database systems.

Q.11 Create a B+ tree ( of order-3) with the following keys 8, 5 , 1, 7, 3, 12, 9, 6 And now
delete 12, 5
Q.12 Explain the difference between Primary index & secondary index.

Q.13 What is Blocking factor? What is block anchor?


Ans-> Blocking factor is the number of records that can be stored in a single block (or
page) of memory or disk.
Formula: BF=Block Size / Record Size

Block Size: The total size of the memory block or page.

Record Size: The size of a single record.

Purpose: Determines how efficiently data is packed in blocks, affecting the


performance of retrieval and storage operations.

Example: If the block size is 4 KB (4096 bytes) and each record size is 512
bytes, then: BF=4096 / 512=8 records per block.

Block Anchor: A reference or a pointer to the first record stored in a block. Used to
locate records within a block or page quickly. It helps in efficient block access and
navigation during database operations. Example: In a B-tree, the block anchor helps
identify the range of keys present in that block, enabling faster searching.
Q.14 With proper example explain how recovery in a database system can be done using
LOG files when the following techniques are used
i) Immediate update technique ii) Deferred update technique
Q.15 Explain Entity Relationship Model. What do you mean by serializability of
transactions?
Q.16 Short note : (a) Data Models (b) Foreign key (c) Aggregate functions (d) Ordered
indexing and hashing (e) Wait/Die and Wound/Wait deadlock protocols (f)
Database languages (g) Armstrong’ axioms for FD’s.(h) Inner Join and Outer Join
(i) DBA(j) SQL joins(k) Keys in DBMS (l) Users in DBMS

Q.17 Explain about Selection, Projection, Rename, division and Cartesian product
operations in relational algebra? 7. Discuss about Domain Relational Calculus?
Write and explain a query in DRC to Find the names of sailors who have reserved
boat 103.
Q.18 Determine the closer of the following set of functional dependencies for a relational
scheme R(A,B,C,D) and FDs {AB → C, C → D, D → A}. List out the candidate keys of R.

21
Determine the closer of the following set of functional dependencies for a relational
scheme R(A,B,C,D) and FDs {AB → C, C → D, D → A}. List out the candidate keys of R.
Q.19 Explain about Aggregate operators in sql with examples? 2. Discuss correlated
nested queries? Explain about Selection, Projection, Rename, division and Cartesian
product operations in relational algebra?
Q.20 What is a Phantom deadlock? What is a checkpoint and when does
it occur?
Differentiate between Clustered and non-Clustered indexes.
Ans-> A phantom deadlock is a situation where a deadlock detection algorithm
incorrectly identifies a deadlock in the system, even though no actual deadlock
exists. This leads to unnecessary actions, like rolling back transactions or aborting
processes, which affects system performance.

Example:
1. System State at Time T1:
o Transaction T1 is holding Resource R1 and waiting for R2.
o Transaction T2 is holding Resource R2 and waiting for R1.
→ Looks like a deadlock is forming.
2. State Changes at Time T2:
o Before the deadlock detection algorithm runs, T1 releases R1,
allowing T2 to proceed.
o The system is no longer in a deadlock.
3. Phantom Detection:
o However, the deadlock detection algorithm, running on outdated
data, still assumes the deadlock exists and unnecessarily rolls back
one of the transactions.

Checkpoint: It is a mechanism where all the previous logs are removed from the
system and stored permanently in storage disk.
Types of Checkpoints
1. Automatic Checkpoint
2. Manual Checkpoint
1. Automatic Checkpoint: These checkpoints occur very frequently like every hour
or every day. These intervals are set by the database administrator. They are
generally used by heavy databases as they are frequently updated, and we can
recover the data easily in case of failure.
2. Manual Checkpoint: These are the checkpoints that are manually set by the
database administrator. Manual checkpoints are generally used for smaller
databases. They are updated very less frequently only when they are set by the
database administrator.

22

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy