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
Which one of the following statements is ?
Consider the table employee(empId, name, department, salary) and the two queries below. Assuming that department has more than one employee, and we want to find the employees who get higher salary than anyone in the department which one of the statements is TRUE for any arbitrary employee table? Select e.empId From …
Consider the relation employee(name, sex, supervisorName) with name as the key, supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce? …
Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Assume that amounts and were each paid by of the students. Consider these …
Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Given the following four queries: Query1: select student from enrolled where student in (select student from paid) Query2: …
Consider the relation account (customer, balance) where the customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The customer with the largest balance gets rank Ties are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank and …
Consider the following log sequence of two transactions on a bank account, with initial balance that transfer to a mortgage payment and then apply a interest. T1 start T1 B old new T1 M old new T1 commit T2 start T2 B old new T2 commit Suppose the database system crashes …
Consider a relation scheme on which the following functional dependencies hold: {, , , }. What are the candidate keys R?
The relation book (title, price) contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list? select title from book as B where (select count(*) from book as T where T.price>B.price) < 5
The following table has two attributes and where is the primary key and is the foreign key referencing with on-delete cascade. …
Let and be two entities in an diagram with simple-valued attributes. and are two relationships between and , where is one-to-many and is many-to-many. and do not have any attributes of their own. What is the minimum number of tables required to represent this situation in …
Let r be a relation instance with schema R = (A, B, C, D). We define and . Let where denotes natural join. Given that the decomposition of into and is lossy, which one of the following is TRUE?
Which one of the following statements about normal forms is
Which of the following is a key factor for preferring -trees to binary search trees for indexing database relations?
The employee information in a company is stored in the relation Employee (name, sex, salary, deptName) Consider the following SQL query Select deptName From Employee Where sex = ‘M’ Group by deptName Having avg(salary) > (select avg (salary) from Employee) It returns the names of the department in which
The order of an internal node in a tree index is the maximum number of children it can have. Suppose that a child pointer takes bytes, the search field value takes bytes, and the block size is bytes. What is the order of the internal node?
Consider the relation Student (name, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce? (Note: is the rename operator). …
The relation scheme has the following functional dependencies: name, courseNo, grade rollNo, courseNo grade name rollNo rollNo name The highest normal form of this relation scheme is
Consider the following relation schema pertaining to a students database: Students (rollno, name, address) Enroll (rollno, courseno, coursename) where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are and respectively. What are the maximum and minimum number of tuples that can be present in …
Let and be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in referring to . Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances and . Which …
