Databases questions

Q11

GATE CS 2018 CSData ModelsMCQ1 mark−1/3 if wrong
In an Entity-Relationship (ER) model, suppose RR is a many-to-one relationship from entity set E1 to entity set E2. Assume that E1 and E2 participate totally in RR and that the cardinality of E1 is greater than the cardinality of E2.

Which one of the following is true about RR?
Show answer without attempting

Answer: A

Q12

GATE CS 2018 CSRelational QueriesMCQ1 mark−1/3 if wrong
Consider the following two tables and four queries in SQL.

Book (isbn, bname), Stock (isbn, copies)

Query 1: SELECT B.isbn, S.copies
FROM Book B INNER JOIN Stock S
ON B.isbn = S.isbn;

Query 2: SELECT B.isbn, S.copies
FROM Book B LEFT OUTER JOIN Stock S
ON B.isbn = S.isbn;

Query 3: SELECT B.isbn, S.copies
FROM Book B RIGHT OUTER JOIN Stock S
ON B.isbn = S.isbn;

Query 4: SELECT B.isbn, S.copies
FROM Book B FULL OUTER JOIN Stock S
ON B.isbn = S.isbn;

Which one of the queries above is certain to have an output that is a superset of the outputs of the other three queries?
Show answer without attempting

Answer: D

Q41

GATE CS 2018 CSRelational QueriesMCQ2 marks−2/3 if wrong
Consider the relations r(A,B)r(A, B) and s(B,C)s(B, C), where s.Bs.B is a primary key and r.Br.B is a foreign key referencing s.Bs.B. Consider the query

Q:r⋈(σB<5(s))Q: r \bowtie (\sigma_{B<5}(s))

Let LOJ denote the natural left outer-join operation. Assume that rr and ss contain no null values.

Which one of the following queries is NOT equivalent to QQ?
Show answer without attempting

Answer: C

Q42

GATE CS 2018 CSRelational DesignMCQ2 marks−2/3 if wrong
Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed. The underlined attributes are the respective primary keys.

Schema I: Registration (rollno‾\underline{\text{rollno}}, courses)
Field 'courses' is a set-valued attribute containing the set of courses a student has registered for.
Non-trivial functional dependency:
rollno →\to courses

Schema II: Registration (rollno, courseid‾\underline{\text{rollno, courseid}}, email)
Non-trivial functional dependencies:
rollno, courseid →\to email
email →\to rollno

Schema III: Registration (rollno, courseid‾\underline{\text{rollno, courseid}}, marks, grade)
Non-trivial functional dependencies:
rollno, courseid →\to marks, grade
marks →\to grade

Schema IV: Registration (rollno, courseid‾\underline{\text{rollno, courseid}}, credit)
Non-trivial functional dependencies:
rollno, courseid →\to credit
courseid →\to credit

Which one of the relational schemas above is in 3NF but not in BCNF?
Show answer without attempting

Answer: B

0/40 correct0 marks

Related topics in GATE CS