GATE 2004 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2004

199 questions

MCQ 1991-mark 199

Questions 151–155 of 199

Q151SQL1 markMCQ−0.33 if wrong
A table T1 in a relational database has the following rows and columns:

Roll no. Marks1102203304NULL\begin{array}{|c|c|c|} \hline \text {Roll no. } & \text {Marks} \\\hline 1& 10 \\\hline 2 & 20 \\\hline3 & 30 \\\hline 4 & \text{NULL}\\\hline \end{array}

The following sequence of SQL statements was successfully executed on table T1.
 Update T1 set marks = marks + 5
Select avg(marks) from T1
What is the output of the select statement?

Q152SQL1 markMCQ−0.33 if wrong
A relational database contains two tables student and department in which student table has columns roll_no, name and dept_id and department table has columns dept_id and dept_name. The following insert statements were executed successfully to populate the empty tables:
Insert into department values (1, 'Mathematics')
Insert into department values (2, 'Physics')
Insert into student values (l, 'Navin', 1)
Insert into student values (2, 'Mukesh', 2)
Insert into student values (3, 'Gita', 1)
How many rows and columns will be retrieved by the following SQL statement?
Select * from student, department 

Q153SQL1 markMCQ−0.33 if wrong
The employee information in a company is stored in the relation

Employee (name‾\underline{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

Q154SQL1 markMCQ−0.33 if wrong
Consider the following relation schema pertaining to a students database:

Students (rollno‾\underline{rollno}, name, address)
Enroll (rollno‾\underline{rollno} ,courseno‾\underline{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?

Q155Normal Form1 markMCQ−0.33 if wrong
A relation Empdtl is defined with attributes empcode (unique), name, street, city, state and pincode. For any pincode, there is only one city and state. Also, for any given street, city and state, there is just one pincode. In normalization terms, Empdtl is a relation in