0% found this document useful (0 votes)
156 views18 pages

Unit 2 - Question Bank

The document outlines a question bank for a database management systems course. It includes 26 multiple choice questions related to converting ER diagrams to relational tables, relational algebra, relational calculus, and other database design topics. The questions aim to assess students' understanding of key database concepts and principles.

Uploaded by

mbisen5422
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)
156 views18 pages

Unit 2 - Question Bank

The document outlines a question bank for a database management systems course. It includes 26 multiple choice questions related to converting ER diagrams to relational tables, relational algebra, relational calculus, and other database design topics. The questions aim to assess students' understanding of key database concepts and principles.

Uploaded by

mbisen5422
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/ 18

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Ramapuram, Bharathi Salai, Ramapuram, Chennai - 600089

FACULTY OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

UNIT-II QUESTIONBANK

Degree & Branch : B.TECH- CSE


Semester & Year : IV/II
Sub Code & Subject Name : 21CSC205P- Database Management Systems
Regulation : 2021
Academic Year : 2023-2024
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
Ramapuram, Bharathi Salai, Ramapuram, Chennai-600089
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

UNIT-2
QUESTION BANK

Subject Code/Subject Name: 21CSC205P- Database Management Systems


SEM/YEAR: IV/II
Course Outcome:
CLO-2: Acquire knowledge on Relational languages and design a database

Conversion of ER model to Relational Table Case study: Apply conversion concept.


Discussion of various design issues. Pitfalls in Relational Database system
Understanding various Relational languages such as Tuple Relational calculus,
Understanding various Relational languages such as Tuple Relational calculus,
Domain relational calculus, Calculus Vs Algebra, Computational capabilities,
Case Study: Applying Relational Algebra for all the queries of application Designed.
Case Study: Applying Relational Algebra for all the queries of application Designed.

Course Competence
Q.No. Questions Outcome BT Level
How many rules are there for reducing the ER Diagram into a
table?

1 a) 3 CO2 BT1
b) 4
c) 5
d) 6
What are some important points to convert ER Diagrams into
tables?

a) Tables are created from entity types.


2 CO2 BT1
b) Whenever an attribute is single-valued, it becomes a column
for the table.
c) Primary keys represent key attributes of entity types.
d) All of the above
An Edge between a entity set and a binary relationship set can
have an associated minimum and maximum cardinality, shown in
the form of l and h, where l is the minimum and h is the maximum
cardinality. What a minimum Cardinality value of 1 indicates?
3 CO2 BT1
a) Partial Participation of the entity set in the relationship
b) Total Participation of the entity set in the relationship
c) The entity participates in at most one relationship
d) No limit on participation
In an E-R, B is the dominant entity and A is a subordinate entity.
Select which one is incorrect?

4 (A). An A existence is dependent on B CO2 BT1


(B). operationally, if A is deleted, B remains the same
(C). operationally, if A is deleted, so is B
(D). operationally, If B is deleted, so is
In designing a database using the E-R model, the first step is to

A) Identify entity sets


5 CO2 BT1
B) Identify roles
C) Identify relationships
D) Identify domain
Attributes are descriptive properties possessed by each member of
an

6 A) Entity CO2 BT1


B) Entity set
C) Logical set
D) Physical set
At the logical-design phase, the high-level conceptual schema is
mapped onto the implementation

7 A) Data model CO2 BT1


B) Data model
C) Data requirements
D) Data specifications
The type of constraint that relates to more than one lower-level
entity set within a single generalization, is said to be

8 A) System-defined CO2 BT1


B) Condition-defined
C) Data-defined
D) User-defined
The physical features of a database are specified at the phase

A) Contextual-design phase
9 CO2 BT1
B) Virtual-design phase
C) Physical-design phase
D) Logical-design phase
Suppose now that R(A,B:) and S(A,B:) are two relations with r
and s tuples, respectively (again, not necessarily distinct). If m is
the number of (not necessarily distinct) tuples in the result of the
SQL query: R intersect S; Then which of the following is the most
restrictive, correct condition on the value of m?
10 CO2 BT1
A. m = min(r,s)
B. 0 <= m <= r + s
C. min(r,s) <= m <= max(r,s)
D. 0 <= m <= min(r,s)
What action does ⋈ operator perform in relational algebra?

A.Output specified attributes from all rows of the input relation


and remove duplicate tuples from the output
11 B.Outputs pairs of rows from the two input relations that have the CO2 BT1
same value on all attributes that have the same name
C.Output all pairs of rows from the two input relations (regardless of
whether or not they have the same values on common attributes)
D.Return rows of the input relation that satisfy the predicate
Statement 1: A tuple is a row in a relation Statement 2: Existence
of multiple foreign keys in a same relation is possible

