Q21
The maximum number of superkeys for the relation schema R(E,F,G,H) with E as the key is _____.
Show answer without attempting
Answer: 8
GATE CS · 16 questions
16 Databases questions from GATE CS papers (2014), each with the official answer key. Answer any question right here and it is marked straight away, or practise them one at a time.
Answer: 8
| StudentID | StudentName | StudentEmail | StudentAge | CPI |
|---|---|---|---|---|
| 2345 | Shankar | shankar@math | X | 9.4 |
| 1287 | Swati | swati@ee | 19 | 9.5 |
| 7853 | Shankar | shankar@cse | 19 | 9.4 |
| 9876 | Swati | swati@mech | 18 | 9.3 |
| 8765 | Ganesh | ganesh@civil | 19 | 8.7 |
Answer: 19
| T1 | T2 | T3 | T4 |
|---|---|---|---|
| Reads(X) | |||
| Writes(X) | |||
| Commit | |||
| Writes(X) | |||
| Commit | |||
| Writes(Y) | |||
| Reads(Z) | |||
| Commit | |||
| Reads(X) | |||
| Reads(Y) | |||
| Commit |
Answer: C
Answer: A
select * from R where a in (select S.a from S)Answer: C
Answer: B
Answer: A
Answer: B
Answer: A
Answer: D
SELECT empName
FROM employee E
WHERE NOT EXISTS (SELECT custId
FROM customer C
WHERE C.salesRepId = E.empId
AND C.rating <> 'GOOD');Answer: D
Answer: B
CREATE TABLE S (
a INTEGER,
d INTEGER,
e INTEGER,
PRIMARY KEY (d),
FOREIGN KEY (a) references R
)Answer: D
Answer: D
Answer: A
employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id)SQL>SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id);Answer: B
0/160 correct0 marks