Databases (Test 2)

Gate Exam : Cs Computer Science And Information Technology

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

Databases

Databases
| Databases |
Topic: Databases Tag: CS GATE 2009
Q.1
Consider the following relational schema: Suppliers (sid:integer, sname: string, city:string, street: string) Parts (pid:integer, pname: string, color:string) Catalog (sid:integer, pid:integer, cost: real) Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is TRUE about the above schema?
A. The schema is in BCNF
B. The schema is in 3NF but not in BCNF
C. The schema is in 2NF but not in 3 NF
D. The schema is not in 2NF
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Databases Tag: CS GATE 2015
Q.2
Consider the following transaction involving two bank account x and y. read (x) ; x : = x – 50; write (x) ; read (y); y : = y + 50 ; write (y) The constraint that the sum of the accounts x and y should remain constant is that of
A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer : Option B
Explaination / Solution:

The consistency property ensures that the database remains in a consistent state before the (start of the transaction and after the transaction is over. Here sum of the accounts x & y should remain same before & after execution of the given transactions which refers to the consistency of the sum.

Workspace
Report
Topic: Databases Tag: CS GATE 2015
Q.3
Consider the following two statements.
S1 : if a candidate is known to be corrupt, then he will not be elected 
S2 : if a candidate is kind, he will be elected
Which one of the following statements follows from S1 and S2 per sound interference rules of logic? 
A. If a person is known to corrupt, he is kind
B. If a person is not known to be corrupt, he is not kind
C. If a person is kind, he is not known to be corrupt
D. If a person is not kind, he is not known to be corrupt
Answer : Option C
Explaination / Solution:

Let P: candidate known to be corrupt q: candidate will be elected r: candidate is kind S1 = p ⟶ ~ q = q ⟶~p S2 = r ⟶ q i.e., If a person is kind, he is not known to be corrupt Option is C

Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.4
Two alternative packages A and B are available for processing a database having 10k records. Package A requires 0.0001ntime units and package B requires 10nlog10n time units to process n records. What is the smallest value of k for which package B will be preferred over A?
A. 12
B. 10
C. 6
D. 5
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Databases Tag: CS GATE 2015
Q.5
Which one of the following well formed formulae is tautology?
A. ∀x ∃y R(x,y) ↔ ∃y ∀x R(x, y)
B. (∀x [∃y R(x,y) → S(x,y)]) → ∀x ∃y S(x, y)
C. [∀x ∃y (P(x,y) → R(x,y)] ↔ [∀x ∃y (¬P(x, y)∨R(x,y)]
D. ∀x ∃y P(x,y) → ∀x ∀y P(y,x)
Answer : Option C
Explaination / Solution:



Workspace
Report
Topic: Databases Tag: CS GATE 2011
Q.6
Consider a relational table with a single record for each registered student with the following attributes. 1. Registration_Number: Unique registration number for each registered student 2. UID: Unique Identity number, unique at the national level for each citizen 3. BankAccount_Number: Unique account number at the bank. A student can have multiple accounts or joint accounts. This attributes stores the primary account number 4. Name: Name of the Student 5. Hostel_Room: Room number of the hostel Which of the following options is INCORRECT?
A. BankAccount_Number is a candidate key
B. Registration_Number can be a primary key
C. UID is a candidate key if all students are from the same country
D. If S is a superkey such that S ∩ UID is NULL then S ∪ UID is also a superkey
Answer : Option A
Explaination / Solution:

In case two students hold joint account then BankAccount_Num will not uniquely determine other attributes.

Workspace
Report
Topic: Databases Tag: CS GATE 2011
Q.7
Consider a relational table r with sufficient number of records, having attributes A1, A2,…, An and let 1 ≤ p ≤ n. Two queries Q1 and Q2 are given below.

The database can be configured to do ordered indexing on Ap or hashing on Ap
Which of the following statements is TRUE? 
A. Ordered indexing will always outperform hashing for both queries
B. Hashing will always outperform ordered indexing for both queries
C. Hashing will outperform ordered indexing on Q1, but not on Q2
D. Hashing will outperform ordered indexing on Q2, but not on Q1.
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Databases Tag: CS GATE 2011
Q.8
Database table by name Loan_Records is given below.
Borrower          Bank_Manager                    Loan_ Amount
Ramesh              Sunderajan                           10000.00
Suresh                Ramgopal                             5000.00
Mahesh              Sunderajan                            7000.00
What is the output of the following SQL query?
SELECT count(*)
FROM(
(SELECT Borrower. Bank_Manager FROM Loan_Records) AS S
NATURAL JOIN
(SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T
); 
A. 3
B. 9
C. 5
D. 6
Answer : Option C
Explaination / Solution:


After executing the given query, the output would be


Workspace
Report
Topic: Databases Tag: CS GATE 2011
Q.9
Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one record (X= 1, Y=l) is inserted in the table. Let MX and MY denote the respective maximum values of X and Y among all records in the table at any point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y values being MX+1, 2*MY+1 respectively. It may be noted that each time after the insertion, values of MX and MY change. What will be the output of the following SQL query after the steps mentioned above are carried out? SELECT Y FROM T WHERE X=7;
A. 127
B. 255
C. 129
D. 257
Answer : Option A
Explaination / Solution:



Workspace
Report
Q.10
Which of the following is NOT a super key in a relational schema with attributes V , W , X , Y , Z and primary key V Y ?
A. V XY Z
B. V W X Z
C. V W XY
D. V W XY Z
Answer : Option B
Explaination / Solution:

Any superset of VY is a super key.

Workspace
Report


CS Computer Science and Information Technology