0% found this document useful (0 votes)
2 views21 pages

DBMS Question Bank - Unit 2

The document outlines key concepts in database management systems, focusing on functional dependencies, entity-relationship models, normalization, and various types of attributes. It includes definitions, examples, and explanations of important terms such as BCNF, weak entities, and join dependencies. The content is structured into questions and answers, providing a comprehensive overview of essential topics for the academic year 2024-2025.

Uploaded by

Vignes Waran
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)
2 views21 pages

DBMS Question Bank - Unit 2

The document outlines key concepts in database management systems, focusing on functional dependencies, entity-relationship models, normalization, and various types of attributes. It includes definitions, examples, and explanations of important terms such as BCNF, weak entities, and join dependencies. The content is structured into questions and answers, providing a comprehensive overview of essential topics for the academic year 2024-2025.

Uploaded by

Vignes Waran
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/ 21

CS3492 – DATABASE MANAGEMENT SYSTEMS

ACADEMIC YEAR 2024-2025 (EVEN)


Department of Computer Science and Engineering

UNIT-II

PART-A

1. What is functional dependency? Give example. (CO2) (APR/MAY 2023, NOV/DEC 2023)
Functional dependency is a relationship that exists when one attribute uniquely determines
another attribute. It R is a relation with attributes X and Y, a functional dependency between the
attributes is represented as X->Y, which specifies Y is functionally dependent on X. Functional
Dependency (FD) is a set of constraints between two attributes in a relation.

2. Explain entity relationship model? (CO2) (APR/MAY, 2016)


ER model defines the mapping between the entities in the database. ER model is a graphical
representation of real world objects with their attributes and relationship. It makes the system easily
understandable. This model is considered as a top down approach for designing a requirement.

3. Why BCNF is preferred over 3NF? (CO2) (APR/MAY, 2024)


A relation schema R is in BCNF with respect to a set F of functional dependencies if, for all
functional dependencies in F. BCNF is preferred than 3NF because each and every BCNF is relation to
3NF but every 3NF is not relation to BCNF.

4. Define Entity, Relationship and attributes in ER model. (CO2) (APR/MAY, 2024)


An entity can have one or more attributes, which are properties or characteristics that describe
the entity. For example, a customer can have attributes such as name, email, and address. A relationship
is a connection or association between two or more entities that expresses how they interact or depend
on each other.

5. What is a derived attribute? Give example. (CO2) (APR/MAY, 2023)


Derived attributes are the attributes that can be derived from the other attribute. These attributes
are not present in the database physically but they can be derived from the other attributes easily.
Derived attributes are calculated on runtime, so it can be also said that their values vary in nature.

SRMMCET / CSE / QUESTION BANK 1


CS3492 – DATABASE MANAGEMENT SYSTEMS

Example
 Let's take an example of a student entity only. Let's assume it has attributes such as roll number,
name, and DOB as shown in the figure.
 If we take another attribute which is age, we can derive it from the DOB attribute. Age need not
be present in the database. Derived attributes are represented with the dotted ellipse as shown in
the figure.

Fig. 2.1 Example for Derived Attribute

6. Define denormalization. (CO2) (APR/MAY, 2019)


Denormalization is a database optimization technique in which we add redundant data to one or
more tables. This can help us avoid costly joins in a relational database. It is an optimization technique
that is applied after normalization.

7. Give the properties of decomposition. (CO2) (APR/MAY, 2019, NOV/DEC 2023)


Lossless join and dependency preserving are the two desirable properties of decomposition.
i. Lossless join decomposition property:
Let R be the relational schema with instance r is decomposed into R1,R2,….,Rn with instance
r1,r2,…..,rn.
If r1 ⋈ r2 ⋈ ……. ⋈ rn = r , then it is called Lossless Join Decomposition. i.e. if natural joins of
all the decompositions gives the original relation, then it is said to be Lossless Join Decomposition.

ii. Dependency preserving Property:


If the original table is decomposed into multiple fragments, then somehow, we suppose to get all
original FDs from these fragments. In other words, every dependency in original table must be
preserved or say, every dependency must be satisfied by at least one decomposed table.

