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

GATE 2007

184 questions

MCQ 1841-mark 184

Questions 146–150 of 184

Q146Relational Algebra1 markMCQ−0.33 if wrong
Consider a selection of the form σA≤100(r)\sigma_{A\leq 100} (r), where r is a relation with 1000 tuples. Assume that the attribute values for A among the tuples are uniformly distributed in the interval [0, 500]. Which one of the following options is the best estimate of the number of tuples returned by the given selection query ?

Q147Relational Algebra1 markMCQ−0.33 if wrong
Information about a collection of students is given by the relation studinfo(studId‾\underline{studId}, name, sex). The relation enroll(studId, courseId) gives which student has enrolled for (or taken) what course(s). Assume that every course is taken by at least one male and at least one female student. What does the following relational algebra expression represent?
ΠcourseId((ΠstudId(σsex="female"(studInfo))×ΠcourseId(enroll))−enroll)\Pi_{\text{courseId}}\left(\left(\Pi_{\text{studId}}\left(\sigma_{\text{sex="female"}}(\text{studInfo})\right) \times \Pi_{\text{courseId}}(\text{enroll})\right) - \text{enroll}\right)

Q148Tuple Calculus1 markMCQ−0.33 if wrong
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?
{ e.name∣employee(e)∧(∀x)[¬ employee(x)∨x.supervisorName≠e.name∨x.sex="male"] }\{\, e.\text{name} \mid \text{employee}(e) \land (\forall x)\left[\neg\,\text{employee}(x) \lor x.\text{supervisorName} \neq e.\text{name} \lor x.\text{sex} = \text{"male"}\right] \,\}

Q149SQL1 markMCQ−0.33 if wrong
Consider the table employee(empId, name, department, salary) and the two queries Q1 ,Q2 below. Assuming that department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5, which one of the statements is TRUE for any arbitrary employee table?
Q1 : Select e.empId
     From employee e
     Where not exists
        (Select * From employee s where s.department = "5" and 
                                        s.salary >=e.salary) 
Q2 : Select e.empId From employee e Where e.salary > Any (Select distinct salary From employee s Where s.department ="5"

Q150Normal Form1 markMCQ−0.33 if wrong
Consider the following implications relating to functional and multivalued dependencies given below, which may or may not be correct.

i. if A→→BA \rightarrow \rightarrow B and A→→CA \rightarrow \rightarrow C then A→BCA \rightarrow BC
ii. if A→BA \rightarrow B and A→CA \rightarrow C then A→→BCA \rightarrow \rightarrow BC
iii. if A→→BCA \rightarrow \rightarrow BC and A→BA \rightarrow B then A→CA \rightarrow C
iv. if A→BCA \rightarrow BC and A→BA \rightarrow B then A→→CA \rightarrow \rightarrow C

Exactly how many of the above implications are valid?