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
Consider the following relational schema: employee (empId,empName,empDept) customer (custId,custName,salesRepId,rating) salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return? SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId …
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation. employee (empId, empName, empAge) dependent (depId, eId, depName, depAge) Consider the following relational algebra query: …
Consider the transactions and the schedules given below. …
A prime attribute of a relation scheme is an attribute that appears
What is the optimized version of the relation algebra expression , where are sets of attributes in with and are Boolean expressions based on the attributes in ?
Relation has eight attributes . Fields of contain only atomic values. = is a set of functional dependencies so that is exactly the set of that hold for . How many candidate keys does the relation have?
Consider the following relational schema. Students(rollno: integer, sname: string) Courses(courseno: integer, cname: string) Registration(rollno: integer, courseno: integer, percent: real) Which of the following queries are equivalent to this query in English? “Find the distinct names of all students who score more than in the course numbered 107” …
An index is clustered, if
Consider the following relations and …
Consider the following relations and …
Suppose and are two relation schemas. Let and be the corresponding relation instances. is a foreign key that refers to in . If data in and satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
Consider the following transactions with data items and initialized to zero: …
Which of the following statements are TRUE about an SQL query? P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause R : All attributes used in the GROUP BY clause must appear in the SELECT clause S : Not all attributes used in the GROUP BY clause …
Given the basic ER and relational models, which of the following is INCORRECT?
Which of the following is TRUE?
Database table by name is given below. …
Consider a relational table with sufficient number of records, having attributes and let . Two queries and are given below. where is a constant …
Consider a database table T containing two columns and each of type . After the creation of the table, one record is inserted in the table. Let and denote the respective maximum values of and among all records in the table at any point in …
Consider a relational table with a single record for each registered student with the following attributes: Unique registration number for each registered student Unique identity number, unique at the national level for each citizen Unique account number at the bank. A student can …
The following functional dependencies hold for relations and The relation contains tuples and the relation contains tuples. What is the maximum number of tuples possible in the natural join ?