8. What is the significance of “participation role name” in the description of relationship types?
(CO2) (NOV/DEC 2019)
The Participation role is the part that every entity participates in a relationship. This role is
important to use role name in the depiction of relationship type when the similar entity type participates
more than once in a relationship type in various roles. The role names are necessary in recursive
relationships.

SRMMCET / CSE / QUESTION BANK 2


CS3492 – DATABASE MANAGEMENT SYSTEMS

9. What is a weak entity? Give example. (CO2) (APR/MAY, 2018)


A weak entity is an entity that cannot be uniquely identified by its attributes alone. The entity set
which does not have sufficient attributes to form a primary key is called as weak entity set. Weak
entities are represented with double rectangular box in the ER Diagram and the identifying
relationships are represented with double diamond.
Example:

Fig. 2.2 Weak Entity

In this ER Diagram, ‘Payment’ is the weak entity.

10. What are the problems caused by redundancy? (CO2) (APR/MAY, 2018)
Problems caused by Redundancy: Following problems can be caused by
redundancy
i) Redundant Storage: Some information is stored repeatedly.
ii) Update Anomalies: If one copy of such repeated data is updated then
inconsistency is created unless all other copies are similarly updated.
iii) Insertion Anomalies: Due to insertion of new record repeated information get
added to the relation schema.
iv) Deletion Anomalies: Due to deletion of particular record some other important
information associated with the deleted record get deleted and thus we may lose
Isbom some other important information from the schema.

11. State the types of attributes in ER Model. (CO2) (APR/MAY, 2022)


In a Database Management System (DBMS), an attribute is a property or characteristic of an
entity that is used to describe an entity.
Types of Attributes
There are different types of attributes as discussed below:
i. Simple Attribute
ii. Composite Attribute

SRMMCET / CSE / QUESTION BANK 3


CS3492 – DATABASE MANAGEMENT SYSTEMS

iii. Single-Valued Attribute


iv. Multi-Valued Attribute
v. Derived Attribute
vi. Complex Attribute
vii. Stored Attribute
viii. Key Attribute
ix. Null Attribute
x. Descriptive Attribute

12. Define join dependencies. (CO2) (APR/MAY, 2022)


Join Dependency (JD) can be illustrated as when the relation R is equal to the join of the sub-
relations R1, R2,..., and Rn are present in the database. Join Dependency arises when the attributes
in one relation are dependent on attributes in another relation, which means certain rows will exist
in the table if there is the same row in another table. Multiple tables are joined to create a single
table where one of the attributes is common in the sub-tables. We can also relate the join
dependency to the 5th Normal Form. A join dependency is said to be not that important if any
relational schemas in the join dependency are equivalent to the original relation R.
Join dependency on a database is denoted by:
R1 ⨝ R2 ⨝ R3 ⨝ ..... ⨝ Rn ;
where R1 , R2, ... , Rn are the relations and ⨝ represents the natural join operator.

13. Differentiate Loss less join decomposition and Lossy Join decomposition.
(CO2) (NOV/DEC, 2019)
Lossless Join Dependency Lossy Join Dependency
It means that whenever the join : In this type of join dependency, data
occurs between the tables, then no loss may occur at some point in time
information should be lost, the new which includes the absence of a tuple
table must have all the content in the from the original table or duplicate
original table. tuples within the database.

14. What is meant by normalization of data? (CO2) (NOV/DEC 2023)


Normalization is the process of reducing data redundancy in a table and improving data integrity.
Data normalization is a technique used in databases to organize data efficiently. Data normalization
ensures that your data remains clean, consistent, and error-free by breaking it into smaller tables and
linking them through relationships. This process reduces redundancy, improves data integrity, and
optimizes database performance.

SRMMCET / CSE / QUESTION BANK 4


CS3492 – DATABASE MANAGEMENT SYSTEMS

15. Why certain functional dependencies are called trivial functional dependencies?
(CO2) (NOV/DEC 2014)
A functional dependency FD: XY is called trivial if Y is a subset of X. This kind of dependency
is called trivial because it can be derived from common sense. If one "side" is a subset of the other, it's
considered trivial. The left side is considered the determinant and the right the dependent.

