Q22
A prime attribute of a relation scheme is an attribute that appears
Show answer without attempting
Answer: B
GATE CS · 120 questions
120 Databases questions from GATE CS papers, 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: 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
Answer: C
Answer: A
Answer: B
Answer: A
Answer: C
Answer: C
Answer: C
T1 : read (P);
read (Q);
if P = 0 then Q := Q + 1 ;
write (Q).
T2 : read (Q);
read (P);
if Q = 0 then P := P + 1 ;
write (P).Answer: B
Answer: A
Answer: A
SELECT A.Id
FROM A
WHERE A.Age > ALL (SELECT B.Age
FROM B
WHERE B.Name = 'Arun')Answer: B
0/200 correct0 marks