The employee information of an organization is stored as Emp (name, sex, salary, dept, DOB)Consider the following query :
select dept from emp
where sex = “F”group by dept
having avg (salary) > (select avg salary from emp)
The above query returns
Which of the following is FALSE regarding BCNF?
Which of the following statement is true?
-
Solution
Attributes can be transitively dependent on a key in 3NF.
Consider two relation schema R1= (A, B, C, D, E) and R2 =(A, B, C, D,E).Statement 1 is the functional dependency of R1 and Statement 2 is the functional dependency of R2.
1.A → B, AB → C, D → AC, D → E
2.A → BC, D → AE
Which of the following statements is true?
-
Solution
The candidate key for R1 is AD, because the closure of AD contains all the attributes,i.e.,{AD}+ = {A,B, C, D, E}and closure of FD is
{A → B, AB → C, A → C, D → AC, D → A, D → C, D → E}The candidate key for R2 is AD and closure of FD is{A → B, A → C, A → BC, D → A,D → C, D → E, D → AC}As we can see clearlyR1 ≅ R2
Hence, functional dependency of R1 is equivalent to that of R2.
Consider the schema R = (S T U V) and dependencies
S → T, T → U, U → V, U → V and V → S
Let R = (R1 and R2) be a decomposition such that R1 ∩ R2Ç = φ. The decomposition is
-
Solution
Decomposition is in both 2NF and 3NF.Because, S is candidate key and there is no partial dependency and transitive dependency holds.
Which of the following queries will give the names of employee who is earning maximum salary?
-
Solution
Select name from emp
where sal = (select max(sal) from emp);
This query will find the max salary, there is no comparison,but
select name from emp
where sal > = all (select sal from emp);
This query will compare the salary of one employee to other’s one by one. So, there are many comparisons due to which performance of A is better than that of B.
Which of the following is FALSE?
A multilevel page table is preferred in comparison to a single level page table for translating virtual address to physical address because
-
Solution
Multilevel page table is used to reduce the page table size.
The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0= 1, S1= 0, S2= 0.
Process P0 Process P1 Process P2
while (true) Wait (S1) Wait (S2)
release (S0)release (S0)
{
wait (S0)
print (0)
release (S1)
release (S2)
}
How many times will process P0 print 0?
Considering an operating system capable of loading and executing a single sequential user process at a time. The disk scheduling algorithm used in FCFS.If FCFS is replaced by SSTF, claimed by the vendor to given 50% better benchmark results, what is the expected improvement in IN/OUT performance of user programs?
-
Solution
It is important to note that SSTF (Shortest Seek Time First)is the optimal scheduling scheme for the access of file only.Therefore, the IN/OUT performance of the user program is determined by many in put and output devices and not only by the disk. So, when FCFS is replaced by SSTF, it improves only disk performance, not the IN/OUT performance. This implies,improvement in performance of user program is 0%.