# Databases (Test 4)

## Gate Exam : Cs Computer Science And Information Technology

| Home | | Gate Exam | | Cs Computer Science And Information Technology | | Databases |

Databases
| Databases |
Topic: Databases Tag: CS GATE 2012
Q.1
Consider the following relations A, B and C:

How many tuples does the result of the following SQL query contain?
SELECT A.Id
FROM A
WHERE A.Age > ALL(SELECT B.Age FROM B WHERE B.Name = ‘Arun’)
A. 4
B. 3
C. 0
D. 1
Explaination / Solution:

As the result of subquery is an empty table, ‘>ALL’ comparison is true . Therefore, all the three row id’s of A will be selected from table A.

Workspace
Report
Topic: Databases Tag: CS GATE 2012
Q.2
Consider the following relations A, B and C:
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A ∪ B is the same as that of A.

A. 7
B. 4
C. 5
D. 9
Explaination / Solution:

Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.3
A relational schema for a train reservation database is given below
Passenger (pid, pname, age)
Reservation (pid, cass, tid)

What pids are returned by the following SQL query for the above instance of the tables?
SELECT pid
FROM Reservation
WHERE class ' AC ' AND
EXISTS (SELECT * FROM Passenger WHERE age>  65 AND Passenger.pid = Reservation.pid)
A. 1,0
B. 1,2
C. 1,3
D. 1,5
Explaination / Solution:
No Explaination.

Workspace
Report
Topic: Databases Tag: CS GATE 2012
Q.4
Which of the following assertions are CORRECT?
P: Adding 7 to each entry in a list adds 7 to the mean of the list
Q: Adding 7 to each entry in a list adds 7 to the standard deviation of the list
R: Doubling each entry in a list doubles the mean of the list
S: Doubling each entry in a list leaves the standard deviation of the list unchanged
A. P, Q
B. Q, R
C. P, R
D. R, S
Explaination / Solution:

P and R always hold true Else consider a sample set {1, 2, 3, 4} and check accordingly

Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.5
Suppose the predicate F(x, y, t) is used to represent the statement that person x can fool person y at time t. which one of the statements below expresses best the meaning of the formula ∀x ∃y ∃t (¬F (x, y, t))?
A. Everyone can fool some person at some time
B. No one can fool everyone all the time
C. Everyone cannot fool some person all the time
D. No one can fool some person at some time
Explaination / Solution:
No Explaination.

Workspace
Report
Topic: Databases Tag: CS GATE 2013
Q.6
An index is clustered, if
A. it is on a set of fields that form a candidate key
B. it is on a set of fields that include the primary key
C. the data records of the file are organized in the same order as the data entries of the index
D. the data records of the file are organized not in the same order as the data entries of the index
Explaination / Solution:

Clustered index is built on ordering non key field and hence if the index is clustered then the data records of the file are organized in the same order as the data entries of the index.

Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.7
The following functional dependencies hold for relations R(A, B, C) and S(B, D, E) B → A, A → C The relation R contains 200tuples and the relation S contains 100tuples. What is the maximum number of tuples possible in the natural join R  S?
A. 100
B. 200
C. 300
D. 2000
Explaination / Solution:
No Explaination.

Workspace
Report
Topic: Databases Tag: CS GATE 2013
Q.8
Using public key cryptography, X adds a digital signature σ to message M, encrypts , and sends it to Y, where it is decrypted. Which one of the following sequences of keys is used for the operations?
A. Encryption: X’s private key followed by Y’s private key; Decryption: X’s public key followed by Y’s public key
B. Encryption: X’s private key followed by Y’s public key; Decryption: X’s public key followed by Y’s private key
C. Encryption: X’s public key followed by Y’s private key; Decryption: Y’s public key followed by X’s private key
D. Encryption: X’s private key followed by Y’s public key; Decryption: Y’s private key followed by X’s public key
Explaination / Solution:

Encryption: Source has to encrypt with its p r ivate key for formin g Digital signature for Authentication. source has to encrypt the <M, σ > with Y ' s public key to send it confidentially
Decryption: Destination Y has to decrypt first with its private key, then decrypt using source public key

Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.9
A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below
Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
A. 46, 42, 34, 52, 23, 33
B. 34, 42, 23, 52, 33, 46
C. 46, 34, 42, 23, 52, 33
D. 42, 46, 33, 23, 34, 52
Explaination / Solution:
No Explaination.

Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.10
A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below

How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?
A. 10
B. 20
C. 30
D. 40