Database MCQ Number 00873

Database MCQ Set 1

1. Which level of RAID refers to disk mirroring with block striping?
a) RAID level 1
b) RAID level 2
c) RAID level 0
d) RAID level 3

Answer

Answer: a [Reason:] RAID (redundant array of independent disks) is a way of storing the same data in different places (thus, redundantly) on multiple hard disks.

2. A unit of storage that can store one or more records in a hash file organization is denoted as
a) Buckets
b) Disk pages
c) Blocks
d) Nodes

Answer

Answer: a [Reason:] A unit of storage that can store one or more records in a hash file organization is denoted as buckets.

3. The file organization which allows us to read records that would satisfy the join condition by using one block read is
a) Heap file organization
b) Sequential file organization
c) Clustering file organization
d) Hash file organization

Answer

Answer: c [Reason:] All systems in the cluster share a common file structure via NFS, but not all disks are mounted on all other systems.

4. What are the correct features of a distributed database?
a) Is always connected to the internet
b) Always requires more than three machines
c) Users see the data in one global schema.
d) Have to specify the physical location of the data when an update is done

Answer

Answer: c [Reason:] Users see the data in one global schema.

5. Each tablespace in an Oracle database consists of one or more files called
a) Files
b) name space
c) datafiles
d) PFILE

Answer

Answer: c [Reason:] A data file is a computer file which stores data to use by a computer application or system.

6. The management information system (MIS) structure with one main computer
system is called a
a) Hierarchical MIS structure
b) Distributed MIS structure
c) Centralized MIS structure
d) Decentralized MIS structure

Answer

Answer: c [Reason:] Structure of MIS may be understood by looking at the physical components of the information system in an organization.

7. A top-to-bottom relationship among the items in a database is established by a
a) Hierarchical schema
b) Network schema
c) Relational schema
d) All of the mentioned

Answer

Answer: a [Reason:] A hierarchical database model is a data model in which the data is organized into a tree-like structure. The structure allows representing information using parent/child relationships.

8. Choose the RDBMS which supports full fledged client server application development
a) dBase V
b) Oracle 7.1
c) FoxPro 2.1
d) Ingress

Answer

Answer: b [Reason:] RDBMS is Relational DataBase Management System.

9. One approach to standardization storing of data?
a) MIS
b) Structured programming
c) CODASYL specification
d) None of the mentioned

Answer

Answer: c [Reason:] CODASYL is an acronym for “Conference on Data Systems Languages”.

10. The highest level in the hierarchy of data organization is called
a) Data bank
b) Data base
c) Data file
d) Data record

Answer

Answer: b [Reason:] Database is a collection of all tables which contains the data in form of fields.

Database MCQ Set 2

1. We can use the following three rules to find logically implied functional dependencies. This collection of rules is called
a) Axioms
b) Armstrong’s axioms
c) Armstrong
d) Closure

Answer

Answer: b [Reason:] By applying these rules repeatedly, we can find all of F+, given F.

2. Which of the following is not a Armstrong’s Axiom ?
a) Reflexivity rule
b) Transitivity rule
c) Pseudotransitivity rule
d) Augmentation rule

Answer

Answer: c [Reason:] It is possible to use Armstrong’s axioms to prove that Pseudotransitivity rule is sound.

3. The relation employee(ID,name,street,Credit,street,city,salary) is decomposed into

employee1 (ID, name)
employee2 (name, street, city, salary)

This type of decomposition is called
a) Lossless decomposition
b) Lossless-join decomposition
c) Both a and b
d) None of the mentioned

Answer

Answer: d [Reason:] Lossy-join decomposition is the decomposition used here .

4. Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into

instructor (ID, name, dept name, salary)
department (dept name, building, budget)

This comes under
a) Lossy-join decomposition
b) Lossy decomposition
c) Lossless-join decomposition
d) Both a and b

Answer

Answer: d [Reason:] Lossy-join decomposition is the decomposition used here .

5. There are two functional dependencies with the same set of attributes on the left side of the arrow:
A->BC
A->B
This can be combined as
a) A->BC
b) A->B
c) B->C
d) None of the mentioned

Answer

Answer: a [Reason:] This can be computed as the canonical cover .

6. Consider a relation R(A,B,C,D,E) with the following functional dependencies:

