1.
Consider the following ORACLE relations : One (x, y) = {<2, 5>, <1, 6>, <1, 6>, <1, 6>, <4, 8>, <4, 8>} Two (x, y) = {<2, 55>, <1, 1>, <4, 4>, <1, 6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>} Consider the following two SQL queries SQ1 and SQ2 :
SQ1 : SELECT * FROM One)
EXCEPT
(SELECT * FROM Two);
SQ2 : SELECT * FROM One)
EXCEPT ALL
(SELECT * FROM Two);
For each of the SQL queries, what is the cardinality (number of rows) of the result obtained when applied to the instances above ?
2.
Consider the following schema:
Emp (Empcode, Name, Sex, Salary, Deptt)
A simple SQL query is executed as follows:
SELECT Deptt FROM Emp
WHERE sex = 'M'
GROUP by Dept
Having avg (Salary) > {select avg (Salary) from Emp}
The output will be
3.
The relation book (title,price) contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list? select title from book as B where (select count(*) from book as T where T.price>B.price)<5
4.
Given two relations R1(A, B) and R2(C, D), the result of following query Select distinct A, B from R1, R2 is guaranteed to be same as R1 provided one of the following condition is satisfied.
5.
In SQL, __________ is an Aggregate function.
6.
__________ SQL command changes one or more fields in a record.
7.
Which of the following is/are true with reference to ‘view’ in DBMS ? (a) A ‘view’ is a special stored procedure executed when certain event occurs. (b) A ‘view’ is a virtual table, which occurs after executing a pre-compiled query. code:
8.
Consider following schedules involving two transactions: S1 : r1(X); r1(Y); r2(X); r2(Y); w2(Y); w1(X) S2 : r1(X); r2(X); r2(Y); w2(Y); r1(Y); w1(X) Which of the following statement is true?
9.
Which one of these is characteristic of RAID 5?
10.
Which of the following concurrency control protocol ensures both conflict serializability and free from deadlock?