DBMS Questions Gate 2004

Question 1 : Let R1 (A, B, C) and R2 (D, E) be two relation schema,
             where the primary keys are shown underlined, and let C
             be a foreign key in R1 referring to R2. Suppose there
             is no violation of the above referential integrity
             constraint in the corresponding relation instances r1
             and r2. Which one of the following relational algebra
             expressions would necessarily produce an empty 
             relation ?
             GATECS2004

Solution :
          DBMS Questions Gate 2003
Question 2 : Consider the following relation schema pertaining to a
             students database:
             Student (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 120 and
             8 respectively. What are the maximum and minimum number
             of tuples that can be present in (Student * Enroll),
             where '*' denotes natural join ?

          a) 8, 8
          b) 120, 8
          c) 960, 8
          d) 960, 120
Solution :
          QA7- DBMS - Gate 2004 - CS
Question 3 : It is desired to design an object-oriented employee
             record system for a company. Each employee has a name,
             unique id and salary. Employees belong to different
             categories and their salary is determined by their
             category. The functions to get Name, getld and compute
             salary are required. Given the class hierarchy below,
             possible locations for these functions are:

          i. getld is implemented in the superclass
         ii. getld is implemented in the subclass
        iii. getName is an abstract function in the superclass
         iv. getName is implemented in the superclass
          v. getName is implemented in the subclass
         vi. getSalary is an abstract function in the superclass
        vii. getSalary is implemented in the superclass
       viii. getSalary is implemented in the subclass Choose the best
             design

          a) (i), (iv), (vi), (viii)
          b) (i), (iv), (vii)
          c) (i), (iii), (v), (vi), (viii)
          d) (ii), (v), (viii)
Solution :
          Superclass hides the information to the outside world, So
          each ID of an employee must be implemented in superclass. 
          Name is also an important attribute of employee, so must
          be implemented in the superclass.
          Salary of an employee is differ by category and department,
          So it is a function which must be implemented in subclass.
          So, Option (a) is the correct answer.
Question 4 : The relation scheme Student Performance (name, courseNo,
             rollNo, grade) has the following functional
             dependencies:

             name, courseNo   → grade
             rollNo, courseNo → grade
                         name → rollNo
                       rollNo → name

             The highest normal form of this relation scheme is

          a) 2 NF
          b) 3 NF
          c) BCNF
          d) 4NF
Solution :
           QA9- DBMS - Gate 2004 - CS
Question 5 : 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: r is the rename operator).
             Q5- DBMS - Gate 2004 - CS
             
          a) names of girl students with the highest marks
          b) names of girl students with more marks than some boy
             student
          c) names of girl students with marks not less than some boy
             students
          d) names of girl students with more marks than all the boy
             students
Solution :
          (d) is the right answer.
          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. 

           QA 5 DBMS Questions Gate 2004    
Question 6 : The order of an internal node in a B+ tree index is the
             maximum number of children it can have. Suppose that a
             child pointer takes 6 bytes, the search field value
             takes 14 bytes, and the block size is 512 bytes. What
             is the order of the internal node?

          a) 24
          b) 25
          c) 26
          d) 27
Solution :
          Size of Child Pointer = 6 Byte
          Size of Search Field values takes 14 Bytes
          Block Size = 512 Bytes
          The order of internal node = P ⇒ (P-1) (14+P*6) ≤ 512
          P = 26
Question 7 : 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

          a) the average salary is more than the average salary in
             the company
          b) the average salary of male employees is more than the
             average salary of all male employees in the company
          c) the average salary of male employees is more than the
             average salary of employees in the same department
          d) the average salary of male employees is more than the
             average salary in the company
Solution :
          QA7- DBMS - Gate 2004 - CS
     

Incoming search terms:

  • flow control on ddl gate questions
  • retrieve roll no of student who got more marks department wise in relational algebra

Leave a Reply