ABC -> DE and
D -> AB

The number of superkeys of R is:
a) 2
b) 7
c) 10
d) 12

Answer

Answer: c [Reason:] A superkey is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table.

7. Suppose we wish to find the ID’s of the employees that are managed by people who are managed by the employee with ID 123. Here are two possible queries:

I.SELECT ee.empID
  FROM Emps ee, Emps ff
  WHERE ee.mgrID = ff.empID AND ff.mgrID = 123;
II.SELECT empID
  FROM Emps 
  WHERE mgrID IN
  (SELECT empID FROM Emps WHERE mgrID = 123);

Which, if any, of the two queries above will correctly (in SQL2) get the desired set of employee ID’s?
a) Both I and II
b) I only
c) II only
d) Neither I nor I

Answer

Answer: a [Reason:] The query can be satisfied by any of the two options.

8. Suppose relation R(A,B) currently has tuples {(1,2), (1,3), (3,4)} and relation S(B,C) currently has {(2,5), (4,6), (7,8)}. Then the number of tuples in the result of the SQL query:

<i>SELECT *
FROM R NATURAL OUTER JOIN S; </i>IS:

a) 2
b) 4
c) 6
d) None of the mentioned

Answer

Answer: a [Reason:] The SQL NATURAL JOIN is a type of EQUI JOIN and is structured in such a way that, columns with same name of associate tables will appear once only.

9. Suppose now that R(A,B) and S(A,B) are two relations with r and s tuples, respectively (again, not necessarily distinct). If m is the number of (not necessarily distinct) tuples in the result of the SQL query:

R intersect S;

Then which of the following is the most restrictive, correct condition on the value of m?

(a) m = min(r,s)
(b) 0 <= m <= r + s
(c) min(r,s) <= m <= max(r,s)
(d) 0 <= m <= min(r,s)

Answer

Answer: d [Reason:] The value of m must lie between the min value of r and s and 0.

10. Suppose relation R(A,B,C,D,E) has the following functional dependencies:

A -> B
B -> C
BC -> A
A -> D
E -> A
D -> E

Which of the following is not a key?
a) A
b) E
c) B,C
d) D

Answer

Answer: c [Reason:] Here the keys are not formed by B and C.

Database MCQ Set 3

1.

 Create function dept count(dept_name varchar(20))
begin
declare d count integer;
select count(*) into d count
from instructor
where instructor.dept_name= dept_name
return d count;
end

Find the error in the the above statement .
a) Return type missing
b) Dept_name is mismatched
c) Reference relation is not mentioned
d) All of the mentioned

Answer

Answer: a [Reason:] Return integer should be given after create function for this particular function .

2. For the function created in Question 1 ,which of the following is a proper select statement ?

a) SELECT dept name, budget
FROM instructor
WHERE dept COUNT() > 12;
b) SELECT dept name, budget
FROM instructor
WHERE dept COUNT(dept name) > 12;
c) SELECT dept name, budget
WHERE dept COUNT(dept name) > 12;
d) SELECT dept name, budget
FROM instructor
WHERE dept COUNT(budget) > 12;
Answer

Answer: b [Reason:] The count of the dept_name must be checked for the displaying from instructor relation.

3. Which of he following is used to input the entry and give the result in a variable in a procedure ?
a) Put and get
b) Get and put
c) Out and In
d) In and out

Answer

Answer: d [Reason:] Create procedure dept count proc(in dept name varchar(20), out d count integer).Here in and out refers to input and result of procedure.

4.

Create procedure dept_count proc(in dept name varchar(20),
out d count integer)
begin
select count(*) into d count
from instructor
where instructor.dept name= dept count proc.dept name
end

Which of the following is used to call the procedure given above ?
a) Declare d_count integer;
b) Declare d_count integer;
call dept_count proc(’Physics’, d_count);
c) Declare d_count integer;
call dept_count proc(’Physics’);
d) Declare d_count;
call dept_count proc(’Physics’, d_count);

Answer

Answer: b [Reason:] Here the ‘Physics’ is in variable and d_count is out variable.

5. The format for compound statement is
a) Begin ……. end
b) Begin atomic……. end
c) Begin ……. repeat
d) Both Begin ……. end and Begin atomic……. end

Answer