12 A. Both the statements are true CO2 BT1


B. Statement 1 is correct but Statement 2 is false
C. Statement 1 is false but Statement 2 is correct
D. Both the statements are false
Which of the following has each related entity set has its own
schema and there is an additional schema for the relationship set?

13 A. A many-to-many relationship set CO2 BT1


B. A multivalued attribute of an entity set
C. A one-to-many relationship set
D. None of the mentioned
In unary relational operations, the SELECT operation is partition
of relation usually classified as

14 A) horizontal partition CO2 BT1


B) vertical partition
C) insert partition
D) delete partition
The operators in SELECT operation statement such as 'and' , 'or'
and 'not' are classified as

15 A) Boolean operators CO2 BT1


B) tuple operators
C) string operators
D) insertion operators
If in the JOIN operation, the conditions of JOIN operation are not
satisfied then the results of the operation is

16 A) zero tuples and empty relation CO2 BT1


B) one tuple from one relation
C) zero tuples from two relation
D) two tuples from empty relations
A __________expression forms a new relation after applying a
number of algebraic operators to an existing set of relations

A. relational expression BT1


17 CO2
B. relational algebra
C. relational calculus
D. relational query

__________ is used to change the values of some attributes in


existing tuples.

A. Update CO2 BT1


18
B. Drop
C. Truncate
D. Select

Which can be violated if a key value in the new tuple t already


exists in another tuple in the relation r(R).

A. Domain constraints
19 CO2 BT1
B. Key constraints
C. Integrity constraints
D. Rule constraints

The relational algebra is a __________ Query language.

A. Structured
20 B. Logical CO2 BT1
C. Procedural
D. Relational
The relational calculus is considered to be __________________.

A. a nonprocedural language
21 B. a procedural language CO2 BT1
C. a structured language
D. a unstructured language

Which of the following can be violated by delete operation?

A. primary key
22 CO2 BT1
B. referential integrity
C. alternate key
D. super key
Relationship can be created between

A. two tables only


23 CO2 BT1
B. one table only
C. two or more tables
D. none of the above
The value of the atom which evaluates either condition is TRUE or
FALSE for particular combination of tuples is classified as

A. Intersection Value
24 CO2 BT1
B. Union Value
C. Deny Value
D. Truth Value

_____________can be violated if the value of any foreign key in t


refers to a tuple that does not exist in the referenced relation.

A. Super Key
25 CO2 BT1
B. Referential integrity
C. Primary Key
D. Candidate Key

The relational calculus is important for two reasons. Which of the


following is true?

A. It has a firm basis in mathematical logic and the SQL for


RDBMSs has some of its foundations in the tuple relational
26 calculus. CO2 BT1
B. It is in relational algebra and the values of some attributes are
in existing tuples.
C. It is a tuple relational calculus expression and It satisfy
Functional dependency.
D. None of the above
Which of the following are the fundamental operations in the
Relational Algebra?

27 A. Select and Project CO2 BT2


B. Project and Cartesian product
C. Union and set Difference
D. All of the Above
____________ can be violated if an attribute value is given that
does not appear in the corresponding domain.

28 A. Domain constraints CO2 BT1


B. Referential integrity constraints
C. Key constraints
D. Check constraints

A tuple relational calculus expression may generate a/an

A. Finite Relation
29 B. Infinite Relation CO2 BT1
C. Invalid Relation
D. Composite Relation

Because of the calculus expression, the relational calculus is


considered as

30 A) procedural language CO2 BT1


B) non procedural language
C) structural language
D) functional language
The relational Algebra is a ____________ Query language.
A. Structured
31 B. Procedural CO2 BT1
C. Logical
D. Relational
The select, project and rename operations are called____

A. Binary operations
32 CO2 BT1
B. Ternary Operations
C. Unary operations
D. None of the above.
A relational query language L is considered relationally complete
if we can express in L any query that can be expressed
in__________.
33 CO2 BT1
A. Relational Algebra
B. Structured Language
C. Relational calculus
D. Logical Language
Which of the following is the Binary Operations?
A. Set difference, Union, Project
34 B. Rename, union, Set difference CO2 BT1
C. Cartesian product, Set difference and project
D. Cartesian product, union, set difference
The select operation selects tuples that satisfy a given predicate.
We use the lowercase______ to denote selection

