Assignment DBMS
Assignment DBMS
F = {CH -> G, A -> BC, B -> CFH, E -> A, F -> EG} is a set of functional
dependencies (FDs) so that F+ is exactly the set of FDs that hold for R. How many
candidate keys does the relation R have?
a) 3
b) 4
c) 5
d) 6
2. Which of the following statements are TRUE about an SQL query? P : An SQL query can
contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can
contain a HAVING clause only if it has a GROUP BY clause R : All attributes used in the
GROUP BY clause must appear in the SELECT clause S : Not all attributes used in the GROUP
BY clause need to appear in the SELECT clause
a) P and R
b) P and S
c) Q and R
d) Q and S
3.
Table A
Id Name Age
----------------
12 Arun 60
15 Shreya 24
99 Rohit 11
Table B
Id Name Age
----------------
15 Shreya 24
25 Hari 40
98 Rohit 20
99 Rohit 11
Table C
Id Phone Area
-----------------
10 2200 02
99 2100 01
Consider the above tables A, B and C. How many tuples does the result of the following SQL
query contains?
SELECT A.id
FROM A
FROM B
a) 4
b) 3
c) 0
d) 1
SELECT Count(*)
FROM Loan_Records) AS S
a) 3
b) 9
c) 5
d) 6
SELECT S.sname
FROM Suppliers S
FROM Catalog C
FROM Parts P
Assume that relations corresponding to the above schema are not empty. Which one of the
following is the correct interpretation of the above query?
a) Find the names of all suppliers who have supplied a non-blue part.
b) Find the names of all suppliers who have not supplied a non-blue part.
c) Find the names of all suppliers who have supplied only blue parts.
d) Find the names of all suppliers who have not supplied only blue parts.
6. Given the following statements:
assertion in SQL.
CREATE TABLE S (
a INTEGER,
d INTEGER,
e INTEGER,
salesRepId is a foreign key referring to empId of the employee relation. Assume that each
employee makes a sale to at least one customer. What does the following query return?
SELECT empName
FROM employee E
FROM customer C
a) Names of all the employees with at least one of their customers having a ‘GOOD’ rating.
b) Names of all the employees with at most one of their customers having a ‘GOOD’ rating.
c) Names of all the employees with none of their customers having a ‘GOOD’ rating.
d) Names of all the employees with all their customers having a ‘GOOD’ rating.
8. The statement that is executed automatically by the system as a side effect of the
modification of the database is
a) backup
b) assertion
c) recovery
d) trigger
9. Consider the relation "enrolled(student, course)" in which (student, course) is the primary
key, and the relation "paid(student, amount)" where student is the primary key. Assume no
null values and no foreign keys or integrity constraints. Given the following four queries:
= paid.student)
where the primary keys are shown underlined. The number of tuples in the Student and Enroll
tables are 120 and 8 respectively. What are the maximum and minimum number of tuples that
can be present in (Student * Enroll), where '*' denotes natural join ?
a) 8, 8
b) 120, 8
c) 960, 8
d) 960, 120
11. The employee information in a company is stored in the relation
select deptName
from Employee
group by deptName
a) the average salary is more than the average salary in the company
b) the average salary of male employees is more than the average salary of all male
employees in the company
c) the average salary of male employees is more than the average salary of employees in
the same department
d) the average salary of male employees is more than the average salary in the company
13. Database applications were built directly on top of file system to overcome the following
drawbacks of using file-systems: (i) Data redundancy and inconsistency (ii) Difficulty in
accessing Data (iii) Data isolation (iv) Integrity problems
a) (i)
b) (i) and (iv)
c) (i), (ii) and (iii)
d) (i), (ii), (iii) and (iv)
14. Which of the following statements is FALSE about weak entity set?
a) Weak entities can be deleted automatically when their strong entity is deleted.
b) Weak entity set avoids the data duplication and consequent possible inconsistencies
caused by duplicating the key of the strong entity.
c) A weak entity set has no primary keys unless attributes of the strong entity set on which
it depends are included
d) Tuples in a weak entity set are not partitioned according to their relationship with tuples
in a strong entity set.
15. The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup, unit_price) is in 2NF
because:
a) Non_key attribute V_name is dependent on V_no which is part of composite key
b) Non_key attribute V_name is dependent on Qty_sup
c) Key attribute Qty_sup is dependent on primary_key unit price
d) Key attribute V_ord_no is dependent on primary_key unit price