For example - {A, B}  B is a trivial functional dependency because B is a subset of A,B. Since
(A, B) -> B includes B, the value of B can be determined. It's a trivial functional dependency because
determining B is satisfied by its relationship to A, B.

16. What is multivalued dependency? (CO2) (NOV/DEC 2015)


A table is said to have multi-valued dependency, if the following conditions are true
a. For a dependency A → B, if for a single value of A, multiple values of B exists, then the
table may have multi-values dependency.
b. Also, a table should have at-least 3 columns for it to have a multi-valued dependency.
c. And, for a relation R (A, B, C), if there is a multi-valued dependency between, A and B,
then B and C should be independent of each other.

17. Give an example of a relation schema R and set of dependencies such that R is in BCNF but
not in 4NF. (CO2) (APR/MAY 2017)
Consider relation R (A, B, C, D) with dependencies
AB→C
ABC→D
AC→B
Here the only key is AB. Thus each functional dependency has super key on the left. But MVD
has non-super key on its left. So it is not 4NF.

18. Give an example for a weak and a strong entity. (CO2) (APR/MAY 2024)
Strong Entity: A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not
depend on other Entity in the Schema. It has a primary key that helps in identifying it uniquely and it is
represented by a rectangle. These are called Strong Entity Types.
Example:
Strong entity set always has a primary key. It does not have enough attributes to build a primary
key. It is represented by a rectangle symbol.

SRMMCET / CSE / QUESTION BANK 5


CS3492 – DATABASE MANAGEMENT SYSTEMS

Weak Entity: An Entity type has a key attribute that uniquely identifies each entity in the entity
set. But some entity type exists for which key attributes can’t be defined. These are called Weak Entity
types.
Example:
A bank account cannot be uniquely identified without knowing the bank to which the account
belongs, so bank account is a weak entity.

19. Draw the symbols used in an entity relationship diagram for repersenting an entity set, weak
entity set, attributes and multivalued attribute. (CO2) (NOV/DEC 2021)
Attributes are the properties that define the entity type. For example, Roll_No, Name, DOB,
Age, Address, and Mobile_No are the attributes that define entity type Student.
In ER diagram,
 Entity set is represented by rectangle

 Weak entity set is represented by,

 Attribute is represented by is represented by an oval

 and multivalued attribute is represented by is represented by a double oval

20. For a binary relationship set R between entity sets A and B, list the mapping cardinalities.
(CO2) (NOV/DEC, 2021)
For a binary relationship set R between entity sets A and B, the Mapping Cardinality is ONE TO
ONE if an entity in A is associated with at most one entity in B, and an entity in B is associated with at
most one entity in A

SRMMCET / CSE / QUESTION BANK 6


CS3492 – DATABASE MANAGEMENT SYSTEMS

PART-B

1. Briefly discuss about functional dependency Concepts.


(CO2) (APR/MAY 2019, APR/MAY 2024)
Functional Dependencies
Functional dependency (FD) is a constraint between two sets of attributes from the database.
 A functional dependency is a property of the semantics or meaning of the attributes. In every
relation R(A1, A2,…, An) there is a FD called the PK -> A1, A2, …, An Formally the FD is
defined as follows
 If X and Y are two sets of attributes, that are subsets of T
For any two tuples t1 and t2 in r , if t1[X]=t2[X], we must also have t1[Y]=t2[Y].
Notation:
 If the values of Y are determined by the values of X, then it is denoted by X -> Y
 Given the value of one attribute, we can determine the value of another attribute X f.d. Y or
X -> y
Example: Consider the following,
Student Number -> Address, Faculty Number -> Department,
Department Code -> Head of Dept
Functional dependencies allow us to express constraints that cannot be expressed using super
keys.
Consider the schema:
Loan-info-schema = (customer-name, loan-number, branch-name, amount).
We expect this set of functional dependencies to hold:
loan-number amount
loan-number branch-name
but would not expect the following to hold:
loan-number customer-name

Use of Functional Dependencies


We use functional dependencies to:
 Test relations to see if they are legal under a given set of functional dependencies.
 If a relation r is legal under a set F of functional dependencies, we say that r satisfies F.
 Specify constraints on the set of legal relations
 We say that F holds on R if all legal relations on R satisfy the set of functional dependencies F.

