Friday, October 09, 2020

Database Management System Multiple choice questions

1) In the context of data warehousing, data map or ‘data about data’ is known as …………….
a) tuple
b) attribute
c) metadata
d) teradata

2) Which of the following normal form deals with the anomaly of multivalue dependency?
a) 1NF
b) 2NF
c) 4NF
d) 5NF

3) Which of the following normal form deals with the repeating group anomaly?
a) 1NF
b) 2NF
c) 4NF
d) 5NF

4) …………… is a database language used to define data structures in SQL?
a) Sybase
b) Oracle
c) DDL
d) MySQL

5) The ………………… is a database file that contains metadata.
a) data index
b) data repository
c) data dictionary
d) none

6)Which of the following is not the state of a transaction in the database?
a) Active
b) Committed
c) Terminated
d) Nullified

7) The …………… file saves the recovery scenario in Quick Test Professional (QTP) environment
a) QRS
b) JPEG
c) DOC
d) TSR

8) Which of the following is not a command is SQL?
a) WHERE
b) ORDER BY
c) REMOVE
d) SELECT

9) How should we traverse an oracle database to retrieve a row in the quickest possible time?
a) Full table scan
b) Unique index
c) Primary key
d) Table access by row id

10) Which of the following is a concurrency control protocol?
a) Locked-based protocol
b) two-phase locking protocol
c) Timestamp ordering protocol
d) all

11) Which of the following normal forms deals with the anomaly of partial functional dependency on the composite key?
a) 1NF
b) 2NF
c) 4NF
d) 5NF

12) ………………… represents the structure of the database in a formal language acceptable by the DBMS.
a) Database schema
b) ER diagram
c) Database table
d) None

13) Which of the following statements are used to create indexes in the database?
a) CREATE INDEX
b) BUILD INDEX
c) WRITE INDEX
d) None’

14)Which of the following is a database recovery technique?
a) Check-pointing
b) Transaction rollback
c) Shadow paging
d) All

15)Which of the following is a foreing key constraint?
a)Referential integrity
b) Domain integrity
c) Entity integrity
d) All

16) Which of the following trains are important to select a primary key?
a) Unique
b) Not Null
c) Fully functional dependency
d) Indexed
e) All

17) What are various types of DBMS?
a) ORBDMS
b) Client server DBMS
c) Distributed DBMS
d) OODBMS
e) All

18) Which of the following are the types of integrity constraints enforced by RDBMS?
a) Entity integrity
b) Domain integrity
c) Referential integrity
d) All

19) The data model which describes how the data is actually stored is :
a) internal model
b) external model
c) logical model
d) none of these

20) Data about data is normally termed as :
a) directory
b) data bank
c) meta data
d) none of the above

21. In an object-oriented model, one object can access data of another object by passing:
a. Instance variable
b. Message
c. Variable
d. None of these

22. A view of database that appears to an application program is known as:
a. Schema
b. Subschema
c. virtual table
d. none of the above

23. An abstraction concept for building composite object from their component object is called:
a. Specialization
b. Normalization
c. Generalization
d. Aggregation

24. A set of objects that share a common structure and
a common behavior is called:
a. Object
b. Class
c. Entity
d. None of these

25. Every weak entity set can be converted into a strong entity set by:
a. using generalization
b. adding appropriate attributes
c. using aggregation
d. none of the above

26. The number of entities to which another entity can be associated via a relationship set is expressed as:
a. Entity
b. Cardinality
c. Schema
d. Attributes

27. Relations produced from an E-R model will always be in:
a. First normal form
b. Second normal form
c. Third normal form
d. Fourth normal form

28. In ER model the details of the entities are hidden from the user. This process is called:
a. Generalization
b. Specialization
c. Abstraction
d. none of these above

29. The file organization that provides very fast access to any arbitrary record of a file is:
a. Ordered file
b. Unordered file
c. Hashed file
d. B-tree

30. What is not true about a view?
a. It is a definition of a restricted portion of the database
b. It is a security mechanism
c. It is always updatable like any other table
d. All are true

31. In a relational database a referential integrity constraint can be specified with the help of
a. primary key
b. foreign key
c. secondary key
d. none of the above

32. A super key is a set of one or more attributes that, taken collectively, allow us
a. to identify uniquely an entity in the entityset
b. to make the key most powerful for fasterretrieval
c. to increase effectiveness of database access
d. none of the above

