A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

31. Student (school-id, sch-roll-no, sname, saddress)
School (school-id, sch-name, sch-address, sch-phone)
Enrolment(school-id sch-roll-no, erollno, examname)
ExamResult(erollno, examname, marks)

What does the following SQL query output?

SELECT sch-name, COUNT (*)
FROM School C, Enrolment E, ExamResult R
WHERE E.school-id = C.school-id
AND
E.examname = R.examname AND E.erollno = R.erollno
AND
R.marks = 100 AND S.school-id IN (SELECT school-id
FROM student
GROUP BY school-id
HAVING COUNT (*) > 200)
GROUP By school-id
a. for each school with more than 200 students appearing in exams, the name of the school and the number of 100s scored by its students
b. for each school with more than 200 students in it, the name of the school and the number of 100s scored by its students
c. for each school with more than 200 students in it, the name of the school and the number of its students scoring 100 in at least one exam
d. nothing; the query has a syntax error
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).nothing; the query has a syntax error

32. Given the basic ER and relational models, which of the following is INCORRECT?
a. An attribute of an entity can have more than one value
b. An attribute of an entity can be composite
c. In a row of a relational table, an attribute can have more than one value
d. In a row of a relational table, an attribute can have exactly one value or a NULL value
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).In a row of a relational table, an attribute can have more than one value

33. Consider a join (relation algebra) between relations r(R)and s(S) using the nested loop method. There are 3 buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming size(r(R)) < size(s(S)), the join will have fewer number of disk block accesses if
a. relation r(R) is in the outer loop
b. relation s(S) is in the outer loop
c. join selection factor between r(R) and s(S) is more than 0.5
d. join selection factor between r(R) and s(S) is less than 0.5
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).relation r(R) is in the outer loop

34. Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?
a. 2
b. 3
c. 4
d. 5
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).3

35. In a schema with attributes A, B, C, D and E following set of functional dependencies are given

A → B A → C CD → E B → D E → A

Which of the following functional dependencies is NOT implied by the above set?
a. CD → AC
b. BD → CD
c. BC → CD
d. AC → BC
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).BD → CD

36. A database of research articles in a journal uses the following schema.

(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)

The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional dependencies exist in the schema.

(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE

The database is redesigned to use the following schemas.

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)

Which is the weakest normal form that the new database satisfies, but the old one does not?
a. 1NF
b. 2NF
c. 3NF
d. BCNF
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).2NF

37. Which of the following relational query languages have the same expressive power?

1.Relational algebra
2.Tuple relational calculus restricted to safe expressions
3.Domain relational calculus restricted to safe expressions
a. II and III only
b. I and II only
c. I and III only
d. I, II and III
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).I, II and III

38. A Relation R with FD set {A->BC, B->A, A->C, A->D, D->A}. How many candidate keys will be there in R?
a. 1
b. 2
c. 3
d. 4
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).3

39. What is the min and max number of tables required to convert an ER diagram with 2 entities and 1 relationship between them with partial participation constraints of both entities?
a. Min 1 and max 2
b. Min 1 and max 3
c. Min 2 and max 3
d. Min 2 and max 2
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Min 2 and max 3

40. Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F = {CH -> G, A -> BC, B -> CFH, E -> A, F -> EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R. How many candidate keys does the relation R have?
a. 3
b. 4
c. 5
d. 6
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).4

Page 4 of 10