SRMMCET / CSE / QUESTION BANK 7


CS3492 – DATABASE MANAGEMENT SYSTEMS

Example - Employee
SSN Name JobType DeptName
557-78-6587 Lance Smith Accountant Salary
214-45-2398 Lance Smith Engineer Product

Name is functionally dependent on SSN because an employee‘s name can be uniquely determined
from their SSN. Name does not determine SSN, because more than one employee can have the same
name.
Keys
 Whereas a key is a set of attributes that uniquely identifies an entire tuple, a functional dependency
allows us to express constraints that uniquely identify the values of certain attributes.
 However, a candidate key is always a determinant, but a determinant doesn‘t need to be a key.
Axioms
Before we can determine the closure of the relation, Student, we need a set of rules.
i. Reflexivity Rule
ii. Augmentation Rule
iii. Transitivity Rule
iv. Union Rule
v. Decomposition Rule
vi. Pseudo transitivity Rule

2. Elaborate on first normal form, second normal form and third normal form with examples.
(CO2) (APR/MAY, 2023)
Normalization of Database Database
Normalisation is a technique of organizing the data in the database. Normalization is a systematic
approach of decomposing tables to eliminate data redundancy and undesirable characteristics like
Insertion, Update and Deletion Anamolies. It is a multi-step process that puts data into tabular form by
removing duplicated data from the relation tables.

First Normal Form (1NF)


As per First Normal Form, no two Rows of data must contain repeating group of information i.e
each set of column must have a unique value, such that multiple columns cannot be used to fetch the
same row. Each table should be organized into rows, and each row should have a primary key that
distinguishes it as unique.

SRMMCET / CSE / QUESTION BANK 8


CS3492 – DATABASE MANAGEMENT SYSTEMS

The Primary key is usually a single column, but sometimes more than one column can be
combined to create a single primary key. For example consider a table which is not in First normal form.
Example: - Student Table :

Student Age Age Subject


Adam 15 Biology, Maths
Alex 14 Maths
Stuart 17 Maths

In First Normal Form, any row must not have a column in which more than one value is saved,
like separated with commas. Rather than that, we must separate such data into multiple rows.
Student Table following 1NF will be:

Student Age Age Subject


Adam 15 Biology
Adam 15 Maths
Alex 14 Maths
Stuart 17 Maths

Using the First Normal Form, data redundancy increases, as there will be many columns with
same data in multiple rows but each row as a whole will be unique.

Second Normal Form (2NF)


As per the Second Normal Form there must not be any partial dependency of any column on
primary key. It means that for a table that has concatenated primary key, each column in the table that is
not part of the primary key must depend upon the entire concatenated key for its existence. If any
column depends only on one part of the concatenated key, then the table fails Second normal form.

In example of First Normal Form there are two rows for Adam, to include multiple subjects that
he has opted for. While this is searchable, and follows First normal form, it is an inefficient use of space.
Also in the above Table in First Normal Form, while the candidate key is {Student, Subject}, Age of
Student only depends on Student column, which is incorrect as per Second Normal Form. To achieve
second normal form, it would be helpful to split out the subjects into an independent table, and match
them up using the student names as foreign keys.
New Student Table following 2NF will be:
Student Age Age
Adam 15
Alex 14
Stuart 17

SRMMCET / CSE / QUESTION BANK 9


CS3492 – DATABASE MANAGEMENT SYSTEMS

In Student Table the candidate key will be Student column, because all other column i.e Age is
dependent on it.
New Subject Table introduced for 2NF will be:
Student Age Subject
Adam Biology

Adam Maths
Alex Maths
Stuart Maths
In Subject Table the candidate key will be {Student, Subject} column. Now, both the above
tables qualify for Second Normal Form and will never suffer from Update Anomalies. Although there
are a few complex cases in which table in Second Normal Form suffers Update Anomalies, and to
handle those scenarios Third Normal Form is there.

Third Normal Form (3NF)


Third Normal form applies that every non-prime attribute of table must be dependent on primary key, or
we can say that, there should not be the case that a non-prime attribute is determined by another non-
prime attribute. So this transitive functional dependency should be removed from the table and also the
table must be in Second Normal form. For example, consider a table with following fields.