33. 4NF is designed to cope with:
a. Transitive dependency
b. Join dependency
c. Multi valued dependency
d. None of these

34. Every Boyee-Codd normal form is in
a. First normal form
b. Second normal form
c. Third normal form
d. All of the above

35. Which command is used to remove all rows from a table?
a. Delete
b. Remove
c. Truncate
d. Both [A] and [B]

36. Which of the following is an aggregate function in SQL?
a. Union
b. Like
c. Group By
d. Max

37. Which command is used to add a column to an existing table?
a. Create
b. Update
c.Alter
d. None of these

38. A deadlock exists in the system if and only if the wait for graph:
a. has a cycle in it
b. has a path from first node to last node
c. is a tree
d. none of the above

39. Rollback of transactions is normally used to:
a. recover from transaction failure
b. update the transaction
c. retrieve old records
d. repeat a transaction

40. Prevention of access to the database by unauthorized users is referred to as:
a. Integrity
b. Productivity
c. Security
d. Reliability

Algorithms Multiple choice questions

 1.Algorithm is a ________________.
 Processing of problem
 Step by Step method to solve a problem
 Graphical method
 None of the above

2.Algorithm should have _______________ or more output.
 Zero
 One
 Two
 Three

3.Which is correct according to increasing order of growth rate
 n, n! , nlogn , n^2 , n^3 , n^5 , 2^n
 nlogn , n^2 , n^3 , n^5 , 2^n , n!
 n , nlogn , n^2 , n^3 , n^5 , 2^n , n!
 n , nlogn , n^2 , n^3 , n^5 ,  n!, 2^n

4.Big Oh! notation looks for____________ value.
 Maximum
 Minimum
 Average
 Mean

5.Omega (Ω) notation looks for ___________ value.
 Maximum
 Minimum
 Average
 Mean

6.A function which calls itself is called __________ function.
 Null
 Default
 Recursive
 Non recursive

7. _____________ method is used to solve recurrence.
 Main
 Major
 Divide
 Master

8.Time complexity of binary search is _____________.
 O(n)
 O(logn)
 O(nlogn)
 None of the above

9.The condition for applying binary search is _______________.
 Elements should be sorted
 Elements should be unsorted
 Elements should have priority
 None of the above

10.best case of binary search, the searching element is at _______________ position.
 First
 Second
 Last
 Middle

11.The __________________of an algorithm is the amount of computer time it needs to run to completion.
 Time complexity
 Space complexity
 Time period
 None of the above

12.The minimum number of comparisons required finding the minimum and maximum of 100 numbers is ________
 99
 100
 101
 None of the above

13.Divide and Merge operation is done in ____________.
 Binary search
 Merge sort
 Quicksort
 Heap sort

14.Which sort takes an extra array.
 Binary search
 Merge sort
 Quicksort
 Heap sort

15.Recurrence equation of merge sort is _______________.
 T(n) = T(n/2) + O(n)
 T(n) = 2T(n/2) + O(n)
 T(n) = 3T(n/2) + O(n)
 None of the above

16.Pivot element is used in ___________ sort.
 Binary search
 Mergesort
 Quick sort
 Heap sort

17.Partition operation is done in _____________ sort.
 Binary search
 Mergesort
 Quick sort
 Heap sort

18.Quick sort algorithm is an example of
 Greedy
 Improved search
 Dynamic Programming
 Divide and Conquer

19.Time complexity of merge sort is ___________.
 O(n)
 O(logn)
 O(nlogn)
 None of the above

20.Time complexity of quick sort is depends on _____________.
 O(n)
 O(logn)
 O(nlogn)
 None of the above

21.Merge sort uses which of the following technique to implement sorting?
 Backtracking
 Greedy algorithm
 Divide and conquer
 Dynamic programming

22.What is the average case time complexity of merge sort ?
 O(n log n)
 O(n^2)
 O(n^2log n)
 O(n log n2)

23.What is the auxiliary space complexity of merge sort?
 O(1)
 O(log n)
 O(n)
 O(n log n)

24.Merge sort can be implemented using O(1) auxiliary space.
 True
 False

25.What is the worst case time complexity of merge sort?
 O(n log n)
 O(n^2)
 O(n^2 log n)
 O(n logn2 )

