GATE CS Databases questions
Practise Databases questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.
Separate schema constraints from assumptions in the question. For SQL, trace joins and grouping; for normalisation, work from the stated functional dependencies.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
A file is organized so that the ordering of the data records is the same as or close to the ordering of data entries in some index. Then that index is called
SELECT operation in SQL is equivalent to
Consider a simple checkpointing protocol and the following set of operations in the log. (start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7); (checkpoint); (start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2); If a crash happens now and the system tries to recover using both undo and redo …
Consider two relations with the tuples and . Assume that is the full natural outer join of and . Consider the following tuples of the form Which one of the …
With reference to the tree index of order shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the following query. "Get all records with a search key greater than or equal to and less than " is ______.
Consider the following transaction involving two bank accounts and . read(x); x:=x-50; write (x); read(y); y:=y+50; write(y) The constraint that the sum of the accounts and should remain constant is that of
Consider a tree in which the search key is long, block size is , record pointer is long and the block pointer is long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ______.
Consider the partial Schedule involving two transactions and . Only the and the operations have been shown. The operation on data item is denoted by and operation on data item is denoted by . …
Consider the relation with the following set of functional dependencies Which of the following is the trivial functional dependency in , where is closure to F?
Consider the following relation Cinema() Which of the following options will be needed at the end of the SQL query SELECT P1.address FROM Cinema P1 such that it always finds the addresses of theaters with maximum capacity?
Given the following schema: employees(emp-id, first-name, last-name, hire-date, dept-id, salary) departments(dept-id, dept-name, manager-id, location-id) You want to display the last names and hire dates of all latest hires in their respective departments in the location You issue the following query: SQL>SELECT last-name, hire-date …
Given the following two statements: S1: Every table with two single-valued attributes is in and S2: is a minimal cover for the set of functional dependencies . Which one of the following is CORRECT?
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by and respectively. Which one of them is conflict serializable?
Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table where and together form the primary key, the following is a valid table definition. CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references R) Which …
Consider the relation scheme and the set of functional dependencies on . What is the key for ?
SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below: select * from R where a in (select S.a from S)
Consider a join (relation algebra) between relations and using the nested loop method. There are buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming the join will have fewer number of disk block accesses if
Consider the following schedule S of transactions …
Given an instance of the STUDENTS relation as shown as below …
The maximum number of superkeys for the relation schema with as the key is _____.