Student_Detail Table:

Student_id Student_name DOB Street city State Zip

In this table Student_id is Primary key, but street, city and state depends upon Zip. The
dependency between zip and other fields is called transitive dependency. Hence to apply 3NF, we need
to move the street, city and state to new table, with Zip as primary key.
New Student_Detail Table:
Student_id Student_name DOB Zip

Address Table:
Street city State Zip

The advantage of removing transitive dependency is,


 Amount of data duplication is reduced.
 Data integrity achieved.

SRMMCET / CSE / QUESTION BANK 10


CS3492 – DATABASE MANAGEMENT SYSTEMS

3. Explain with suitable example, the constraints of specialization and generalization in ER data
modeling. (CO2) (NOV/DEC 2019)
The ER Model has the power of expressing database entities in a conceptual hierarchical manner.
As the hierarchy goes up, it generalizes the view of entities, and as we go deep in the hierarchy, it gives
us the detail of every entity included.

Going up in this structure is called generalization, where entities are clubbed together to
represent a more generalized view. For example, a particular student named Mira can be generalized
along with all the students. The entity shall be a student, and further, the student is a person. The reverse
is called specialization where a person is a student, and that student is Mira.

Generalization:
As mentioned above, the process of generalizing entities, where the generalized entities contain
the properties of all the generalized entities is called generalization. In generalization, a number of
entities are brought together into one generalized entity based on their similar characteristics. For
example, pigeon, house sparrow, crow and dove can all be generalized as Birds.

Fig. 2.3 Generalization


Specialization:
Specialization is the opposite of generalization. In specialization, a group of entities is divided
into subgroups based on their characteristics. Take a group ‘Person’ for example. A person has name,
date of birth, gender, etc. These properties are common in all persons, human beings. But in a company,
persons can be identified as employee, employer, customer, or vendor, based on what role they play in
the company.

Fig. 2.4 Specialization

SRMMCET / CSE / QUESTION BANK 11


CS3492 – DATABASE MANAGEMENT SYSTEMS

Similarly, in a school database, persons can be specialized as teacher, student, or a staff, based
on what role they play in school as entities.
Inheritance :
We use all the above features of ER-Model in order to create classes of objects in object-oriented
programming. The details of entities are generally hidden from the user; this process known as
abstraction. Inheritance is an important feature of Generalization and Specialization. It allows lower-
level entities to inherit the attributes of higher-level entities.

Fig. 2.5 Inheritance

For example, the attributes of a Person class such as name, age, and gender can be inherited by
lower-level entities such as Student or Teacher.

4. Explain Boyce Codd normal form, fourth normal form and fifth normal form with examples.
(CO2) (APR/MAY, 2023)
Boyce and Codd Normal Form is a higher version of the Third Normal form. This form deals
with certain type of anomaly that is not handled by 3NF. A 3NF table which does not have multiple
overlapping candidate keys is said to be in BCNF. For a table to be in BCNF, following conditions must
be satisfied:
 R must be in 3rd Normal Form and, for each functional dependency ( X -> Y ), X should be a
super Key.
Consider the following relationship: R(A , B, C, D) and following dependencies:
ABCD
BC AD
DB
This relationship is already in 3rd Normal form. Keys are A and BC.
Hence, in the functional dependency, ABCD, A is the super key.
In second relation, BCAD, BC is also a key, but in, DB, D is not a key.

SRMMCET / CSE / QUESTION BANK 12


CS3492 – DATABASE MANAGEMENT SYSTEMS

Hence we can break our relationship R into two relationships R1 and R2.
A(A, B, C, D)

R1(A, D, C) R2(D,B)
Breaking table into two tables, one with A,D and C while the other with D and B.
Fourth Normal Form(4NF):
 It should meet all the requirement of 3NF
 Attribute of one or more rows in the table should not result in more than one rows of the same
table leading to multi-valued dependencies
To understand it clearly, consider a table with Subject, Lecturer who teaches each subject and
recommended Books for each subject.
COURSE
SUBJECT
LECTURER
BOOKS

SUBJECT LECTURER BOOKS


