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.

71. Consider the following ORACLE relations:

One (x, y) = {<2, 5>, <1, 6>, <1, 6>, <1, 6>, <4, 8>, <4, 8>}
Two (x, y) = {<2, 55>, <1, 1>, <4, 4>, <1, 6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>}

Consider the following two SQL queries SQ1 and SQ2:

SQ1 : SELECT * FROM One)
EXCEPT
(SELECT * FROM Two);

SQ2 : SELECT * FROM One)
EXCEPT ALL
(SELECT * FROM Two);

For each of the SQL queries, what is the cardinality (number of rows) of the result obtained when applied to the instances above?
a. 2 and 1 respectively
b. 1 and 2 respectively
c. 2 and 2 respectively
d. 1 and 1 respectively
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).1 and 2 respectively

72. Which one of the following pairs is correctly matched in the context of database design?

List – I                                       List – II
(Database term)                      (Definition)

I. Specialization                       A. Result of taking the union of two or more
disjoint (lower-level) entity sets to produce
a higher-level entity set.
II. Generalization                    B. Express the number of entities to which another
entity can be associated via a relationship set.
III. Aggregation                       C. Result of taking a subset of a higher-level
entity set to form a lower-level entity set.
IV. Mapping cardinalities      D. An abstraction in which relationship sets (along
with their associated entity sets) are treated as
higher-level entity sets, and can participate in
relationships.
Codes :
      I    II   III   IV
a. D  A   B   C
b. D  C   B   A
c. C  D   A   B
d. C  A   D   B
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).C  A   D   B

73. Consider a hash table of size m = 10000, and the hash function h(K)=floor(m(KAmod1)) for A = (√5 – 1)/2. The key 123456 is mapped to location ...............
a. 46
b. 41
c. 43
d. 48
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).41

74. Which of the following statements concerning Object-Oriented databases is FALSE?
a. Objects in an object-oriented database contain not only data but also methods for processing the data.
b. Object-oriented databases store computational instructions in the same place as the data.
c. Object-oriented databases are more adapt at handling structures (analytical) data than relational databases.
d. Object-oriented databases store more types of data than relational databases and access that data faster.
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Object-oriented databases are more adapt at handling structures (analytical) data than relational databases.

75. In distributed databases, location transparency allows for database users, programmers and administrators to treat the data as if it is at one location. A SQL query with location transparency needs to specify:
a. Inheritances
b. Fragments
c. Locations
d. Local formats
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Fragments

76. Consider the relations R(A,B) and S(B,C) and the following four relational algebra queries over R and S:

I. πA,B(R⋈S)
II. R⋈πB(S)
III. R∩(πA(R) Χ πB(S))
IV. πA,R.B(R Χ S) where R.B refers to the column B in table R.

One can determine that:
a. I, III and IV are the same query.
b. II, III and IV are the same query.
c. I, II and IV are the same query.
d. I, III and III are the same query.
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).I, III and III are the same query.

77. Which of the following statements is TRUE?

D1: The decomposition of the schema R(A,B,C) into R1(A,B) and R2(A,C) is always lossless.
D2: The decomposition of the schema R(A,B,C,D,E) having AD→B, C→DE, B→AE, AE→C into R1(A,B,D) and R2(A,C,D,E) is lossless.
a. Both D1 and D2
b. Neither D1 and D2
c. Only D1
d. Only D2
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).Only D2

78. Consider the following ORACLE relations:

R(A,B,C) = {<1,2,3>, <1,2,0>, <1,3,1>, <6,2,3>, <1,4,2>, <3,1,4>}
S(B,C,D) = {<2,3,7>, <1,4,5>, <1,2,3>, <2,3,4>, <3,1,4>}

Consider the following two SQL queries SQ1 and SQ2:

SQ1: SELECT R.B, AVG(S.B)
FROM R, S
WHERE R.A = S.C AND S.D < 7
GROUP BY R.B;

SQ2: SELECT DISTINCT S.B, MIN (S.C)
FROM S
GROUP BY S.B
HAVING COUNT (DISTINCT S.D) > 1;

If M is the number of tuples returned by SQ1 and N is the number of tuples returned by SQ2 then
a. M=4, N=2
b. M=5, N=3
c. M=2, N=2
d. M=3, N=3
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).M=4, N=2

79. Semi-join strategies are techniques for query processing in distributed database system. Which of the following is a semi-join technique?
a. Only the joining attributes are sent from one site to another and then all of the rows are returned.
b. All of the attributes are sent from one site to another and then only the required rows are returned.
c. Only the joining attributes are sent from one site to another and then only the required rows are returned.
d. All of the attributes are sent from one site to another and then only the required rows are returned.
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Only the joining attributes are sent from one site to another and then only the required rows are returned.

80. Consider a “CUSTOMERS” database table having a column “CITY” filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have “GAR” somewhere in its name, is:
a. Select *from customers where city=’%GAR%’;
b. Select *from customers where city=’$GAR$’;
c. Select *from customers where city like ‘%GAR%’;
d. Select *from customers where city as ’%GAR’;
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Select *from customers where city like ‘%GAR%’;