Total Marks : 20
Question 1
Database schema is given below:
(i) Find out the phonenumber and address of the customer named by Aditya in relational
algebra from the above database schema. Marks: 1 MCQ
Explanation: This relational algebra queries will be solved by using the select and project
operator from the above mentioned relational schemas. At first it will select all the tuples from
the relation whose name is Aditya using select operator then it will select phonenumber and
address of ’Aditya’ through the project operator.
(ii) Find out the accountNo and branchName of all those account where the balance is less
than 1000 in relational algebra from the above database schema.
Marks: 1 MCQ
1
Explanation: It will select those tuples whose balance is less than 1000 from the relation
account and then the accountNo and branchName is selected.
2
Question 2
Consider the schema of relations shown below and the SQL query that follow:
Which of the following sets is computed by the above query? Marks: 2 MCQ
a) Names of the students who have not got an A grade in all courses taught by Korth
c) Names of the students who have got an A grade in at least one of the courses taught by
Korth
Answer: c)
Name of the students who have got an A grade in at least one of the courses taught by Korth.
3
Question 3
Find out the account details where the balance is greater than 5000 in both tuple and domain
relational calculus from the given relation schema.
Marks: 2 MCQ
Explanation: Generic expression for tuple relational calculus {t—P (t)}, where p repre-
sents the tuple variable and P(t) is the predicate using tuple variable t. t|t ∈ account ∩ t[balance] >
5000.
Generic expression for domain relational calculus {< a, b, c, · · · , n > |P(< a, b, c, , n >)},
where a, b, c, · · · , n are domain variables and P is the predicate one or more of these variables.
{< a, b, c > | < a, b, c >∈ account ∩ b > 5000}
4
Question 4
From within a host language, select the correct Embedded SQL query/s to find the names
of all instructors whose salary is between min salary and max salary declared in the host
language. Marks: 2 MSQ
a) EXEC SQL
DECLARE c CURSOR FOR
SELECT name
FROM instructor
WHERE salary BETWEEN :min_salary AND :max_salary
END_EXEC
c) EXEC SQL
DECLARE c CURSOR FOR
SELECT name
FROM instructor
WHERE salary >= :min_salary AND salary <= :max_salary
END_EXEC
d) EXEC SQL
DECLARE c CURSOR FOR
SELECT name
FROM instructor
WHERE salary BETWEEN min_salary AND max_salary
END_EXEC
Answer: a), c)
Explanation: min salary and max salary are the variables of the Embedded SQL host
language which contains the values of the minimum and maximum salary. We use these
variables to find the names of the instructors whose salaries are between the range with the
help of between construct.
5
Question 5
Loan (Loan No, LoanAmount, BranchName)
Find out the loan details for Branch name Alipore and Loan amount is greater than 5000
in tuple relational calculus from the given relation schema. Marks: 2 MCQ
6
Question 6
Map the given E-R model into relational model in the context of M:N relationship type.
Marks: 2 MCQ
c) work on(emp name, ssn, pnumber, gender, salary, dob, dateofjoining, pname, location)
7
Question 7
What is the correct notation for the above E-R diagram? Marks: 2 MSQ
a) Partial participation of E2 in R.
b) Total participation of E2 in R.
c) Total participation of E1 in R.
d) Partial participation of E1 in R.
Explanation: Based on the participation constraints on Relationship type double line shows
the total participation and single line represents the partial participation.
8
Question 8
What constraints do the partial key and the identifying relationship of the weak entity type
specify in this diagram?
Marks: 2 MCQ
Answer:
c) Total participation with the ratio N:1
9
Question 9
The CREATE TRIGGER statement is used to create the trigger. THE ––––clause specifies
the table name on which the trigger is to be attached. The ––––specifies that this is an AFTER
INSERT trigger.
Identify the correct options for the gaps in the above sentences. Marks: 2 MCQ
a) for insert, on
c) for, insert
Answer: b)
Explanation: The triggers run after an insert, update or delete on a table. They are not
supported for views.
10
Question 10
a) Overlap Constraint
b) disjoint Constraint
c) Specific Constraint
d) Multiple Constraint
11