35 A. Greek letter rho (ρ) CO2 BT3


B. Greek letter Pi (π)
C. Greek letter sigma (σ)
D. Greek letter sigma (ρ)
The tuple relational calculus is based on specifying a number of
__________.

A. String Variables
36 CO2 BT1
B. Column Variables.
C. Relation Variables
D. Tuple Variables.

Suppose we want to list all loan numbers and the amount of the
loans, but do not care about the branch name. Which of the
following operation allows us to produce this relation?
37 A. Set difference CO2 BT3
B. Union
C. Cartesian product
D. Project
The relation X(ABCDEF) with functional dependency set
F={AB🡪CD,C🡪CA,B🡪E,D🡪B,E🡪F}. The number of candidate
keys of a relation R is ______.

38 A. 3 CO2 BT3
B. 4
C. 2
D. 5
A ________of a relation schema R = {A1, A2, ... , An} is a set of
attributes S ⊆ R with the property that no two tuples t 1 and t 2 in
any legal relation state r of R will have t 1[S] = t2[S].

39 A. super key CO2 BT1


B. foreign key
C. candidate key
D. alternate key

If we want to include attributes from two different relations,


which of the following operations is needed?

40 A. Set difference CO2 BT2


B. Union
C. Cartesian product
D. Projection
Which of the following operation allows us to find the tuples that
are in one relation but are not in another relation?

41 A. Set difference CO2 BT2


B. Union
C. Cartesian product
D. Set intersection
An attribute of relation schema R is called ___________of R if it is
a member of some candidate key of R.

A. a non-prime attribute
42 CO2 BT2
B. a prime attribute
C. Composite attribute
D. Derived attribute

It is convenient at times to write a relational algebra expression by


assigning parts of it to temporary relation variables. Which of the
following operation will be used for that?
43 CO2 BT3
A. Division
B. Addition
C. Assignment
D. Subtraction
Two special symbols called quantifiers can appear in formulas;
they are :

A. universal quantifier (∀) and the existential quantifier (∃).


44 CO2 BT1
B. universal quantifier (A) and the existential quantifier (E).
C. conditional quantifier (∀A) and the generalized quantifier
(∃A).
D. None of the above.
Which of the following take a collection of values and return a
single value as a result?

45 A. Join Operation CO2 BT1


B. Generalized Projection
C. Aggregate Function
D. All of the above
Which of the following symbol can be used for Assignment
operation in the relational algebra expression?

A. =
46 CO2 BT1
B. =+
C. ==
D. ←

Which of the following operation that allows us to combine certain


selections and a Cartesian product into one operation?

47 A. Set-intersection operation CO2 BT1


B. Natural-Join operation
C. Division operation
D. Assignment operation
An expression {<X1,X2,….Xn > | P(X1,X2,….Xn)} , Where
X1,X2,….Xn represent Domain variable. P represents a formula
composed of atoms. This expression is of the of the following?
48 CO2 BT1
A. Tuple relational calculus
B. Relational Algebra
C. Domain relational calculus
D. None of the above
An attribute is called _________,if it is not a member of any
candidate key.

49 A. Prime CO2 BT1


B. Non-prime
C. Composite
D. Derived
Assume a relation R(A, B, C, D) with set of functional
dependencies F={C→D,C→A,B→C}. Use this setup to answer
the following questions; Which of the following is the candidate
keys of R?
50 CO2 BT2
A. C
B. BC
C. B
D. Both (b) and (c)
PART B (4 Marks)
Explain select and project operation in relational algebra.

Ans:

Select operation
It displays the records that satisfy a condition. It is denoted by sigma
(σ) and is a horizontal subset of the original relation.
1 Syntax: CO2 BT1
σcondition(table name)
Projection operation
It displays the specific column of a table. It is denoted by pie (∏). It is
a vertical subset of the original relation. It eliminates duplicate tuples.
Syntax:
∏condition(table name)
Consider the following schema:
Suppliers(sid: integer, sname: string, address: string)
Parts(pid: integer, pname: string, color: string)
Catalog(sid: integer, pid: integer, cost: real)
The key fields are underlined, and the domain of each field is listed
after the field name. Thus sid is the key for Suppliers, pid is the key for
Parts,and sid and pid together form the key for Catalog. The Catalog
relation lists the prices charged for parts by Suppliers. Write the
following queries in relational algebra.
a) Find the names of suppliers who supply some red part
b) Find the sids of suppliers who supply some red or green part.
c) Find the sids of suppliers who supply some red part or are at 221
Packer Ave
2 d) Find the sids of suppliers who supply some red part and some green BT2
part CO2

