Database Management System MCQs

16. Question

It is desired to design an object-oriented employee record system for a company. Each employee has a name, unique id and salary. Employees belong to different categories and their salary is determined by their category. The functions get Name, getld and compute salary are required. Given the class hierarchy below, possible locations for these functions are:
(i) getld is implemented in the superclass
(ii) getld is implemented in the subclass
(iii) getName is an abstract function in the superclass
(iv) getName is implemented in the superclass
(v) getName is implemented in the subclass
(vi) getSalary is an abstract function in the superclass
(vii) getSalary is implemented in the superclass
(viii) getSalary is implemented in the subclass

Untitled

Choose the best design




Answer
17. Question

Consider the following SQL query
select distinct a1, a2, …, an
from r1, r2, …, rm
where P
For an arbitrary predicate P, this query is equivalent to which of the following
relational algebra expressions?




Answer
18. Question

Let R1 (A,B,C) and R2 (D,E) be two relation schema, where the primary keys are A in R1 and D in R2, and let C be a foreign key in R1 referring to R2. Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1 and r2. Which one of the following relational algebra expressions would necessarily produce an empty relation?




Answer
19. Question

The following functional dependencies are given: AB →CD, AF →D,DE →F,C →G, F →E,G →A.
Which one of the following options is false?




Answer
20. Question

The employee information in a company is stored in the relation
Employee (name, sex, salary, deptName)
Consider the following SQL query
Select deptName
From Employee
Where sex = ‘M’
Group by deptName
Having avg(salary) >
(select avg (salary) from Employee)
It returns the names of the department in which




Answer