Maths Alex Maths Book 1
Maths Boscoo Maths Book 2
Physics Rose Physics Book
Chemistry Adam Chemistry Book

If we observe the data in the table above it satisfies 3NF. But LECTURER and BOOKS are two
independent entities here. There is no relationship between Lecturer and Books. In the above example,
either Alex or Bosco can teach Maths. For Maths subject , student can refer either 'Maths Book1' or
'Maths Book2'.
That is,
SUBJECT --> LECTURER
SUBJECT-->BOOKS
This is a multivalued dependency on SUBJECT. If we need to select both lecturer and books
recommended for any of the subject, it will show up (lecturer, books) combination, which implies lecturer
who recommends which book. This is not correct.
SELECT c.LECTURER, c.BOOKS FROM COURSE c WHERE SUBJECT = 'Maths';
To eliminate this dependency, we divide the table into two as below
COURSE_LECTURER COURSE_BOOKS
SUBJECT SUBJECT
LECTURER BOOKS

SRMMCET / CSE / QUESTION BANK 13


CS3492 – DATABASE MANAGEMENT SYSTEMS

4NF
SUBJECT LECTURER SUBJECT BOOKS
Maths Alex Maths Maths Book 1
Maths Boscoo Maths Maths Book 2
Physics Rose Physics Physics Book
Chemistry Adam Chemistry Chemistry Book
Now if we want to know the lecturer names and books recommended for any of the subject, we
will fire two independent queries. Hence it removes the multi-valued dependency and confusion around
the data. Thus the table is in 4NF.

Fifth Normal Form (5NF):


A database is said to be in 5NF, if and only if,
 It's in 4NF
 If we can decompose table further to eliminate redundancy and anomaly, and when we rejoin the
decomposed tables by means of candidate keys, we should not be losing the original data or any
new record set should not arise. In simple words, joining two or more decomposed table should
not lose records nor create new records.
Consider an example of different Subjects taught by different lecturers and the lecturers taking classes for
different semesters.

COURSE
SUBJECT
LECTURER
CLASS

SUBJECT LECTURER CLASS


Maths Alex SEMESTER 1
Maths Boscoo SEMESTER 1
Physics Rose SEMESTER 1
Chemistry Adam SEMESTER 1

In above table, Rose takes both Mathematics and Physics class for Semester 1, but she does not
take Physics class for Semester 2. In this case, combination of all these 3 fields is required to identify a
valid data. Imagine we want to add a new class - Semester3 but do not know which Subject and who will
be taking that subject. We would be simply inserting a new entry with Class as Semester3 and leaving
Lecturer and subject as NULL. As we discussed above, it's not a good to have such entries. Moreover, all
the three columns together act as a primary key, we cannot leave other two columns blank.

Hence we have to decompose the table in such a way that it satisfies all the rules till 4NF and
when join them by using keys, it should yield correct record. Here, we can represent each lecturer's

SRMMCET / CSE / QUESTION BANK 14


CS3492 – DATABASE MANAGEMENT SYSTEMS

Subject area and their classes in a better way. We can divide above table into three - (SUBJECT,
LECTURER), (LECTURER, CLASS), (SUBJECT, CLASS)
5NF
SUBJECT LECTURER CLASS LECTURER CLASS SUBJECT
Maths Alex SEMESTER 1 Alex SEMESTER 1 Maths
Maths Boscoo SEMESTER 1 Boscoo SEMESTER 1 Maths
Physics Rose SEMESTER 1 Rose SEMESTER 1 Physics
Chemistry Adam SEMESTER 1 Adam SEMESTER 1 Chemistry

Now, each of combinations is in three different tables. If we need to identify who is teaching
which subject to which semester, we need join the keys of each table and get the result.

5. Construct an E-R diagram for a car-insurance company whose customers own one or more
cars each. Each car has associated with it zero to any number of recorded accidents. Each
insurance policy covers one or more cars, and has one or more premium payments associated
with it. Each payment is for a particular period of time, and has an associated due date, and
the date when the payment was received. (CO2) (APR/MAY 2022, NOV/DEC 2023)

Entity Relationship Diagram – An Entity–relationship model (ER model) describes the structure of
a database with the help of a diagram, which is known as Entity Relationship Diagram. An ER
model is a design or blueprint of a database that can later be implemented as a database.