Ans:
What are the Pitfalls in Relational database design?
Ans:
Relational database design requires that we find a “good”
collection of relational schemas. A bad design may lead to
● Repetition of information
● Inability to represent certain information
Design Goals for Relational Database:
1. Avoid redundant data
2. Ensure that relationships among attributes are represented.
3. Facilitate the checking of updates for violation of database integrity
constraints
Example:
3 BT1
Consider the relational schema Lending-schema = (branch-name, CO2
branch-city, assets, customer-name, loan- number, amount)
Redundancy:
● Data for branch name, branch city, assets are repeated for each
loan that a branch makes.
● Wastes space and complicates updating.
Null Values:
● cannot store information about a branch if no loan exists.
● can use null values, but they are difficult to handle.
In the given example the database design is faulty which makes the
above pitfalls in database. So, in relational database design if the
design is not good then there will be faults in databases.
Find the minimum number of tables required to represent the given ER
diagram in relational model-

4 BT1

Answer:
Applying the rules, minimum 5 tables will be required-
 BR1R4R5 (b1 , b2 , a1 , c1 , d1)
 A (a1 , a2)
CO2
 R2 (a1 , c1)
 CR3 (c1 , c2 , d1)
 D (d1 , d2)
5 BT1

CO2

6 BT2
CO2
BT2

CO2
BT2

CO2
Difference between Tuple Relational Calculus (TRC) and Domain
Relational Calculus (DRC) :

9 CO2 BT2

Find the minimum number of tables required to represent the given ER


diagram in relational model-

10 CO2 BT3

Answer
Applying the rules, minimum 4 tables will be required-
 AR1R2 (a1 , a2 , b1 , c1)
 B (b1 , b2)
 C (c1 , c2)
 R3 (b1 , c1)
PART C (12 Marks)
Draw ER diagram for Hospital Management System CO2
1 (Use DOCTOR, PATIENT,HOSPITAL and MEDICAL_RECORD BT2
Entity). Identify Primary Key and Foreign Key.
Write the following queries in relational algebra, using the university CO2

schema.

a. Find the titles of courses in the Comp. Sci. department that have 3
credits.
b. Find the IDs of all students who were taught by an instructor named
Einstein; make sure there are no duplicates in the result.
c. Find the highest salary of any instructor.
d. Find all instructors earning the highest salary (there may be more
than one with the same salary).
e. Find the enrollment of each section that was offered in Autumn
2009.
f. Find the maximum enrollment, across all sections, in Autumn 2009.
g. Find the sections that had the maximum enrollment in Autumn 2009
Ans:

2 BT1

Explain about Selection, Projection, Rename, division and Cartesian CO2


3 BT2
product operations in relational algebra?
Consider the relation: student (sid, sname, address, gender, age) CO2

Write relational algebra (RA) for the following:

4 BT2
A. To display name of student whose age is greater than 15.
B. To remove the record of the student who are from Kathmandu.
C. To update address of student to Kathmandu whose sid is
'S1101'.
Use the following schema to write relational algebra statements for the
questions that follow. The primary keys are underlined in the schema:
STUDENT(Ssn, Name, Major, DOB)
COURSE(Cnum, Cname, Dept)
ENROLL(Ssn, Cnum, Semester, Grade)
BOOK_ADOPTION(Cnum, Semester, ISBN)
TEXTBOOK(ISBN, Title, Publisher, Author)
Specify the following queries in relational algebra:
A. List the course number taken by all students named 'John
5 CO2 BT2
Smith' in winter 1999 (i.e., Semester = 'W99').
B. Produce a list of textbooks (include Course#, ISBN, Title) for
courses offered by the Computer Science Department (i.e.,
Dept = 'CS').
C. List any department that has its adopted books published by
'BC Publishing'.
D. Find the names of students who have not been enrolled in any
course.
E. Find all the textbooks that were authored by Mike Wilkins.
Consider the following relational database:
Employee(empid, gender, name, dob, salary, address, deptno,
start_date)
Department(dpetno, name)
Students(std_id, gender, name, dob, projectno, deptno)
Project(projectno, name, location)

Write Relational algebra expression for the following:


6 CO2 BT2
A. Find employee name and address who works in "xyz
company".
B. Delete all employees whose salary is greater than Rs. 1,00,000.
C. Update department name to "SitaGroup" where student "Sita"
is involved.
D. Find the average salary of all employees.
E. Insert student record named "Gopal Shrestha" for department
"Ram Group".

You might also like