Database MCQ Set 1
1. A _____ indicates an absent value that may exist but be unknown or that may not exist at all.
a) Empty tuple
b) New value
c) Null value
d) Old value
Answer
Answer: c [Reason:] None.
2. If the attribute phone number is included in the relation all the values need not be entered into the phone number column . This type of entry is given as
a) 0
b) –
c) Null
d) Empty space
Answer
Answer: c [Reason:] Null is used to represent absence of a value.
3. The predicate in a where clause can involve Boolean operations such as and.The result of true and unknown is_______ false and unknown is _____ while unknown and unknown is _____
a) Unknown, unknown, false
b) True, false, unknown
c) True, unknown, unknown
d) Unknown, false, unknown
Answer
Answer: d [Reason:] None.
4.
SELECT name FROM instructor WHERE salary IS NOT NULL; Selects
a) Tuples with null value
b) Tuples with no null values
c) Tuples with any salary
d) All of the mentioned
Answer
Answer: b [Reason:] Not null constraint removes the tpules of null values.
5. In a employee table to include the attributes whose value always have some value which of the following constraint must be used ?
a) Null
b) Not null
c) Unique
d) Distinct
Answer
Answer: b [Reason:] Not null constraint removes the tpules of null values.
6. Using the ______ clause retains only one copy of such identical tuples.
a) Null
b) Unique
c) Not null
d) Distinct
Answer
Answer: d [Reason:] Unique is a constraint.
7.
CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL); INSERT INTO employee VALUES (1005,Rach,0); INSERT INTO employee VALUES (1007,Ross, ); INSERT INTO employee VALUES (1002,Joey,335);
Some of these insert statements will produce an error. Identify the statement.
a) Insert into employee values (1005,Rach,0);
b) Insert into employee values (1002,Joey,335);
c) Insert into employee values (1007,Ross, );
d) None of the mentioned
Answer
Answer: c [Reason:] Not null constraint is specified which means sone value (can include 0 also) should be given.
8. The primary key must be
a) Unique
b) Not null
c) Both Unique and Not null
d) Either Unique or Not null
Answer
Answer: c [Reason:] Primary key must satisfy unique and not null condition for sure.
9. You attempt to query the database with this command:
SELECT nvl (100 / quantity, NONE) FROM inventory;
Why does this statement cause an error when QUANTITY values are null?
a) The expression attempts to divide by a null value
b) The data types in the conversion function are incompatible
c) The character string none should be enclosed in single quotes (‘ ‘)
d) A null value used in an expression cannot be converted to an actual value
Answer
Answer: a [Reason:] The expression attempts to divide by a null value is errorneous in sql.
10. The result of _____unknown is unknown.
a) Xor
b) Or
c) And
d) Not
Answer
Answer: d [Reason:] Since unknown does not hold any value the value cannot have a reverse value.
Database MCQ Set 2
1. OLAP stands for
a) Online analytical processing
b) Online analysis processing
c) Online transaction processing
d) Online aggregate processing
Answer
Answer: a [Reason:] OLAP is the manipulation of information to support decision making .
2. Data that can be modeled as dimension attributes and measure attributes are called _______ data.
a) Multidimensional
b) Singledimensional
c) Measured
d) Dimensional
Answer
Answer: a [Reason:] Given a relation used for data analysis, we can identify some of its attributes as measure attributes, since they measure some value, and can be aggregated upon.Dimension attribute define the dimensions on which measure attributes, and summaries of measure attributes, are viewed.
3. The generalization of cross-tab which is represented visually is ______ which is also called as data cube.
a) Two dimensional cube
b) Multidimensional cube
c) N-dimensional cube
d) Cuboid
Answer
Answer: a [Reason:] Each cell in the cube is identified for the values for the three dimensional attributes.
4. The process of viewing the cross-tab (Single dimensional) with a fixed value of one attribute is
a) Slicing
b) Dicing
c) Pivoting
d) Both Slicing and Dicing
Answer
Answer: a [Reason:] The slice operation selects one particular dimension from a given cube and provides a new sub-cube. Dice selects two or more dimensions from a given cube and provides a new sub-cube.
5. The operation of moving from finer-granularity data to a coarser granularity (by means of aggregation) is called a ________
a) Rollup
b) Drill down
c) Dicing
d) Pivoting
Answer
Answer: a [Reason:] The opposite operation—that of moving fromcoarser-granularity data to finer-granularity data—is called a drill down.
6. In SQL the cross-tabs are created using
a) Slice
b) Dice
c) Pivot
d) All of the mentioned
Answer
Answer: a [Reason:] Pivot (sum(quantity) for color in (’dark’,’pastel’,’white’)) .
7.
{ (item name, color, clothes size), (item name, color), (item name, clothes size), (color, clothes size), (item name), (color), (clothes size), () }
This can be achieved by using which of the following ?
a) group by rollup
b) group by cubic
c) group by
d) none of the mentioned
Answer
Answer: d [Reason:] ‘Group by cube’ is used .
8. What do data warehouses support?
a) OLAP
b) OLTP
c) OLAP and OLTP
d) Operational databases
Answer
Answer: a [Reason:] None .
9.
SELECT item name, color, clothes SIZE, SUM(quantity) FROM sales GROUP BY rollup(item name, color, clothes SIZE);
How many grouping is possible in this rollup?
a) 8
b) 4
c) 2
d) 1
Answer
Answer: b [Reason:] { (item name, color, clothes size), (item name, color), (item name), () } .
10. Which one of the following is the right syntax for DECODE ?
a) DECODE (search, expression, result [, search, result]… [, default])
b) DECODE (expression, result [, search, result]… [, default], search)
c) DECODE (search, result [, search, result]… [, default], expression)
d) DECODE (expression, search, result [, search, result]… [, default])
Answer
Answer: d [Reason:] None.
Database MCQ Set 3
1. In ordered indices the file containing the records is sequentially ordered, a _____ is an index whose search key also defines the sequential order of the file.
a) Clustered index
b) Structured index
c) Unstructured index
d) Nonclustered index
Answer
Answer: a [Reason:] Clustering index are also called primary indices; the term primary index may appear to denote an index on a primary key, but such indices can in fact be built on any search key.
2. Indices whose search key specifies an order different from the sequential order of the file are called _____ indices.
a) Nonclustered
b) Secondary
c) All of the mentioned
d) None of the mentioned
Answer
Answer: c [Reason:] Nonclustering index are also called secondary indices.
3. An ______ consists of a search-key value and pointers to one or more records with that value as their search-key value.
a) Index entry
b) Index hash
c) Index cluster
d) Index map
Answer
Answer: a [Reason:] The pointer to a record consists of the identifier of a disk block and an offset within the disk block to identify the record within the block.
4. In a _______ clustering index, the index record contains the search-key value and a pointer to the first data record with that search-key value and the rest of the records will be in the sequential pointers.
a) Dense
b) Sparse
c) Straight
d) Continuous
Answer
Answer: a [Reason:] In a dense nonclustering index, the index must store a list of pointers to all records with the same search-key value.
5. In a ____ index, an index entry appears for only some of the search-key values.
a) Dense
b) Sparse
c) Straight
d) Continuous
Answer
Answer: a [Reason:] Sparse indices can be used only if the relation is stored in sorted order of the search key, that is, if the index is a clustering index.
6. Incase the indices values are larger, index is created for these values of index. This is called
a) Pointed index
b) Sequential index
c) Multilevel index
d) Multiple index
Answer
Answer: c [Reason:] Indices with two or more levels are called multilevel indices.
7. A search key containing more than one attribute is referred to as a ___ search key.
a) Simple
b) Composite
c) Compound
d) Secondary
Answer
Answer: b [Reason:] The structure of the index is the same as that of any other index, the only difference being that the search key is not a single attribute, but rather is a list of attributes.
8. In B+ tree the node which points to another node is called
a) Leaf node
b) External node
c) Final node
d) Internal node
Answer
Answer: d [Reason:] Nonleaf nodes are also referred to as internal nodes.
9. Insertion of a large number of entries at a time into an index is referred to as ____ of the index.
a) Loading
b) Bulk insertion
c) Bulk loading
d) Increase insertion
Answer
Answer: c [Reason:] Bulk loading is used to improve the efficiency and scalability.
10. While inserting the record into the index, if the search-key value does not appear in the index.
a) The system adds a pointer to the new record in the index entry
b) The system places the record being inserted after the other records with the same search-key values
c) The system inserts an index entry with the search-key value in the index at the appropriate position
d) None of the mentioned
Answer
Answer: c [Reason:] If the index entry stores pointers to all records with the same search key value, the system adds a pointer to the new record in the index entry.
Database MCQ Set 4
1. A(n) ___ can be used to preserve the integrity of a document or a message.
a) Message digest
b) Message summary
c) Encrypted message
d) None of the mentioned
Answer
Answer: c [Reason:] Encryption algorithms are used to keep the contents safe.
2. A hash function must meet ________ criteria.
a) Two
b) Three
c) Four
d) None of the mentioned
Answer
Answer: b [Reason:] Only if the criteria is fulfilled the values are hashed.
3. What is the main limitation of Hierarchical Databases?
a) Limited capacity (unable to hold much data)
b) Limited flexibility in accessing data
c) Overhead associated with maintaining indexes
d) The performance of the database is poor
Answer
Answer: b [Reason:] In this the data items are place in a tree like hierarchical structure.
4. The property (or set of properties) that uniquely defines each row in a table is called the:
a) Identifier
b) Index
c) Primary key
d) Symmetric key
Answer
Answer: c [Reason:] Primary is used to uniquely identify the tuples.
5. The separation of the data definition from the program is known as:
a) Data dictionary
b) Data independence
c) Data integrity
d) Referential integrity
Answer
Answer: b [Reason:] Data dictionary is the place where the meaning of the data are organized.
6. In the client / server model, the database:
a) Is downloaded to the client upon request
b) Is shared by both the client and server
c) Resides on the client side
d) Resides on the server side
Answer
Answer: d [Reason:] The server has all the database information and the client access it.
7. The traditional storage of data that is organized by customer, stored in separate folders in filing cabinets is an example of what type of ‘database’ system?
a) Hierarchical
b) Network
c) Object oriented
d) Relational
Answer
Answer: a [Reason:] Hierarchy is based on Parent-Child Relationship. Parent-Child Relationship Type is basically 1:N relationship.
8. The database design that consists of multiple tables that are linked together through matching data stored in each table is called
a) Hierarchical database
b) Network database
c) Object oriented database
d) Relational database
Answer
Answer: d [Reason:] A relational database is a collection of data items organized as a set of formally described tables from which data can be accessed or reassembled.
9. The association role defines:
a) How tables are related in the database
b) The relationship between the class diagram and the tables in the database
c) The tables that each attribute is contained
d) Which attribute is the table’s primary key
Answer
Answer: a [Reason:] The tables are always related in the database to form consistency.
10. The purpose of an N-Ary association is:
a) To capture a parent-child relationship
b) To deal with one to many relationships
c) To deal with relationships that involve more than two tables
d) To represent an inheritance relationship
Answer
Answer: c [Reason:] The is binary n-array association meaning more than two classes are involved in the relationship.
Database MCQ Set 5
1. Which of the following is a physical storage media ?
a) Tape Storage
b) Optical Storage
c) Flash memory
d) All of the mentioned
Answer
Answer: d [Reason:] The storage media are classified by the speed with which data can be accessed, by the cost per unit of data to buy the medium, and by the medium’s reliability.
2. The ___ is the fastest and most costly form of storage, which is relatively small; its use is managed by the computer system hardware.
a) Cache
b) Disk
c) Main memory
d) Flash memory
Answer
Answer: a [Reason:] Cache storage is easy to access because it is closer to the processor.
3. Which of the following stores several gigabytes of data but usually lost when power failure?
a) Flash memory
b) Disk
c) Main memory
d) Secondary memory
Answer
Answer: c [Reason:] The contents of main memory are usually lost if a power failure or system crash occurs.
4. The flash memory storage used are
a) NOR Flash
b) OR Flash
c) AND Flash
d) All of the mentioned
Answer
Answer: a [Reason:] NAND flash has a much higher storage capacity for a given cost, and is widely used for data storage in devices such as cameras, music players, and cell phones.
5. ____ is increasingly being used in server systems to improve performance by caching frequently used data, since it provides faster access than disk, with larger storage capacity than main memory.
a) Flash memory
b) Disk
c) Main memory
d) Secondary memory
Answer
Answer: a [Reason:] Flash memory is of two types – NAND and NOR.
6. Which is the cheapest memory device in terms of costs/bit ?
a) Semiconductor memory
b) Magnetic disks
c) Compact disks
d) Magnetic tapes
Answer
Answer: c [Reason:] Compact disk is used for easy storage at lower cost .
7. The primary medium for the long-term online storage of data is the ____ where the entire database is stored on magnetic disk.
a) Semiconductor memory
b) Magnetic disks
c) Compact disks
d) Magnetic tapes
Answer
Answer: b [Reason:] The system must move the data from disk to main memory so that they can be accessed .
8. Optical disk _______ systems contain a few drives and numerous disks that can be loaded into one of the drives automatically (by a robot arm) on demand.
a) Tape Storage
b) Jukebox
c) Flash memory
d) All of the mentioned
Answer
Answer: b [Reason:] The most popular form of optical disks are CD and DVD.
9. There are “record-once” versions of compact disk and digital video disk, which can be written only once; such disks are also called ____ disks.
a) Write-once, read-many (WORM)
b) CD-R
c) DVD-W
d) CD-ROM
Answer
Answer: a [Reason:] There are also “multiple-write” versions of compact disk (called CD-RW) and digital video disk (DVD-RW, DVD+RW, and DVD-RAM), which can be written multiple times.
10. Tape storage is referred to as ____ storage.
a) Direct-access
b) Random-access
c) Sequential-access
d) All of the mentioned
Answer
Answer: c [Reason:] Tape storage is used primarily for backup and archival data.