The ER diagram for the given example

Fig. 2.6 E-R Diagram for a Car-Insurance Company

SRMMCET / CSE / QUESTION BANK 15


CS3492 – DATABASE MANAGEMENT SYSTEMS

6. Consider the following relational schemes for a library database:


(CO2) (APR/MAY, 2024)
Book (Title, Author, Catalog_no, Publisher, Year, Price)
Collection (Title, Author, Catalog_no)
The following are functional dependencies:
(i) Title Author  Catalog_no
(ii) Catalog_no  Title Author Publisher Year
(iii) Publisher Title Year  Price
(iv) Assume {Author Title} is the key for both schemes. Apply the appropriate normal
form for Book and Cancellation?
Relation schema
Relation schema defines the design and structure of the relation or table in the database. It is the
way of representation of relation states in such a way that every relation database state fulfills the
integrity constraints set (Like Primary key, Foreign Key, Not null, Unique constraints) on a relational
schema.

Functional dependency
Functional dependency is a relationship that exists when one attribute uniquely determines
another attribute. It R is a relation with attributes X and Y, a functional dependency between the
attributes is represented as X->Y, which specifies Y is functionally dependent on X. Functional
Dependency (FD) is a set of constraints between two attributes in a relation.

Answer for the given example


Book (Title, Author, Catalog_no, Publisher, Year, Price)
Collection (Title, Author, Catalog_no) with in the following functional dependencies:
I. Title, Author  Catalog_no
II. Catalog_no  Title, Author, Publisher, Year
III. Publisher, Title, Year  Price Assume {Author, Title} is the key for both schemes The table
“Collection” is in BCNF as there is only one functional dependency “Title Author –>
Catalog_no” and {Author, Title} is key for collection.

Book is not in BCNF because Catalog_no is not a key and there is a functional dependency
“Catalog_no –> Title Author Publisher Year”.

Book is not in 3NF because non-prime attributes (Publisher Year) are transitively dependent on
key [Title, Author]. Book is in 2NF because every non-prime attribute of the table is either dependent
on the whole of a candidate key [Title, Author], or on another non prime attribute.

SRMMCET / CSE / QUESTION BANK 16


CS3492 – DATABASE MANAGEMENT SYSTEMS

In table book, candidate keys are {Title, Author} and {Catalog_no}.


In table Book, non-prime attributes (attributes that do not occur in any candidate key) are Publisher,
Year and Prince

7. A university registrar’s office maintains data about the following entities: (i) courses,
including number, title, credits, syllabus, and prerequisites; (ii) course offerings, including
course number, year, semester, section number, instructor(s), timings, and classroom; (iii)
students, including student-id, name, and program; and (iv)instructors, including
identification number, name, department, and title. Further, the enrollment of students in
courses and grades awarded to students in each course they are enrolled for must be
appropriately modeled. Construct an E-R diagram for the registrar’s office. Document all
assumptions that you make about the mapping constraints.
(CO2) (NOV/DEC 2021, APR/MAY, 2023)

Fig. 2.7 E-R Diagram for university registrar’s office maintains

8. Consider the following case study describing the academic functioning of a college.
 A college has many departments.
 A department would have many students as well as employs many faculty members
 A student can register into various courses; similarly a course can be registered by
many students
 A student lives in a single hostel but a hostel accommodates many students

SRMMCET / CSE / QUESTION BANK 17


CS3492 – DATABASE MANAGEMENT SYSTEMS

 A department offers many courses but a particular course is offered by a particular


department
 A faculty teaches many courses. A course is taught by many faculties.
Model a E-R diagram for the above scenario. (CO2) (APR/MAY, 2019)

Fig. 2.8 E-R Diagram for academic functioning of a college

9. i). Give suitable example for multivalued dependencies and Join dependencies.
(CO2) (NOV/DEC 2022)
Multivalued dependency
Multivalued dependency occurs when two attributes in a table are independent of each other but,
both depend on a third attribute. A multivalued dependency consists of at least two attributes that are
dependent on a third attribute that's why it always requires at least three attributes. Mutiivalued
dependencies are consequences of 1NF which did not allow an attribute in a tuple to have a set of
values. In a relation, the functional dependency A -> B relates a value of A to a value of B while
multivalued dependency represented A -> B represents a relationship that defines a relationship in
which attribute B are determined by a single value of A. The multivalued dependency is the result of
1NF that prohibits an attribute from having a set of values.

