1
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6

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
2
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
A relational database contains two table student and department in which student table has columns roll_no, name and dept_id and department table has columns dept_id and detp_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 (1, ‘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;
A
0 row and 4 columns
B
3 rows and 4 columns
C
3 rows and 5 columns
D
6 rows and 5 columns
3
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
Consider two tables in a relational database with columns and rows as follows:

 Table: Student

Roll_no Name Dept_id
1 ABC 1
2 DEF 1
3 GHI 2
4 JKL 3

 Table: Department

Dept_id Dept_name
1 A
2 B
3 C

Roll_no is the primary key of the Student table, Dept_id is the primary key of the Department table and Studetn.Dept_id is a foreign key from
Department. Dept_id.

What will happen if we try to execute the following two SQL statements?
(i) update Student set Dept_id = Null where Roll_no =1
(ii) update Department set Dept_id = Null where Dept_id =1
A
Both (i) and (ii) will fail
B
(i) will fail but (ii) will succeed
C
(i) will succeed but (ii) will fail
D
Both (i) and (ii) will succeed
4
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
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?
A
$$\prod\nolimits_D {\left( {{r_2}} \right)} - \prod\nolimits_C {\left( {{r_1}} \right)} $$
B
$$\prod\nolimits_C {\left( {{r_1}} \right)} - \prod\nolimits_D {\left( {{r_2}} \right)} $$
C
$$\prod\nolimits_D {\left( {{r_1}{ \Join _{C \ne D}}{r_2}} \right)} $$
D
$$\prod\nolimits_C {\left( {{r_1}{ \Join _{C = D}}{r_2}} \right)} $$
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12