Answer: d [Reason:] A compound statement is of the form begin . . . end, and it may contain multiple SQL statements between the begin and the end.A compound statement of the form begin atomic . . . end ensures that all the statements contained within it are executed as a single transaction.

6.

Repeat
sequence of statements;
______
end repeat

Fill in the correct option :
a) While Condition
b) Until variable
c) Until boolean expression
d) Until 0

Answer

Answer: c [Reason:] None.

7. Which of the following is the correct format for if statement ?
a) If boolean expression
then statement or compound statement
elseif boolean expression
then statement or compound statement
else statement or compound statement
end if
b) If boolean expression
then statement or compound statement
elsif boolean expression
then statement or compound statement
else statement or compound statement
end if
c) If boolean expression
then statement or compound statement
elif boolean expression
then statement or compound statement
else statement or compound statement
end if
d) If boolean expression
then statement or compound statement
else
statement or compound statement
else statement or compound statement
end if

Answer

Answer: a [Reason:] The conditional statements supported by SQL include if-then-else statements by using this syntax.elif and elsif are not allowed.

8. A stored procedure in SQL is a_____
a) Block of functions
b) Group of Transact-SQL statements compiled into a single execution plan.
c) Group of distinct SQL statements.
d) None of the mentioned

Answer

Answer: b [Reason:] If it a atomic statement then the statements are in single transaction.

9. Temporary stored procedures are stored in ___ database.
a) Master
b) Model
c) User specific
d) Tempdb

Answer

Answer: d [Reason:] None.

10. Declare out of classroom seats condition

DECLARE exit handler FOR OUT OF classroom seats
BEGIN
SEQUENCE OF statements
END

The above statements are used for
a) Calling procedures
b) Handling Exception
c) Handling procedures
d) All of the mentioned

Answer

Answer: b [Reason:] The SQL procedural language also supports the signaling of exception conditions, and declaring of handlers that can handle the exception, as in this code.

Database MCQ Set 4

1. 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

Answer

Answer: a [Reason:] Hashing is also a method of sorting key values in a database table in an efficient manner.

2. A technique for direct search is
a) Binary Search
b) Linear Search
c) Tree Search
d) Hashing

Answer

Answer: d [Reason:] Hashing is one way to enable security during the process of message transmission when the message is intended for a particular recipient only.

3. The searching technique that takes O (1) time to find a data is
a) Linear Search
b) Binary Search
c) Hashing
d) Tree Search

Answer

Answer: c [Reason:] A formula generates the hash, which helps to protect the security of the transmission from unauthorized users.

4. 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

Answer

Answer: a [Reason:] Time complexity is given by the big oh notation.

5. 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

Answer

Answer: b [Reason:] A formula generates the hash, which helps to protect the security of the transmission from unauthorized users.

6. 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

Answer

Answer: b [Reason:] Hashing is used to index and retrieve items in a database because it is easier to find the item using the shortened hashed key than using the original value.

7. Key value pairs is usually seen in
a) Hash tables
b) Heaps
c) Both Hash tables and Heaps
d) Skip list

Answer

Answer: a [Reason:] Hashing is used to index and retrieve items in a database because it is easier to find the item using the shortened hashed key than using the original value.

8. 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

Answer

Answer: a [Reason:] This level is the root of the tree.

9. 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

Answer

Answer: a [Reason:] If all keys hash to the same location then the i-th inserted key would need i lookups to be found. The probability of looking up i-th key is 1/n (since it’s random). If you know some probability it’s trivial to show that such lookups have linear time.

10. Breadth First Search is used in
a) Binary trees
b) Stacks
c) Graphs
d) All of the mentioned

Answer

Answer: c [Reason:] Hashing is used to index and retrieve items in a database because it is easier to find the item using the shortened hashed key than using the original value.

Database MCQ Set 5

1. In concurrency control policy the the lock is obtained on
a) Entire database
b) A particular transaction alone
c) All the new elements
d) All of the mentioned

Answer

Answer: a [Reason:] It is to avoid deadlock.

2. A concurrency-control policy such as this one leads to ______ performance, since it forces transactions to wait for preceding transactions to finish before they can start.
a) Good
b) Average
c) Poor
d) Unstable

Answer

Answer: c [Reason:] It provides a poor degree of concurrency.