SRMMCET / CSE / QUESTION BANK 18


CS3492 – DATABASE MANAGEMENT SYSTEMS

Example: Suppose there is a bike manufacturer company which produces two colors(white and
black) of each model every year.
BIKE_MODEL MANUF_YEAR COLOR
M2011 2008 White
M2001 2008 Black
M3001 2013 White
M3001 2013 Black
M4006 2017 White
M4006 2017 Black

Here columns COLOR and MANUF_YEAR are dependent on BIKE_MODEL and independent
of each other. In this case, these two columns can be called as multivalued dependent on
BIKE_MODEL. The representation of these dependencies is shown below:
BIKE_MODEL → → MANUF_YEAR
BIKE_MODEL → → COLOR

Multivalued Dependency consists of the following properties:


i. For a relation to maintain multivalued dependency, it must have atleast three attributes.
Since Multivalued Dependency always occurs in pairs i.e. A->->C also holds in a relation
R (A, B, C).
ii. The attributes giving rise to the multivalued facts must be independent of each other.
iii. Functional dependency is a special case of multivalued dependency. If we restrict the set
determined by multivalued dependency to a single set then multivalued dependency
reduces to a functional dependency.

Join Dependency
Join decomposition is a further generalization of Multivalued dependencies. If the join of R1 and
R2 over C is equal to relation R, then we can say that a join dependency (JD) exists, where R1 and R2
are the decompositions R1(A, B, C) and R2(C, D) of a given relations R (A, B, C, D).
Alternatively, R1 and R2 are a lossless decomposition of R.
A JD ⋈ {R1, R2,..., Rn} is said to hold over a relation R if R1, R2,....., Rn is a lossless-join
decomposition.
The *(A, B, C, D), (C, D) will be a JD of R if the join of join's attribute is equal to the relation R.
Here, *(R1, R2, R3) is used to indicate that relation R1, R2, R3 and so on are a JD of R.

SRMMCET / CSE / QUESTION BANK 19


CS3492 – DATABASE MANAGEMENT SYSTEMS

ii). Compare and contrast 1NF, 2NF and 3NF with suitable example. (CO2) (NOV/DEC 2022)

Difference of 1NF, 2NF and 3NF

1NF 2NF 3NF

In order to be in 3NF
In order to be in 1NF any In order to be there should be no
relation must be atomic and in 2NF any relation transitive dependency
should not contain any must be in 1NF and that is no non-prime
composite or multi-valued should not contain any attribute should be
attributes. partial dependency. transitively dependent
on the candidate key.

The identification of The identification of In 3NF the functional


functional dependency is not functional dependency dependencies are
necessary for first normal is necessary for second already in 1NF and
form. normal form. 2NF.

The main goal of first normal The main goal of The goal of the third
form is to eliminate the second normal form is normal form is to
redundant data within the to actually ensure the ensure referential
table. data dependencies. integrity.

The second normal 3NF is considered as a


The first normal form is less
form is comparatively stronger normal form
strong than the second normal
stronger than first than the 1NF and 2NF.
form.
normal form.

SRMMCET / CSE / QUESTION BANK 20


CS3492 – DATABASE MANAGEMENT SYSTEMS

10. (i). Construct an E-R diagram for a hospital with a set of patients and a set of medical
doctors, Associate with each patient a log of the various tests and examinations conducted.
(CO2) (APR/MAY, 2024)
Answer:

Fig. 2.9 E-R Diagram for Hospital Management

(ii) Draw an ER diagram for the airport database. Be sure to indicate the various attribute of
each entity and relationship set; also specify the key and participation constraints for each
relationship set. Specify any necessary overlap and covering constraints as well.
(CO2) (APR/MAY, 2024)
Answer:

Fig. 2.9 E-R Diagram for airport database

SRMMCET / CSE / QUESTION BANK 21

You might also like