26.Which of the following method is used for sorting in merge sort?
 Merging
 Partitioning
 Selection
 Exchanging

27.What will be the best case time complexity of merge sort ?
 O(n log n)
 O(n2)
 O(n2 logn)
 O(n logn2)

28. Which of the following is not a variant of merge sort ?
 In-place merge sort
 Bottom up merge sort
 Top down merge sort
 Linear merge sort

29.Choose the incorrect statement about merge sort from the following?
 It is a comparison based sort
 It is an adaptive algorithm
 It is not an in place algorithm
 It is stable algorithm

30.Which of the following is not in place sorting algorithm?
 Merge sort
 Quick sort
 Heap sort
 Insertion sort

31.Which of the following is not a stable sorting algorithm?
 Quick sort
 Cocktail sort
 Bubble sort
 Merge sort

32.Which of the following stable sorting algorithm takes the least time when applied to an almost sorted array?
 Quick sort
 Insertion sort
 Selection sort
 Merge sort

33.Merge sort is preferred for arrays over linked lists.
 True
 False

34.Which of the following sorting algorithm makes use of merge sort?
 Tim sort
 Intro sort
 Bogo sort
 Quick sort

35.Choose the correct code for merge sort.
 void merge_sort(int arr[], int left, int right) { if (left > right) { int mid = (right-left)/2; merge_sort(arr, left, mid); merge_sort(arr, mid+1, right); merge(arr, left, mid, right); //function to merge sorted arrays } }
 void merge_sort(int arr[], int left, int right) { if (left < right) { int mid = left+(right-left)/2; merge_sort(arr, left, mid); merge_sort(arr, mid+1, right); merge(arr, left, mid, right); //function to merge sorted arrays } }
 void merge_sort(int arr[], int left, int right) { if (left < right) { int mid = left+(right-left)/2; merge(arr, left, mid, right); //function to merge sorted arrays merge_sort(arr, left, mid); merge_sort(arr, mid+1, right); } }
 void merge_sort(int arr[], int left, int right) { if (left < right) { int mid = (right-left)/2; merge(arr, left, mid, right); //function to merge sorted arrays merge_sort(arr, left, mid); merge_sort(arr, mid+1, right); } }

36. Which of the following sorting algorithm does not use recursion?
 Quick sort
 Merge sort
 Heap sort
 Bottom up merge sort

37.Which of the following sorting algorithms is the fastest ?
 Merge sort
 Quick sort
 Insertion sort
 Shell sort

38.Quick sort follows Divide-and-Conquer strategy.
 True
 False

39.What is the worst case time complexity of a quick sort algorithm?
 O(N)
 O(N log N)
 O(N^2 )
 O(log N)

40.Which of the following methods is the most effective for picking the pivot element ?
 First element
 Last element
 Median-of-three partitioning
 Random element

41.Find the pivot element from the given input using median-of-three partitioning method. 8, 1, 4, 9, 6, 3, 5, 2, 7, 0.
 8
 7
 9
 6

42.Which is the safest method to choose a pivot element ?
 Choosing a random element as pivot
 Choosing the first element as pivot
 Choosing the last element as pivot
 Median-of-three partitioning method

43.What is the average running time of a quick sort algorithm ?
 O(N^2 )
 O(N)
 O(N log N)
 O(log N)

44.Which of the following sorting algorithms is used along with quick sort to sort the sub arrays?
 Merge sort
 Shell sort
 Insertion sort
 Bubble sort

45.Quick sort uses join operation rather than merge operation.
 True
 False

46.How many sub arrays does the quick sort algorithm divide the entire array into?
 One
 Two
 Three
 Four

47.Which is the worst method of choosing a pivot element ?
 First element as pivot
 Last element as pivot
 Median-of-three partitioning
 Random element as pivot

48.Which among the following is the best cut-off range to perform insertion sort within a quick sort ?
 N=0-5
 N=5-20
 N=20-30
 N>30

49.Recursion is a method in which the solution of a problem depends on ____________
 Larger instances of different problems
 Larger instances of the same problem
 Smaller instances of the same problem
 Smaller instances of different problems

50.Which of the following problems can’t be solved using recursion?
 Factorial of a number
 Nth fibonacci number
 Length of a string
 Problems without base case

Search Aptipedia