3. ____ are used to ensure that transactions access each data item in order of the transactions’ ____ if their accesses conflict.
a) Zone
b) Relay
c) Line
d) Timestamps

Answer

Answer: d [Reason:] When this is not possible, offending transactions are aborted and restarted with a new timestamp.

4. EMPDET is an external table containing the columns EMPNO and ENAME. Which command would work in relation to the EMPDET table?

a) UPDATE empdet
SET ename = 'Amit'
WHERE empno = 1234;
b) DELETE FROM empdet
WHERE ename LIKE 'J%';
c) CREATE VIEW empvu
AS
SELECT * FROM empdept;
d) CREATE INDEX
empdet_idx
ON empdet(empno);
Answer

Answer: c [Reason:] View is the temporary space created for the database.

5. In which scenario would you use the ROLLUP operator for expression or columns within a GROUP BY clause?
a) To find the groups forming the subtotal in a row
b) To create group-wise grand totals for the groups specified within a GROUP BY clause
c) To create a grouping for expressions or columns specified within a GROUP BY clause in one direction, from right to left for calculating the subtotals
d) To create a grouping for expressions or columns specified within a GROUP BY clause in all possible directions, which is cross-tabular report for calculating the subtotals

Answer

Answer: c [Reason:] View is the temporary space created for the database.

6.

Name Null? Type
Cust_id Not null Number(2)
Cust_Name Varchar2(15)

Evaluate the following SQL statements executed in the given order:

ALTER TABLE cust
ADD CONSTRAINT cust_id_pk PRIMARY KEY(cust_id) DEFERRABLE INITIALLY DEFERRED; INSERT
INTO cust VALUES (1,'RAJ'); --row 1
INSERT INTO cust VALUES (1,'SAM'); --row 2
COMMIT;
SET CONSTRAINT cust_id_pk IMMEDIATE;
INSERT INTO cust VALUES (1,'LATA'); --row 3
INSERT INTO cust VALUES (2,'KING'); --row 4
COMMIT;

Which rows would be made permanent in the CUST table?
a) row 4 only
b) rows 2 and 4
c) rows 3 and 4
d) rows 1 and 4

Answer

Answer: c [Reason:] View is the temporary space created for the database.

7. Which statement is true regarding external tables?
a) The default REJECT LIMIT for external tables is UNLIMITED
b) The data and metadata for an external table are stored outside the database
c) ORACLE_LOADER and ORACLE_DATAPUMP have exactly the same functionality when used with an external table
d) The CREATE TABLE AS SELECT statement can be used to unload data into regular table in the database from an external table

Answer

Answer: d [Reason:] This will replicate the table as in the select statement.

8. A non-correlated subquery can be defined as ______
a) A set of sequential queries, all of which must always return a single value
b) A set of sequential queries, all of which must return values from the same table
c) A SELECT statement that can be embedded in a clause of another SELECT statement only
d) A set of one or more sequential queries in which generally the result of the inner query is used as the search value in the outer query

Answer

Answer: d [Reason:] This will replicate the table as in the select statement.

9. Evaluate the following SQL statements in the given order:

DROP TABLE dept;
CREATE TABLE dept
(deptno NUMBER(3) PRIMARY KEY,
deptname VARCHAR2(10));
DROP TABLE dept;
FLASHBACK TABLE dept TO BEFORE DROP;

Which statement is true regarding the above FLASHBACK operation?
a) It recovers only the first DEPT table
b) It recovers only the second DEPT table
c) It does not recover any of the tables because FLASHBACK is not possible in this case
d) It recovers both the tables but the names would be changed to the ones assigned in the RECYCLEBIN

Answer

Answer: b [Reason:] This will replicate the table as in the select statement.

10.

CREATE TABLE digits
(id NUMBER(2),
description VARCHAR2(15));
INSERT INTO digits VALUES (1,'ONE');
UPDATE digits SET description ='TWO' WHERE id=1;
INSERT INTO digits VALUES (2,'TWO');
COMMIT;
DELETE FROM digits;
SELECT description FROM digits
VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE;

What would be the outcome of the above query?
a) It would not display any values
b) It would display the value TWO once
c) It would display the value TWO twice
d) It would display the values ONE, TWO, and TWO

Answer

Answer: c [Reason:] This will replicate the table as in the select statement.

ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.