Database Set 2 (30 mcqs)

1. A relational database system needs to maintain data about the relations, such as the schema of the relations. This is called
a) Metadata
b) Catalog
c) Log
d) Dictionary

2 Which of the following is another name for weak entity?
a) Child
b) Owner
c) Dominant
d) All of the mentioned

3. ___________ is the collection of memory structures and Oracle background processes that operates against an Oracle database.
a) Database
b) Instance
c) Tablespace
d) Segment

4. A ________ is a logical grouping of database objects, usually to facilitate security, performance, or the availability of database objects such as tables and indexes.
a) Tablespace
b) Segments
c) Extents
d) Blocks

5. A tablespace is further broken down into ________
a) Tablespace
b) Segments
c) Extents
d) Blocks

6. __________ is a contiguous group of blocks allocated for use as part of a table, index, and so forth.
a) Tablespace
b) Segment
c) Extent
d) Block

7. ________ is the smallest unit of allocation in an Oracle database.
a) Database
b) Instance
c) Tablespace
d) Database Block

8. An Oracle __________ is a set of tables and views that are used as a read-only reference about the database.
a) Database dictionary
b) Dictionary table
c) Data dictionary
d) Dictionary

9. A data dictionary is created when a __________ created.
a) Instance
b) Segment
c) Database
d) Dictionary

10. An Oracle object type has two parts the _________ and__________
a) Instance and body
b) Segment and blocks
c) Specification and body
d) Body and segment

11. If h is any hashing function and is used to hash n keys in to a table of size m, where n<=m, the
expected number of collisions involving a particular key x is :
a) Less than 1
b) Less than n
c) Less than m
d) Less than n/2

12. A technique for direct search is
a) Binary Search
b) Linear Search
c) Tree Search
d) Hashing
.
13. The searching technique that takes O (1) time to find a data is
a) Linear Search
b) Binary Search
c) Hashing
d) Tree Search

14. The goal of hashing is to produce a search that takes
a) O(1) time
b) O(n2 )time
c) O(log n ) time
d) O(n log n ) time

15. Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Note that ‘_’ denotes an empty location in the table.
(A) 8, _, _, _, _, _, 10
(B) 1, 8, 10, _, _, _, 3
(C) 1, _, _, _, _, _,3
(D) 1, 10, 8, _, _, _, 3

16. A hash table can store a maximum of 10 records, currently there are records in location 1, 3,4,7,8,9,10. The probability of a new record going into location 2, with hash functions resolving collisions by linear probing is
a) 0.1
b) 0.6
c) 0.2
d) 0.5
.
17. Key value pairs is usually seen in
a) Hash tables
b) Heaps
c) Both a and b
d) Skip list

18. What is the best definition of a collision in a hash table?
a) Two entries are identical except for their keys.
b) Two entries with different data have the exact same key.
c) Two entries with different keys have the same exact hash value.
d) Two entries with the exact same key have different hash values.

19. Which of the following scenarios leads to linear running time for a random search hit in a linear-probing hash table?
a) All keys hash to same index
B) All keys hash to different indices
c) All keys hash to an even-numbered index
d) All keys hash to different even-numbered indices

20. Breadth First Search is used in
a) Binary trees
b) Stacks
c) Graphs
d) Both a and c above

21. The____condition allows a general predicate over the relations being joined.
a) On
b) Using
c) Set
d) Where

22. Which of the join operations do not preserve non matched tuples.
a) Left outer join
b) Right outer join
c) Inner join
d) Natural join

23. Select *
from student join takes using (ID);
The above query is equivalent to
a) Select *
from student inner join takes using (ID);
b) Select *
from student outer join takes using (ID);
c) Select *
from student left outer join takes using (ID);
d) Both a and b

24. What type of join is needed when you wish to include rows that do not have matching values?
a) Equi-join
b) Natural join
c) Outer join
d) All of the mentioned

25. How many tables may be included with a join?
a) One
b) Two
c) Three
d) All of the mentioned

26. Which are the join types in join condition:
a) Cross join
b) Natural join
c) Join with USING clause
d) All of the mentioned

27. How many join types in join condition:
a) 2
b) 3
c) 4
d) 5

28. Which join refers to join records from the right table that have no matching key in the left table are include in the result set:
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join

29. The operation which is not considered a basic operation of relational algebra is
a) Join
b) Selection
c) Union
d) Cross product

30. In SQL the statement select * from R, S is equivalent to
a) Select * from R natural join S
b) Select * from R cross join S
c) Select * from R union join S
d) Select * from R inner join S

Answers
1-a 2-a 3-b 4-a 5-b
6-c 7-d 8-c 9-c 10-c
11-a 12-d 13-c 14-a 15-b
16-b 17-a 18-a 19-a 20-c
21-a 22-c 23-a 24-c 25-d
26-d 27-d 28-b 29-a 30-b
Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *