0% found this document useful (0 votes)
64 views83 pages

Complete RDBMS Questions

Uploaded by

uzma.latif452
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views83 pages

Complete RDBMS Questions

Uploaded by

uzma.latif452
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 83

RDBMS Questions and relation that is a primary key of another

relation
Answers – Introduction to d) A foreign key is the primary key of a
the Relational Model relation that does not occur anywhere
else in the schema
This set of RDBMS Multiple Choice View Answer
Questions & Answers (MCQs) focuses Answer: c
on “Introduction to the Relational Explanation: A foreign key is an attribute of
Model”. a relation that is initially a primary key of
another relation. A foreign key usage
1. Choose the correct statement preserves referential integrity.
regarding superkeys 4. What action does ⋈ operator perform
a) A superkey is an attribute or a group
in relational algebra
of multiple attributes that can uniquely a) Output specified attributes from all
identify a tuple
rows of the input relation and remove
b) A superkey is a tuple or a set of duplicate tuples from the output
multiple tuples that can uniquely identify
b) Outputs pairs of rows from the two
an attribute input relations that have the same value
c) Every superkey is a candidate key on all attributes that have the same
d) A superkey is an attribute or a set of name
attributes that distinguish the relation c) Output all pairs of rows from the two
from other relations input relations (regardless of whether or
View Answer not they have the same values on
Answer: a common attributes)
Explanation: A superkey is an attribute or a d) Return rows of the input relation that
set of multiple attributes that can uniquely satisfy the predicate
identify a tuple. It is used to differentiate View Answer
between tuples.
2. What is an Instance of a Database? Answer: a
a) The logical design of the database Explanation: ⋈ Outputs specified attributes
system from all rows of the input relation. Remove
duplicate tuples from the output. The
b) The entire set of attributes of the
operation is called the join operation.
Database put together in a single
5. What does the “x” operator do in
relation
relational algebra?
c) The state of the database system at
a) Output specified attributes from all
any given point of time
rows of the input relation. Remove
d) The initial values inserted into the
duplicate tuples from the output
Database immediately after its creation
b) Output pairs of rows from the two
View Answer
input relations that have the same value
Answer: c on all attributes that have the same
Explanation: The state of the database name
system at any given point of time is called c) Output all pairs of rows from the two
as an Instance of the database. input relations (regardless of whether or
3. What is a foreign key? not they have the same values on
a) A foreign key is a primary key of a common attributes)
relation which is an attribute in another d) Returns the rows of the input relation
relation that satisfy the predicate
b) A foreign key is a superkey of a View Answer
relation which is an attribute in more
than one other relations Answer: c
c) A foreign key is an attribute of a Explanation: The “x” operator outputs all
pairs of rows from the two input relations join of book and borrow wherever the
(regardless of whether or not they have the year is lesser than 2009
same values on common attributes). This c) Selects all the tuples from the natural
operation is called as the Cartesian product join of book and student wherever the
operation and is similar to the Cartesian
year is greater than or equal to 2009
product of sets.
d) Selects all tuples from the Cartesian
6. An attribute is a __________ in a
product of book and borrow wherever
relation.
the year is greater than or equal to 2009
a) Row
View Answer
b) Column
c) Value Answer: b
d) Tuple Explanation: The condition under the select
View Answer statement represents the condition that must
be satisfied by the tuples and the symbol ⋈
Answer: b represents natural join between the two
Explanation: An attribute is a column in a relations on either side of the operator.
relation. A tuple is a row in a relation. 10. State true or false: If a relation
7. What is the method of specifying a consists of a foreign key, then it is called
primary key in a schema description? a referenced relation of the foreign key
a) By writing it in bold letters dependency.
b) By underlining it using a dashed line a) True
c) By writing it in capital letters b) False
d) By underlining it using a bold line View Answer
View Answer
Answer: b
Answer: d Explanation: If a relation has a foreign key,
Explanation: We can specify a primary key then it is called a referencing relation of the
in schema description by underlining the foreign key dependency.
respective attribute with a bold line.
8. Statement 1: A tuple is a row in a
relation RDBMS Questions and
Statement 2: Existence of multiple
foreign keys in a same relation is
Answers – SQL Data
possible definition
a) Both the statements are true
b) Statement 1 is correct but Statement This set of RDBMS Multiple Choice
2 is false Questions & Answers (MCQs) focuses
c) Statement 1 is false but Statement 2 on “SQL Data Definition”.
is correct 1. Which of the following information
d) Both the statements are false does an SQL DDL not specify?
View Answer a) The schema for each relation
Answer: a b) The integrity constraints
Explanation: A tuple is a row is a relation. c) The operations on the tuples
There can exist multiple foreign keys in the d) The security and authorization
same relation because there can exist information for each relation
multiple attributes in the relation that are View Answer
primary keys in two or more other relations.
9. Choose the option that correctly Answer: c
explains in words, the function of the Explanation: The SQL DDL does not specify
following relational algebra expression the operations that are supposed to be
made on the tuples. DDL means Data
σyear≥2009 (book ⋈ borrow)
definition language, hence it does not
a) Selects all tuples from the Cartesian include the operations made.
product of book and borrow 2. Which of the following data types
b) Selects all the tuples from the natural does the SQL standard not support?
a) char(n) database?
b) String(n) a) drop table R
c) varchar(n) b) drop relation R
d) float(n) c) delete table R
View Answer d) delete from R
View Answer
Answer: b
Explanation: The SQL standard does not Answer: a
support String(n) but it supports char, Explanation: The drop table command is
varchar and float. used to delete a relation from a database
3. Which command is used to create a whereas the delete table removes all the
new relation in SQL tuples from a relation
a) create table( , …) 7. Which of the following commands do
b) create relation( , …) we use to delete all the tuples from a
c) new table( , …) relation (R)?
d) new relation( , …) a) delete table R
View Answer b) drop table R
c) delete from R
Answer: a
d) drop from R
Explanation: We use the create table
command to create a new relation in the
View Answer
database. The syntax is Answer: c
create table( , …); Explanation: The delete from command is
4. If a1, a2, a3 are attributes in a relation used to delete all the tuples in a relation.
and S is another relation, which of the The drop table totally deletes a relation.
following is an incorrect specification of 8. Choose the correct command to
an integrity constraint? delete an attribute A from a relation R
a) primary key(a1, a2, a3) a) alter table R delete A
b) primary key(a1) b) alter table R drop A
c) foreign key(a1, a2) references S c) alter table drop A from R
d) foreign key(a1, a2) d) delete A from R
View Answer View Answer
Answer: d Answer: b
Explanation: Whenever the integrity Explanation: We can delete an attribute from
constraint foreign key is mentioned, the a relation using the alter table command
attributes that are the foreign keys should with the following syntax
always be referenced from the relation in alter table drop
which they are primary keys. 9. create table apartment(ownerID
5. What is the syntax to load data into varchar (5), ownername varchar(25),
the database? (Consider D as the floor numeric(4,0), primary key
database and a, b, c as data) (ownerID));
a) enter into D (a, b, c); Choose the correct option regarding the
b) insert into D values (a, b, c); above statement
c) insert into D (a, b, c); a) The statement is syntactically wrong
d) insert (a, b, c) values into D; b) It creates a relation with three
View Answer attributes ownerID, ownername, floor in
Answer: b
which floor cannot be null.
Explanation: To load data into a database c) It creates a relation with three
we use the insert into command. The syntax attributes ownerID, ownername, floor in
is which ownerID cannot be null.
insert into D values (a, b, c) where a, b, c d) It creates a relation with three
are the appropriate values attributes ownerID, ownername, floor in
6. Which of the following commands do which ownername must consist of at
we use to delete a relation (R) from a
least 25 characters. d) include
View Answer View Answer
Answer: c Answer: a
Explanation: It creates a relation apartment Explanation: The “all” keyword is used
with three attributes as specified. The beside the select clause to explicitly specify
attribute ownername cannot be null because that duplicates are not removed.
it is the primary key of the relation. 3. Which of the following logical
10. What does the notnull integrity connectives is not included in SQL?
constraint do? a) and
a) It ensures that at least one tuple is b) or
present in the relation c) nor
b) It ensures that at least one foreign d) not
key is present in the relation View Answer
c) It ensures that all tuples have a finite
Answer: d
value on a specified attribute
Explanation: “not” is not a logical connective
d) It ensures that all tuples have finite included in the SQL. The and, or and nor
attributes on all the relations are logical connectives that are included in
View Answer SQL.
Answer: c 4. The where clause is a predicate
Explanation: The notnull integrity constraint involving attributes of the relation in the
ensures that all the tuples have a finite value ______ clause.
on the specified attribute in the relation. It a) select
avoids the specification of null values. b) from
c) with
d) none of the mentioned
RDBMS Questions and View Answer
Answers – Basic Operations Answer: b
Explanation: The “from” clause contains the
This set of RDBMS Multiple Choice attribute names on which the “which” clause
Questions & Answers (MCQs) focuses can be used on.
on “Basic Operations”. 5. select distinct dept_name
1. Which of the following syntax of the from institute;
basic query is correct? What does the above query do?
a) select <relation> from <attribute> a) It gives all the tuples having a distinct
b) select <attribute> from <elation> dept_name
c) select <tuple> from <relation> b) It gives the dept_name attribute
d) select <tuple> from <attribute> values of all tuples without repetition
View Answer c) It gives all the dept_name attribute of
Answer: b all the tuples
Explanation: The select clause is used to d) It gives all the tuples having a null
select a specific attribute from a given value under the dept_name attribute
relation. So, the syntactically correct View Answer
statement is select <attribute> from
<relation>. Answer: b
Explanation: The distinct keyword is used to
2. Which of the following keywords is
explicitly force the elimination of duplicate
used beside the select clause to tuples. Thus, the above query excludes
explicitly specify that duplicates are not duplicates.
removed? 6. What does the following query do?
a) all select name, ID, branch
b) not unique from student, department
c) notnull where student.branch =
department.branch; 9. State true or false: Multiple conditions
a) It gives all values of name, ID, branch in the where clause are separated by a
from both the relations only if all those “,”
attributes are present in both a) True
b) It gives all values of name, ID, branch b) False
from their respective relations View Answer
c) It gives the values of name, ID,
Answer: b
branch from their respective relations Explanation: Multiple conditions in the where
where the values in the branch attribute clause are separated by the “and” keyword.
are same 10. What does the natural join operation
d) It gives the values of name, ID, do?
branch from their respective relations a) It considers only those pairs of tuples
where all the values are matching with that have the same value on those
each other attributes that appear in the schemas of
View Answer both relations
Answer: c b) It considers only those pairs of tuples
Explanation: student.branch = that have the same value on at least one
department.branch verifies whether both the of the attributes that appear in the
values of the attributes are same in both the schemas of both the relations
relations and returns the value. c) It considers only those pairs of tuples
7. The ________ clause is used to list that do not have the same value on
the attributes desired in the result of a those attributes that appear in the
query schemas of both relations
a) select d) None of the mentioned
b) from View Answer
c) where
d) create Answer: a
Explanation: The natural join operation
View Answer
considers only those pairs of tuples that
Answer: a have the same value on those attributes that
Explanation: The select clause is used to list appear in the schemas of both the relations.
the attributes desired in the result of a The natural join operation operates on 2
query. relations and gives a relation as the result.
8. If we specify multiple relations in the 11. Observe the following query and
from clause and do not specify any choose the correct option.
conditions in the where clause, what will select name, ID
the result be? from student natural join department
a) The natural join of both the relations natural join section
b) The left outer join of both the relations a) The query is syntactically wrong
c) A syntactical error because there is no where clause
d) The Cartesian product of both the b) The query is syntactically wrong
relations because there are more than one
View Answer attributes in the select clause
c) The query is syntactically wrong
Answer: d
because more than one relations are
Explanation: If we specify multiple relations
in the from clause and do not specify any
included in the natural join operation
conditions in the where clause, the default d) The query is correct
definition given by the from clause is the View Answer
Cartesian product of the relations listed in Answer: d
the clause. So it returns all the possible Explanation: The query is syntactically
combinations of the tuples of the two correct because, where clause is not
relations. necessary in a query, more than one
attributes can be specified in the select
clause and more than one relations may be Answer: b
operated on, using the natural join operator. Explanation: The union operation combines
advertisement the results of two different queries which
have the same set of attributes in the select
12. Which keyword is used to rename a clause. It automatically eliminates
relation in a query? duplicates.
a) rename 2. What is the function of the intersect
b) as operation?
c) is a) It returns the intersection of the
d) to results of the results of any two different
View Answer queries
b) It returns the intersection of the
Answer: b
Explanation: The “as” keyword is used to results of two different queries which
rename a relation in a query. This is used have the same set of attributes in the
for convenience as long relation names can select clause
reduce readability. c) It returns the intersection of the
13. While operating with strings, what results of two different queries which
does “_ _ _%” match with? have the same condition in the where
a) A string of three letters clause
b) A string of at least three letters d) None of the mentioned
c) A string of three words View Answer
d) A string of at least three words Answer: b
View Answer Explanation: The intersect operation returns
Answer: a the intersection of the results of the results
Explanation: The string in the question of two different queries which have the
matches with a string having at least three same set of attributes in the select clause. It
letters. The first three blank spaces indicate automatically eliminates duplicates.
three letters whereas the percentage 3. What is the function of the except
indicates indefinite spaces after that. operation?
a) It excludes all the results present in
both the queries
RDBMS Questions and b) It includes the results of the second
Answers – Set Operations query but excludes the results of the first
query
This set of RDBMS Multiple Choice c) It includes the results of the first query
Questions & Answers (MCQs) focuses but excludes the results of the second
on “Set Operations”. query
d) It includes all the results of both
1. What is the function of the union queries but removes duplicates
operation? View Answer
a) It combines the results of any two
different queries Answer: c
b) It combines the results of two different Explanation: The except operation includes
the results of the first query but excludes the
queries which have the same set of results of the second query. It automatically
attributes in the select clause eliminates duplicates but if we want to retain
c) It combines the results of two different duplicates we must use except all in place of
queries which have the same condition except.
in the where clause 4. When does the predicate is null
d) It gives the Cartesian product of the succeed?
results of any 2 queries a) If the value on which it is applied is
View Answer finite
b) If the value on which it is applied is
invalid
c) If the value on which it is applied is a) All the values of the studentid for
blank which section is c and roll < 10
d) If the value on which it is applied is b) All the values of the studentid for
more than the allowed limit which section is c and roll > 10
View Answer c) All the values of the studentid for
which section not c and roll < 10
Answer: c
Explanation: The is null predicate succeeds
d) All the values of the studentid for
when the value on which it is applied is which section not c and roll > 10
blank/null. View Answer
5. Using the _______ clause retains Answer: b
only one copy of identical tuples Explanation: The except operation excludes
a) distinct all the tuples that are present in the result of
b) is not null the second query from the result of the first
c) no repeat query. It also excludes all duplicates from
d) from the relation.
View Answer advertisement

Answer: a 8. Which of the following correctly


Explanation: Specifying the distinct clause describes the between predicate in the
beside the select clause retains only one where clause?
copy of identical tuples resulting from the a) It is used to check whether a value is
query. in between two specified values
6. Observe the following query and b) It is used to check whether a value is
choose the correct option exactly in the center of the relation
SELECT DISTINCT name alphabetically
FROM student c) It is used to check whether a value is
WHERE ID IS NOT NULL; in between any two other values in the
database
a) The query is syntactically wrong
d) None of the mentioned
b) The query gives all the possible
View Answer
student names where a finite value
exists for ID Answer: a
c) The query gives the names of the Explanation: The between predicate in the
students that have a null ID and it also where clause is used to check whether a
excludes identical names value is in between two externally specified
d) The query gives the student names values. This clause is used to list out all
tuples having a value within a range.
where a finite value exists for ID and it
excludes identical names
View Answer RDBMS Questions and
Answer: d Answers – Aggregate
Explanation: The distinct keyword is used to
remove tuples that have identical values. Functions
The is not null clause checks only for ID’s
that are not null values. This set of RDBMS Multiple Choice
7. What will be the result of the following Questions & Answers (MCQs) focuses
query? on “Aggregate Functions”.
(SELECT studentid 1. Which of the following is not a built in
FROM student aggregate function in SQL?
WHERE SECTION = 'c') a) avg
EXCEPT
(SELECT studentid
b) max
FROM student c) total
WHERE roll &lt;10);
d) count willing to apply the aggregate function to a
View Answer group of sets of tuples.
5. Choose the correct option regarding
Answer: c the query
Explanation: SQL does not include total as a
built in aggregate function. The avg is used SELECT branch_name, COUNT (DISTINCT
to find average, max is used to find the customer_name)
maximum and the count is used to count the FROM depositor, account
number of values. WHERE depositor.account_number =
2. Observe the given SQL query and account.account_number
choose the correct option. GROUP BY branch_id
HAVING avg(balance) = 10000;
SELECT branch_name, COUNT (DISTINCT
customer_name) a) The having clause checks whether
FROM depositor, account the query result is true or not
WHERE depositor.account_number = b) The having clause does not check for
account.account_number any condition
GROUP BY branch_id c) The having clause allows only those
a) The query is syntactically correct but tuples that have average balance 10000
gives the wrong answer d) None of the mentioned
b) The query is syntactically wrong View Answer
c) The query is syntactically correct and Answer: c
gives the correct answer Explanation: The having clause is used to
d) The query contains one or more check for conditions that need to be set on
wrongly named clauses. aggregate functions.
View Answer 6. The _____ aggregation operation
adds up all the values of the attribute
Answer: b a) add
Explanation: The query is syntactically
b) avg
wrong. The attribute in the group by clause
must be one of the attributes specified in the c) max
select clause. d) sum
3. State true or false: SQL does not View Answer
permit distinct with count(*) Answer: d
a) True Explanation: The sum aggregation operation
b) False adds up all the values of the specified
View Answer attribute. There does not exist any
aggregation such as add.
Answer: a 7. State true or false: Any attribute which
Explanation: SQL does not permit distinct
is present in the having clause without
with count(*) but the use of distinct is
allowed with max and min. being aggregated must not be present in
4. We apply the aggregate function to a the group by clause.
group of sets of tuples using the a) True
_______ clause. b) False
a) group by View Answer
b) group Answer: b
c) group set Explanation: Any attribute which is present
d) group attribute in the having clause without being
View Answer aggregated must be present in the group by
clause. Otherwise, the query is considered
Answer: a to be erroneous.
Explanation: We apply the aggregate 8. State true or false: We can rename
function to a group of sets of tuples using the resulting attribute after the
the group by clause. The group by clause
aggregation function has been applied
must always be used whenever we are
a) True
b) False externally specified which can be used
View Answer to handle data in queries
d) A subquery is a condition that
Answer: a
Explanation: Yes, we can rename the
excludes all the invalid tuples from the
resulting attribute after the aggregation database
function has been applied by using a View Answer
specific keyword. Answer: a
advertisement
Explanation: A subquery is a select-from-
where expression that is nested within
9. Which keyword is used to rename the
another query. Common uses for sub-
resulting attribute after the application of queries are to perform tests for set
the aggregation function? membership, make set comparisons etc.
a) rename 2. If a set is a collection of values given
b) as by the select clause, The ______
c) replace connective tests for set membership
d) to a) within
View Answer b) include
Answer: b c) under
Explanation: The “as” keyword is used to d) in
rename the resulting attribute after the View Answer
aggregation function has been applied. Just
like any other renaming operation, the as Answer: d
keyword simplifies the name of the relation. Explanation: The in connective is used to
test for the membership in a set, where the
10. What values does the count(*)
set is a collection of values given by the
function ignore? select clause.
a) Repetitive values 3. State true or false : Nested
b) Null values Subqueries cannot be used for
c) Characters comparing two different sets
d) Integers a) True
View Answer b) False
Answer: b View Answer
Explanation: The count(*) aggregation
Answer: b
function ignores null values while calculating
Explanation: Nested Subqueries can be
the number of values in a particular
used for comparing two different sets. Set
attribute.
comparison is an important function of the
nested sub-queries.
RDBMS Questions and 4. What is the result of the following
query?
Answers – Nested SELECT studname
Subqueries FROM college
WHERE marks &gt; SOME (SELECT marks
This set of RDBMS Multiple Choice
Questions & Answers (MCQs) focuses FROM student
on “Nested SubQueries”. WHERE
SECTION = 'c');
1. What is a subquery?
a) A subquery is a select-from-where a) The query gives all the studnames for
expression that is nested within another which marks are greater than all the
query students in section c
b) A subquery is any query that is b) The query gives all the studnames for
nested within another query which the marks are greater than at
c) A subquery is a relation that is least on student in section c
c) The query gives all the studnames for 8. The _________ construct returns true
which the marks are less than all the if the argument in the sub-query is void
students in section c of duplicates
d) The query is syntactically incorrect a) not null
View Answer b) not unique
c) unique
Answer: b
Explanation: The “some” comparison is
d) null
used to check for at least one condition. The View Answer
> symbol is used to test whether the marks Answer: unique
are greater than the right hand side or not. Explanation: The unique construct returns
5. The ________ comparison checker is true if the argument in the sub-query is void
used to check “each and every” of duplicates. The not null construct avoids
condition the specification of null values into the
a) all attribute.
b) and 9. State true or false: We can use
c) every Subqueries inside the from clause
d) each a) True
View Answer b) False
View Answer
Answer: a
Explanation: The all comparison checker is Answer: a
used to check “each and every” condition. Explanation: SQL allows the use of
The “each” and “every” comparison Subqueries inside the from clause. The
checkers do not exist in SQL. subquery used in the from clause must have
6. The ______ construct returns true if a in its result the attributes that are specified
given tuple is present in the subquery. in the select clause.
a) not exists 10. Choose the correct option regarding
b) present the following query
c) not present advertisement
d) exists
View Answer WITH max_marks (VALUE) AS
(SELECT MAX(marks)
Answer: d FROM student)
Explanation: The exists construct returns SELECT studentID
true if a given tuple is present in the FROM student,max_marks
subquery. The not exists construct gives WHERE student.marks =
true if a given tuple is not present in the max_marks.value;
subquery.
7. What is a correlated sub-query? a) The query is syntactically wrong
a) An independent query that uses the b) The query gives the studentID of the
correlation name of another independent student with the maximum marks
query. c) The query gives the maximum marks
b) A sub-query that uses the correlation amongst all the students
name of an outer query d) The query gives all the studentID
c) A sub-query that substitutes the values except the student with the
names of the outer query maximum marks
d) A sub-query that does not depend on View Answer
its outer query’s correlation names Answer: b
View Answer Explanation: The query gives the studentID
with the maximum marks because the
Answer: b
max(marks) aggregation gives the maximum
Explanation: A correlated sub-query is the
of the marks.
one that uses the correlation name of an
outer query. 11. SQL subqueries that can occur
wherever a value is permitted provided
the subquery gives only one tuple with a DELETE FROM student
single attribute are called _________ WHERE marks &lt; (SELECT avg(marks)
a) Exact Subqueries FROM
student);
b) Vector Subqueries
c) Positive Subqueries a) The query deletes all the tuples
d) Scalar Subqueries whose marks are greater than the
View Answer average marks
Answer: d b) The query deletes all the tuples
Explanation: SQL subqueries that can occur whose marks are less than the average
wherever a value is permitted provided the marks
subquery gives only one tuple with a single c) The query deletes all the values
attribute are called Scalar subqueries. under the marks attribute which are less
Scalar Subqueries can be used in the SQL than the average
update statement when they are used under d) The query is syntactically wrong and
the set clause. does not execute
View Answer
RDBMS Questions and Answer: b
Explanation: The query deletes all the tuples
Answers – Modification of from the student relation as per the
Database condition specified in the where clause i.e.
wherever the marks are less than average
This set of RDBMS Interview Questions marks.
and Answers focuses on “Modification of 4. What is the format of entering date
Database”. into a database while inserting data into
it?
1. Insert the appropriate key word in the a) YYYY-MM-DD
blank in the query ( A is a relation) b) “YYYY-MM-DD”
delete ______ A c) ‘YYYY-MM-DD’
where P < 5; d) “DD-MM-YYYY”
a) all View Answer
b) from
c) with Answer: c
Explanation: The correct format for entering
d) in
date into the database while inserting data is
View Answer ‘YYYY-MM-DD’.
Answer: a 5. Choose the correct option regarding
Explanation: the from key word is specified the following query
beside delete clause to indicate the relation
INSERT INTO course ('CS-67' , 'course
from which the tuple needs to be deleted.
name', 'any' , 5);
2. How many relations can a delete
command operate on? a) Data is inserted into the course
a) 0 relation
b) 1 b) Data is not inserted into the course
c) 2 relation due to incorrect specification
d) Infinitely many c) Data is inserted into the CS-67
View Answer relation
d) Data is not inserted due to the
Answer: b
Explanation: The delete command can incorrect use of syntax
operate only on one relation. You cannot View Answer
give commands like delete R1, R2. Answer: d
3. What is the result of the following Explanation: Data is not inserted because,
query? the proper syntax is
insert into <relation name> values (<data>);
6. To change a value in a tuple without Answer: c
changing all the values in the tuple, we Explanation: SQL subqueries that can occur
use the _____ statement wherever a value is permitted provided the
a) insert subquery gives only one tuple with a single
attribute are called Scalar subqueries.
b) insert some
Scalar Subqueries can be used in the SQL
c) update update statement when they are used under
d) alter the set clause.
View Answer 10. Which of the following cannot be
Answer: c used to modify the data in a database
Explanation: To change a value in a tuple a) update
without changing the entire values in the b) insert
tuple, we use the update statement. Eg: c) delete
update employee set salary = salary*1.5; d) drop
7. What does the following query do? View Answer
UPDATE student Answer: d
SET marks = marks*1.10; Explanation: The drop keyword is used to
delete the entire relation leaving no trace of
a) It increases the marks of all the
it in the memory. Thus it cannot be used to
students by 10% edit the data in the relation.
b) It decreases the marks of all the
students by 90%
c) It increases the marks of all the RDBMS Questions and
students by 110%
d) It is syntactically wrong Answers – Join Expressions
View Answer
This set of RDBMS Multiple Choice
Answer: a Questions & Answers (MCQs) focuses
Explanation: The update clause is used to on “Join Expressions”.
edit a specific value in the tuple. The set
command is used to set the value of an 1. The on condition appears at the
attribute in a tuple. _______ of the join expression
advertisement a) Beginning
b) End
8. State true or false: We cannot write a c) Between
where clause under an update d) The on condition is not related to join
command expression
a) True View Answer
b) False
View Answer Answer: b
Explanation: The on condition appears at
Answer: b the end of the join expression. Because it
Explanation: Writing a where clause under states the condition that the relations under
the update statement enables us to specify the join operations get matched based on.
a condition for the selection of tuples whose 2. What is the difference between a join
values need to be updated. and an outer join operation?
9. Scalar Subqueries can be used in the a) There is no difference
SQL update statement when they are b) Join preserves a few tuples that are
used under the ____ clause otherwise lost in the outer join
a) where c) Outer join preserves a few tuples that
b) with are otherwise lost in the join
c) set d) An outer join can be used only on
d) end outer queries whereas a join operation
View Answer can be used in Subqueries
View Answer
Answer: c outer joins preserve tuples from either or
Explanation: The outer join operation both sides of the operation.
preserves a few tuples that are otherwise 6. What is the function of a right outer
lost in the join operation. The outer join join?
operation preserves the tuples to the right of a) It preserves tuples only in the relation
the operation. named before the operation
3. The join operations that do not retain b) It preserves tuples only in the relation
mismatched tuples are called as named after the operation
_________ operations c) It preserved tuples in the relations
a) outer join named on both the sides of the
b) natural join operation
c) full outer join d) It does not preserve any tuples on
d) inner join either side of the relation
View Answer View Answer
Answer: d Answer: b
Explanation: The join operations that do not Explanation: The right outer join operation
retain mismatched tuples are called as inner preserves the tuples named after the
join operations. The inner join operations do operation.
not preserve any tuples that are otherwise
7. What is the function of inner join?
preserved in the outer join operation.
a) It preserves tuples only in the relation
4. What is the function of a left outer
named before the operation
join?
b) It preserves tuples only in the relation
a) It preserves tuples only in the relation
named after the operation
named before the operation
c) It preserved tuples in the relations
b) It preserves tuples only in the relation
named on both the sides of the
named after the operation
operation
c) It preserved tuples in the relations
d) It does not preserve any tuples on
named on both the sides of the
either side of the relation
operation
View Answer
d) It does not preserve any tuples on
either side of the relation Answer: d
View Answer Explanation: The join operations that do not
retain mismatched tuples are called as inner
Answer: a join operations. The inner join operation
Explanation: The left outer join operation does not preserve any tuples on either side
preserves the tuples named before the of the relation.
operation. 8. State true or false: on and where
5. What is the function of a full outer behave differently for outer join
join? a) True
a) It preserves tuples only in the relation b) False
named before the operation View Answer
b) It preserves tuples only in the relation
named after the operation Answer: a
c) It preserved tuples in the relations Explanation: The on condition is a part of
named on both the sides of the the outer join syntax but the where clause
isn’t.
operation
9. Which off the following is not a valid
d) It does not preserve any tuples on
type of join?
either side of the relation
a) left outer join
View Answer
b) outer join
Answer: c c) join
Explanation: The full outer join operation d) full join
preserves the tuples named on both the View Answer
sides of the operation. Unlike the inner join,
Answer: d d) none of the mentioned
Explanation: There is no such join called as View Answer
full join. There is a full outer join but a full
join does not exist. Answer: c
10. If a left outer join is performed and Explanation: We use the create view
the tuple on the left hand side does not command to define a view in SQL.
match with the tuple on the right hand 3. create view studentdet
side, what happens to the values that select ID, address, name
are preserved on the left hand side? from student;
a) They are given null values What is the result of the above query?
b) They are given a random value a) It creates a view named studentdet
c) The user is asked to enter data with 3 attributes
d) The query is declared invalid by the b) It creates a view named studentdet
compiler with 1 attribute
View Answer c) It creates a view named ID with 2
Answer: a attributes
Explanation: If a left outer join is performed d) It is syntactically wrong and does not
and the tuple on the left hand side does not give a result
match with the tuple on the right hand side, View Answer
the remaining values are given a null value.
Answer: d
Explanation: immediately after specifying
RDBMS Questions and the name of the view, we have to write the
“as” keyword. So this query does not give
Answers – Views and any result as it is syntactically incorrect.
Transactions 4. State true or false: One view can be
used in the expression defining another
This set of RDBMS Multiple Choice view
Questions & Answers (MCQs) focuses a) True
on “Views and Transactions”. b) False
View Answer
1. What is a view?
Answer: a
a) An brief description of the schema
Explanation: One view can be used to
diagram. define another view in its expression. This
b) A relation that is not a part of the further improves the writability of the code
schema but is a virtual relation as we are reducing the entire logical model.
c) Any relation that is a part of the 5. If the actual relations used in the view
schema definition change, the view is updated
d) A relation that is a part of the schema immediately. Such views are called
but which needs to be specified in every _________
operation made on that particular a) Instant views
relation. b) Instantaneous views
View Answer c) Materialistic views
Answer: b d) Materialized views
Explanation: A relation that is not a part of View Answer
the schema but is a virtual relation is called Answer: d
as view. Views improve writability as viewing Explanation: If the actual relations used in
the entire logical model is not feasible. the view definition change, the view is
2. What is the command used to define updated immediately. Such views are called
view in SQL? Materialized views. Materialized views help
a) define view to keep the database up-to-date.
b) new view 6. The process of maintaining views up
c) create view to date is called _________
a) View maintenance b) Rollback work
b) View updating c) Commit work
c) View materialization d) Replace work
d) View isolation View Answer
View Answer
Answer: b
Answer: a Explanation: The Rollback work statement
Explanation: The process of maintaining causes the statements to undo all the
views up to date is called View updates performed on the transaction. The
maintenance. View maintenance can be database is then restored to the state of
done immediately when any of the views is what it was before the first statement of the
updated. transaction was executed.
7. How can we insert data into a view?
a) insert into ();
b) create data values (); RDBMS Questions and
c) enter (); Answers – Integrity
d) insert into values ();
View Answer
Constraints
Answer: d This set of RDBMS Multiple Choice
Explanation: We can insert data into a view Questions & Answers (MCQs) focuses
using the inset into values (); statement. on “Integrity Constraints”.
This operation can be done only if the view
is updatable. 1. Which of the following is not an
8. State true or false: We can update a integrity constraint?
view if it has multiple database relations a) not null
in the from clause b) unique
a) True c) identical
b) False d) check
View Answer View Answer
Answer: b Answer: c
Explanation: We can update a view only if it Explanation: Identical is not an allowed
has a single database relation in the “from” integrity constraint in SQL. Not null prevents
clause. null values and unique only allows unique
9. The _______ statement makes the values to be entered. Check checks for a
updates performed by the transaction given condition.
permanent. 2. What is the function of the not null
a) Finalize work constraint?
b) Finish work a) It prevents illegal data from being
c) Commit work entered into the database
d) None of the mentioned b) It ensures that data is entered into the
View Answer database
c) It ensures that the data entered is
Answer: c unique
Explanation: The Commit work statement d) None of the mentioned
makes the updates performed by the
View Answer
transaction permanent. After a transaction is
committed, a new transaction is Answer: b
automatically started. Explanation: The not null constraint ensures
advertisement that data is entered into the database. It
displays an error message whenever a data
10. The _______ statement causes the field mentioned is left empty.
statements to undo all the updates 3. What is the function of the unique
performed on the transaction constraint?
a) Undo work a) It ensures that no two values under
an attribute are identical a) Functional dependencies
b) It ensures that all the attributes are b) Subset dependencies
perfectly unique in their data type c) Superset dependencies
c) It ensures that all the relations in the d) Primary dependencies
database have a unique set of attributes View Answer
d) It does not have any function in SQL
Answer: b
View Answer Explanation: Referential integrity constraints
Answer: a are also called as subset dependencies. It is
Explanation: The purpose of the unique called so because the set of foreign key
clause is to ensure that no two values under values in r1 of r2 must be a subset of the set
the same attribute are identical. Primary of primary key values in r2.
keys are unique by default. 7. ________ is a predicate that we
4. What is the functions of on delete expect the database to always satisfy
cascade? a) Assertion
a) It is used to delete a tuple in a table b) Reason
b) It is used to specify the precise c) Mandate
attribute that needs to be deleted in a d) Verify
single relation. View Answer
c) It is used to preserve referential Answer: a
integrity in a relation Explanation: An assertion is a predicate that
d) It is used to execute sub-queries in we expect the database to always satisfy.
the from clause. Domain constraints and referential integrity
View Answer constraints are special forms of assertions.
advertisement
Answer: c
Explanation: It is used to preserve 8. State true or false: Oracle does not
referential integrity in the relation. When an support complex check conditions
attribute of a relation is the foreign key in
a) True
another relation, deleting it causes
referential integrity problems. The on delete b) False
cascade solves this problem by forcing us to View Answer
delete the foreign key first. Answer: a
5. What does the following condition do? Explanation: Most of the widely used
check( name in( ‘Ryan’, ‘Cristiano’, database management systems including
‘Leo’)) oracle currently do not support complex
a) The condition checks whether the check conditions.
name attribute includes the three 9. What statement is used to define a
mentioned names new assertion in SQL?
b) The condition allows the name a) create check ;
attribute to possess only the three b) create assertion where ;
mentioned names c) create where ;
c) The condition checks whether the d) create assertion check ;
given names are sub-strings in at least View Answer
one of the values Answer: d
d) None of the mentioned Explanation: We use “create
View Answer assertion check ;” statement to create a new
Answer: b assertion in a relation.
Explanation: The check clause allows the
attribute to take only those values that are
explicitly specified by the user inside the RDBMS Questions and
parentheses after the in key word. Answers – SQL Data Types
6. Referential integrity constraints are
also called as _________ and Schemas
This set of RDBMS Questions and d) None of the mentioned
Answers for Freshers focuses on “Sql View Answer
Data Types and Schemas”.
Answer: c
1. Which of the following is not a valid Explanation: A default value is a value that
Date and Time data type? is initially loaded into the attribute. All the
a) date tuples have the default value in the attribute
for which it is specified in case any value is
b) time
not externally specified.
c) datestamp
5. Which of the following is an illegal
d) timestamp
data type in SQL
View Answer
a) number
Answer: c b) clob
Explanation: datestamp is not a valid Date c) blob
and Time data type. Timestamp exists but d) lint
datestamp does not exist in SQL. View Answer
2. What is a timestamp?
a) A combination of date and time with Answer: lint
date first Explanation: clob and blob are called large
object data types. They can be used to store
b) A combination of date and time with
values that can go to the size of gigabytes.
time first Number is used to store the basic integer
c) A combination of time and place with data type.
time first 6. State true or false: Users can define
d) A combination of time and place with new data types in SQL
place first a) True
View Answer b) False
Answer: a View Answer
Explanation: A timestamp is a combination Answer: a
of date and time with date first. Explanation: SQL allows the creation of new
Eg: ‘2002-04-25 10:20:04.43’. data types using the “create type as final;”
3. What does p indicate in the following statement.
data type? 7. What does the following statement
time(p) do?
a) The amount of delay that needs to be create table temp_inst like institute
added to the time a) It creates a new relation temp_inst
b) The number of fractional digits for the with all the tuples and attributes of the
seconds institute relation
c) The maximum number of allowed b) It creates a new relation temp_inst
hours with the same schema as that of the
d) None of the mentioned institute relation
View Answer c) It creates a new relation named
Answer: b temp_inst with institute as its only
Explanation: The p in the parentheses attribute
indicates the number of fractional digits for d) It does not create any relations and
seconds. returns an error
4. What is a default value? View Answer
a) It is a value that automatically creates
Answer: b
a primary key
Explanation: The create table like statement
b) It is a value that cannot be altered creates a new relation which has a schema
during insertion of values in the tuple identical to that of the specified relation after
c) It is a value that is initially loaded into the like keyword.
the attribute 8. Which of the following is a privilege in
SQL standard?
a) select a) Allowing a program to construct an
b) insert SQL query in a character string
c) update b) Submitting the query
d) All of the mentioned c) Retrieving the result into the program
View Answer variables a tuple at a time
d) All of the mentioned
Answer: d
Explanation: The SQL standard includes the
View Answer
privileges select, insert, update and delete. Answer: d
This privilege set can be granted or revoked Explanation: Dynamic SQL allows the
among the users. program to construct the queries in
9. The _________ statement is used in character string format, it submits them, and
SQL to confer authorization. then retrieves the data into the program
a) grant variables one tuple at a time.
b) confer 2. What is the full form of JDBC?
c) implement a) Java Database Connectivity
d) permit b) Java Database Co-Operation
View Answer c) JSP Database Committee
d) Java Database Creation
Answer: a
View Answer
Explanation: The grant statement is used in
SQL to confer authorization. It has the Answer: a
syntax Explanation: The full form of JDBC is Java
grant <privileges> on <relation name> to Database Connectivity. This full form is no
<user list>; longer widely used and the abbreviation is
10. revoke select on takes from amit; mostly used everywhere.
What does the above query perform? 3. State true or false: Developers cannot
a) It revokes all authorizations from amit write their own functions into SQL
b) It revokes select authorization from a) True
amit b) False
c) It revokes takes authorization from View Answer
amit
Answer: b
d) It gives an error Explanation: Developers can write their own
View Answer functions into SQL by using the create
Answer: b function statement.
Explanation: The query mentions the 4. Which of the following are not a part
revoking of the select privilege. So, the of PL/SQL
query revokes the select authorization from a) Triggers
amit. b) Packages
c) Functions
d) None of the mentioned
RDBMS Questions and View Answer
Answers – Accessing SQL Answer: d
From a Programming Explanation: All the three mentioned
features i.e. triggers, functions, packages
Language are a part of PL/SQL.
5. The part of SQL that deals with the
This set of RDBMS Interview Questions SQL supports constructs is called as
and Answers for freshers focuses on _______
“Accessing Sql from a Programming a) Persistent construct dealer
Language”. b) Persistent storage module
1. Which of the following is/are a c) Persistent supports center
function of dynamic SQL? d) Primary storage medium
View Answer
Answer: b all Java driver and hence is the most
Explanation: The part of SQL that deals with efficient.
the SQL supports constructs is called as 10. Which package comprises of the
Persistent Storage Module (PSM). The SQL core JDBC API?
supports construct give it almost all the a) java.sql
power of a general purpose programming b) java.database
language.
c) sql.java
6. A _________ is a statement that the d) java.relation
system executes whenever a database View Answer
is modified
a) Trigger Answer: a
b) Function Explanation: The java.sql package
c) Package comprises of the core JDBC API. JDBC is
d) Protocol an application program interface which
contains all the functions to link and execute
View Answer
database functions in Java.
Answer: a
Explanation: A trigger is a statement that the
system executes whenever a database is RDBMS Questions and
modified. Immediately after the specified
modification of the database is complete,
Answers – OLAP
the trigger statement gets executed and
then the execution is continued. This set of RDBMS Multiple Choice
7. State true or false: Recursive queries Questions & Answers (MCQs) focuses
are permitted in SQL on “OLAP”.
a) True 1. What is the full form of OLAP?
b) False a) Online Application Programming
View Answer b) Online Application Processing
Answer: a c) Online Analytical programming
Explanation: Recursive queries can be used d) Online Analytical Processing
in SQL in order to verify a condition View Answer
repeatedly. SQL allows recursive queries.
Answer: d
8. How many different types of drivers Explanation: The full form of OLAP is Online
are present in JDBC? Analytical Processing. It is an interactive
a) 1 system that gives various features to
b) 2 analysts.
c) 3 2. Data that can be modelled as
d) 4 dimension attributes and measure
View Answer attributes are called ___________
Answer: d a) Mono-dimensional data
Explanation: There are four types of JDBC b) Multi-dimensional data
drivers which are named JDBC Type 1,2,3,4 c) Measurable data
drivers respectively. d) Efficient data
9. Which JDBC Driver is the most View Answer
efficient of all the JDBC drivers? Answer: b
a) Type 1 Driver Explanation: Data that can be modelled as
b) Type 2 Driver dimension attributes and measure attributes
c) Type 3 Driver are called multi-dimensional data.
d) Type 4 Driver 3. The operation of changing a
View Answer dimensions used in a cross-tab is called
Answer: The JDBC type 4 driver is the most as ________
efficient of all the JDBC drivers. This is an a) Alteration
b) Pivoting
c) Piloting c) ROLAP
d) Renewing d) None of the mentioned
View Answer View Answer
Answer: b Answer: d
Explanation: We can change the dimensions Explanation: HOLAP means Hybrid OLAP,
used in a cross tab. The operation of MOLAP means multidimensional OLAP,
changing a dimensions used in a cross-tab ROLAP means relational OLAP. This means
is called as pivoting. all of the above OLAP systems exist.
4. The operation of moving from finer 8. State true or false: OLAP systems can
granular data to coarser granular data is be implemented as client-server
called _______ systems
a) Reduction a) True
b) Increment b) False
c) Roll up View Answer
d) Drill down
Answer: a
View Answer Explanation: OLAP systems can be
Answer: c implemented as client-server systems. In
Explanation: OLAP systems permit users to fact most of the current OLAP systems are
view the data at any level of granularity. The implemented as client-server systems.
process of moving from finer granular data 9. The operation of moving from coarser
to coarser granular data is called as roll-up. granular data to finer granular data is
5. How many dimensions of multi- called _______
dimensional data do cross tabs enable a) Reduction
analysts to view? b) Increment
a) 1 c) Roll back
b) 2 d) Drill down
c) 3 View Answer
d) None of the mentioned
Answer: d
View Answer Explanation: OLAP systems permit users to
Answer: b view the data at any level of granularity. The
Explanation: Cross-tabs enable analysts to process of moving from finer granular data
view two dimensions of multi-dimensional to coarser granular data is called as drill-
data, along with the summaries of the data. down.
6. The _______ function allows 10. State true or false: In OLAP,
substitution of values in an attribute of a analysts cannot view a dimension in
tuple different levels of detail.
a) Cube a) True
b) Unknown b) False
c) Decode View Answer
d) Substitute Answer: b
View Answer Explanation: In OLAP, analysts cannot view
Answer: c a dimension in different levels of detail. The
Explanation: The decode function allows different levels of detail are classified into a
substitution of values in an attribute of a hierarchy.
tuple. The decode function does not always
work as we might like for null values
because predicates on null values evaluate RDBMS Questions and
to unknown. Answers – The Relational
7. Which of the following OLAP systems
do not exist? Algebra
a) HOLAP
b) MOLAP
This set of RDBMS Multiple Choice d) None of the mentioned
Questions & Answers (MCQs) focuses View Answer
on “Relational Algebra”.
Answer: b
1. Which of the following is not a Explanation: If a relational-algebra
relational algebra function? expression E has arity n, then the above
a) Select expression returns the result of expression
E under the name X, and with the attributes
b) Project
renamed to A1 , A2 , …., An.
c) Manipulate
5. What does the following relational
d) Union
algebra expression do?
View Answer
σamount > 1200 (loan)
Answer: c a) Finds all the tuples in loan
Explanation: There does not exist any b) Finds the tuples in loan where the
operation named as manipulate operation in amount is greater than 12000
relational algebra. The union gives the union c) Finds all the tuples in loan where the
of two sets. Project is similar to select in amount is greater than 1200
SQL and select is similar to where in SQL.
d) Finds all the amounts in loan where
2. The select operation’s function in the number of values is greater than
relational algebra is identical to the 1200
_______ clause in SQL
View Answer
a) where
b) from Answer: c
c) select Explanation: The above expression finds all
d) none of the mentioned the tuples in loan wherever the amount is
View Answer greater than 1200. Because the condition
specifies that the amount should be greater
Answer: a than 1200.
Explanation: The select operation’s function 6. How is the left outer join symbol
in relational algebra is identical to the where represented in relational algebra?
clause in SQL standard. It is therefore used a) ⟕
to check for a particular condition. b) ⟖
3. The project operation’s function in c) ⟗
relational algebra is identical to the d) ⋈
_______ clause in SQL View Answer
a) where
b) from Answer: a
c) select Explanation: The symbol of the left outer join
d) none of the mentioned is similar to the symbol of the natural join but
View Answer it has two dashes on the top and bottom left
side.
Answer: c 7. How is the right outer join symbol
Explanation: The project operation’s function represented in relational algebra?
in relational algebra is identical to the select a) ⟕
clause in SQL standard. It is used to list the b) ⟖
attributes that are to be displayed.
c) ⟗
4. What does the following relational
d) ⋈
operation perform?
View Answer
ρx(A1,A2,A3…) (E)
a) It returns the result of expression E Answer: b
with the previous attribute names Explanation: The symbol of the right outer
b) It returns the result of expression E join is similar to the symbol of the natural
renaming the attributes as A1, A2, … join but it has two dashes on the top and
c) It returns the result of the relation E bottom right side.
but saves the old attributes 8. Πcustomer_name, loan_number,
amount (borrower ⋈loan)
What does the above expression d) Multivariables
perform? View Answer
a) It finds the customer_name,
Answer: a
loan_number and amount from borrower Explanation: The collections on which
b) It finds the customer_name, aggregate functions can operate are called
loan_number and amount from loan as multisets. Sets are a special case of
c) It finds the customer_name, multisets.
loan_number and amount from the full
outer join of borrower and loan
d) It finds the customer_name, RDBMS Questions and
loan_number and amount from the Answers – Entity
natural join of borrower and loan
View Answer Relationship Model
Answer: d This set of RDBMS Questions and
Explanation: The above relational algebra Answers for Experienced people
expression finds the customer_name, focuses on “Entity Relationship Model”.
loan_number and amount from the natural
join of borrower and loan as the attributes 1. The _________ of the entity set is an
are written next to the project symbol and actual collection of entities belonging to
the relation to be extracted from is that entity set.
mentioned in the parentheses which is the a) Extension
natural join of borrower and loan.
b) Intention
9. Updating, Deleting and Inserting in
c) Description
relational algebra is done using the
d) Availability
________ operator
View Answer
a) Assignment
b) Modification Answer: a
c) Alteration Explanation: The extension of the entity set
d) Inclusion is an actual collection of entities belonging
View Answer to that entity set.
2. A ___________ is an association
Answer: a among several entities.
Explanation: Updating, Deleting and a) Relationship
Inserting in relational algebra is done using b) Association
the assignment operator.
c) Set
10. State true or false: There exists a
d) Combination
division operator in Relational Algebra
View Answer
a) True
b) False Answer: a
View Answer Explanation: A relationship is an association
among several entities. A relationship
Answer: a specifies how two entities are related.
Explanation: The division is a binary 3. The attributes of a relationship are
operation that is labeled as R ÷ S. The result called as _________ attributes
consists of the restrictions of tuples in R to
a) Relational
the attributes unique to R, i.e., in the relation
R but not in the relation S. b) Conjunctive
advertisement c) Descriptive
d) None of the mentioned
11. The collections on which aggregate View Answer
functions can operate are called as
Answer: c
__________
Explanation: A relationship may also have
a) Multisets attributes. These attributes are called as
b) Multivalues descriptive attributes.
c) Multicollections
4. What are composite attributes? entity-relationship model to uniquely identify
a) They are those attributes which the entity in the entity set.
cannot be further divided into other advertisement
attributes
8. State true or false: Multiple attributes
b) They are those attributes which can
combined together can be primary keys
further be divided into other attributes
a) True
c) They are those attributes which are
b) False
essentially the primary keys of the
View Answer
relation
d) None of the mentioned Answer: a
View Answer Explanation: A primary key is an attribute or
a set of attributes that can uniquely identify
Answer: b a tuple in a relation. So, this means that
Explanation: Composite attributes are the multiple attributes can be combined to
ones which can be further divided into other uniquely identify a tuple in a relation.
attributes whereas simple attributes cannot 9. Which of the following is a good
be divided into other attributes. database management practice?
5. Let E be an entity set in a relationship a) Adding redundant attributes
set R. If every entity in E participates in b) Removing redundant attributes
at least one relationships in R, Then the c) Not specifying primary keys
participation of E in R is __________ d) None of the mentioned
a) Partial View Answer
b) Total
c) Complete Answer: b
d) Incomplete Explanation: Removing redundant attributes
View Answer from a relation makes data extraction more
efficient and faster. Thus, it is a good
Answer: Total database management technique.
Explanation: Let E be an entity set in a
relationship set R. If every entity in E
participates in at least one relation in R, RDBMS Questions and
Then the participation of E in R is total.
6. Let E be an entity set in a relationship Answers – Entity
set R. If only some entities in E Relationship Diagrams
participate in relationships in R, Then
the participation of E in R is __________ This set of RDBMS Multiple Choice
a) Partial Questions & Answers (MCQs) focuses
b) Total on “Entity Relationship Diagrams”.
c) Complete
1. Which of the following symbols
d) Incomplete
represent entity sets in an ER diagram?
View Answer
a) Divided rectangles
Answer: Total b) Diamonds
Explanation: Let E be an entity set in a c) Lines
relationship set R. If only some entities in E d) Undivided rectangles
participate in relationships in R, Then the View Answer
participation of E in R is partial.
7. State true or false: We cannot specify Answer: a
keys in the Entity-Relationship model Explanation: Rectangles divided into two
a) True parts represent entity sets in an ER
diagram. The upper rectangle contains the
b) False
name of the entity sets. And the lower
View Answer rectangle contains the attributes.
Answer: b 2. Which of the following symbols
Explanation: Keys can be specified in the represent relationship sets in an ER
diagram a) Using a solid line
a) Divided rectangles b) Circling it
b) Diamonds c) Using a dashed line
c) Lines d) Drawing a square around it
d) Undivided rectangles View Answer
View Answer
Answer: c
Answer: b Explanation: A discriminator of a weak entity
Explanation: Diamonds represent set can be specified by underlining it with a
relationship sets in an ER diagram. dashed line.
Relationship sets define how two entity sets 7. An entity set that has a primary key is
are related in a database. called as ___________
3. What do double diamonds represent a) Strong entity set
in an ER diagram b) Weak entity set
a) They link entity sets to relationship c) Complete entity set
sets d) None of the mentioned
b) Total participation of an entity in a View Answer
relationship set
Answer: a
c) Relationship sets linked to weak entity
Explanation: An entity set that has a primary
sets key is called as a strong entity set. An entity
d) None of the mentioned set that does not have a primary key is
View Answer called a weak entity set.
Answer: c 8. The relationship associating the weak
Explanation: The double diamonds entity sets with the identifying entity set
represent the relationship sets linked to is called as ________
weak entity sets. Weak entity sets are the a) Identifying relationship
sets that do not have a primary key. b) Connecting relationship
4. What does a directed line ( → ) from a c) Completing relationship
relationship set to two entity sets mean? d) Unique relationship
a) One-one View Answer
b) Many-one
Answer: a
c) Many-many
Explanation: The relationship associating
d) One-many the weak entity sets with the identifying
View Answer entity set is called as an Identifying
Answer: a relationship. An identifying set is a many to
Explanation: A directed line ( → ) from a one from the weak entity set to the
relationship set to two entity sets means that identifying entity set.
there is a one-one cardinality between two 9. State true or false: Every weak entity
entity sets. set must be associated with an
5. How are roles specified in an ER identifying entity
diagram a) True
a) By labelling the rectangles b) False
b) By labelling the diamonds View Answer
c) Roles cannot be specified in an ER Answer: a
diagram Explanation: Every weak entity set must be
d) By labelling the lines associated with an identifying entity. The
View Answer weak entity is then said to be existence
dependent on the identifying entity set.
Answer: E-R diagrams can include role
indicators. Roles can be specified in an ER 10. State true or false: A weak entity can
diagram by labelling the lines. participate in all the relationships.
6. How is the discriminator of a weak a) True
entity set specified? b) False
View Answer
Answer: b Answer: a
Explanation: It cannot participate in all the Explanation: The primary key of the
relationships. A weak entity set can only representation of a weak entity set consists
participate in relationships other than the of the primary key of the strong entity set
identifying relationship. and the discriminator of the weak entity set.
4. For a binary many to many
relationship, the ________ of the
RDBMS Questions and participating entity sets becomes the
Answers – Reduction to prime attribute
a) Intersection of primary keys
Relational Schema b) Primary key of either one
c) Union of primary keys
This set of RDBMS Interview Questions
d) Primary key on the many side
and Answers for Experienced people View Answer
focuses on “Reduction to Relational
Schema”. Answer: c
Explanation: For a binary many to many
1. For schemas derived from strong relationship, the union of the primary keys of
entity sets, the _______ of the entity set the participating entity sets becomes the
serves as the primary key of the prime attribute.
resulting schema 5. For a binary one to one relationship,
a) First attribute the ________ of the participating entity
b) Primary key sets becomes the prime attribute
c) Foreign key a) Intersection of primary keys
d) None of the mentioned b) Primary key of either one
View Answer c) Union of primary keys
d) Primary key on the many side
Answer: b
Explanation: For schemas derived from
View Answer
strong entity sets, the primary key of the Answer: b
entity set serves as the primary key of the Explanation: For a binary one to one
resulting schema. This is because the relationship, the primary key of either one of
primary keys are to be preserved as they the participating entity sets becomes the
are unique. prime attribute.
2. State true or false: Derived attributes 6. For a binary many to many
cannot be directly represented in the relationship, the ________ of the
relational data model participating entity sets becomes the
a) True prime attribute
b) False a) Intersection of primary keys
View Answer b) Primary key of either one
Answer: a c) Union of primary keys
Explanation: Derived attributes cannot be d) Primary key on the many side
directly represented in the relational data View Answer
model. Instead, they are represented as
Answer: d
methods.
Explanation: For a binary many to many
3. The primary key of the representation relationship, the primary key on the many
of a weak entity set consists of the side of the participating entity sets becomes
primary key of the strong entity set and the prime attribute.
the _______ 7. For a n-ary relationship set without
a) Discriminator of the weak entity set arrows, the ________ of the
b) Foreign key participating entity sets becomes the
c) Primary key of all the other entity sets prime attribute
d) All the attributes of the weak entity set a) Intersection of primary keys
View Answer b) Primary key of either one
c) Union of primary keys the alphabetical orderor the data in the
d) Primary key on the many side attribute.
View Answer
Answer: c RDBMS Questions and
Explanation: For a binary many to many
relationship, the union of the primary keys of Answers – Extended E-R
the participating entity sets becomes the Features
prime attribute.
8. State true or false: The schema for This set of RDBMS Multiple Choice
the relationship set linking a weak entity Questions & Answers (MCQs) focuses
set to its corresponding strong entity set on “Extended ER Features”.
is redundant.
a) True 1. The process of designating sub
b) False groupings within the entity set is called
View Answer as _______
a) Specialization
Answer: a b) Division
Explanation: The schema for the
c) Aggregation
relationship set linking a weak entity set to
its corresponding strong entity set is
d) Finalization
redundant and it need not be present in the View Answer
relational database design derived from an Answer: a
ER diagram. Explanation: The process of designating
9. Statement 1: We can create foreign sub-groupings within the entity set is called
key constraints on relational schema as specialization. Specialization allows us to
derived from ER diagram distinguish among entities.
Statement 2: Relational schema cannot 2. State true or false: Specialization can
be derived from an ER diagram be applied only once
a) Both the statements are true a) True
b) Both the statements are false b) False
c) Statement 1 is true and Statement 2 View Answer
is false
Answer: a
d) Statement 2 is true and statement 1 is Explanation: We can apply specialization
false multiple times to refine a design. An entity
View Answer set may also be specialized by more than
Answer: c one distinguishing feature.
Explanation: We can create foreign key 3. Which of the following is the
constraints on relational schema derived specialization that permits multiple sets
from ER diagram and also it is possible to a) Superclass specialization
derive relational schema from ER diagrams. b) Disjoint specialization
10. Which of the following can affect the c) Overlapping specialization
placement of the relationship attributes? d) None of the mentioned
a) Alphabetical order View Answer
b) The data in the attribute
Answer: c
c) Cardinality ratio Explanation: Overlapping specialization is
d) None of the mentioned the type of specialization that permits
View Answer multiple sets. But disjoint specialization does
Answer: c not permit multiple sets. Disjoint
Explanation: The cardinality ratio of a specialization permits at most one set.
relationship can affect the placement of 4. The similarities between the entity set
relationship attributes. The placement of the can be expressed by which of the
relationship attributes are not dependent on following features?
a) Specialization
b) Generalization c) Value defined
c) Uniquation d) Undefined
d) Inheritance View Answer
View Answer
Answer: a
Answer: b Explanation: Condition defined
Explanation: The similarities between the generalization constraint is also said to be
entity set can be expressed by the attribute defined.
generalization feature. It is a containment o 9. If each higher level entity belongs to
the relationship that exists between a higher the lower level entity, then what kind of
level entity set and one or more lower level generalization is it?
entity sets. a) Modal generalization
5. Higher level entity sets are b) Partial generalization
designated by the term _________ c) Total generalization
a) Sub class d) None of the mentioned
b) Super class View Answer
c) Parent class
d) Root class Answer: c
View Answer Explanation: If each higher level entity
belongs to the lower level entity then it is
Answer: b called as total generalization. It is also called
Explanation: Higher level entity sets can as total specialization. If some higher level
also be designated by the term super class. entities do not belong, it is called as partial
In the similar manner lower level entity sets generalization.
can also be designated by the term sub 10. ________ is an abstraction through
class. which relationships are treated as higher
6. State true or false: The attributes of level entities
the higher level entity sets are inherited a) Creation
by the attributes of the lower level entity b) Superseding
sets c) Attribute separation
a) True d) Aggregation
b) False View Answer
View Answer
Answer: d
Answer: a Explanation: One limitation of E-R model is
Explanation: The attributes of the higher that it cannot express relationships among
level entity sets are inherited by the relationships. Thus for this purpose,
attributes of the lower level entity sets. But aggregation is used. Aggregation is an
the inverse is not true in this case. abstraction through which relationships are
7. Which of the following is not a treated as higher level entities.
generalization constraint?
a) Condition-defined
b) User defined RDBMS Questions and
c) Disjoint Answers – Features of
d) Machine defined
View Answer Good Relational Design
Answer: d This set of RDBMS Multiple Choice
Explanation: Machine definition is not a Questions & Answers (MCQs) focuses
generalization constraint. Condition defined, on “Features of Good Relational
user defined, disjoint and overlapping are 4 Designs”.
generalization constraints.
8. Condition defined generalization 1. Which of the following is not a feature
constraint is also said to be ________ of a good relational design?
a) Attribute defined a) Specifying primary keys
b) Constraint defined b) Specifying foreign keys
c) Preserving integrity constraints 5. A domain whose elements are
d) Allowing redundancy of attributes indivisible is called as ______
View Answer a) Unique domain
b) Proxy domain
Answer: d
Explanation: Allowing redundancy of
c) Atomic domain
attributes makes it very difficult for data d) Multiple domain
extraction. So, It is not a good relational View Answer
design feature. Answer: c
2. The dependency rules specified by Explanation: A domain is said to be atomic if
the database designer are known as all of its elements are considered to be
_______ indivisible. If the domains are atomic, then
a) Designer dependencies the relational schema is in the first normal
b) Database rules form.
c) Functional dependencies 6. If all the domains are atomic then the
d) None of the mentioned relational schema is in ________ normal
View Answer form
a) 1
Answer: c
b) 2
Explanation: The dependency rules
specified by the database designer are
c) 3
known as functional dependencies. The d) 4
normal forms are based on functional View Answer
dependencies. Answer: a
3. If the decomposition is unable to Explanation: If all the domains are atomic
represent certain important facts about then the relational schema is in first (1)
the relation, then such a decomposition normal form. That is, the domains must be
is called as? indivisible.
a) Lossless decomposition 7. State true or false: Composite
b) Lossy decomposition attributes have non-atomic domains.
c) Insecure decomposition a) True
d) Secure decomposition b) False
View Answer View Answer
Answer: b Answer: b
Explanation: If the decomposition is unable Explanation: Composite attributes have non
to represent certain important facts about atomic domains i.e. domains of the
the relation, then such a decomposition is composite attributes are generally divisible.
called as lossy decomposition. Lossy advertisement
decompositions should be avoided as they
result in the loss of data. 8. State true or false: Redundancy is
4. If the decomposition is able to desired in a relational schema
represent all the facts about the relation a) True
then such a decomposition is called as? b) False
a) Lossless decomposition View Answer
b) Lossy decomposition Answer: b
c) Insecure decomposition Explanation: Redundancy is never desired
d) Secure decomposition in a relational schema, it makes data
View Answer retrieval very difficult.
Answer: a
Explanation: If the decomposition is able to
represent all the facts about the relation
RDBMS Questions and
then such a decomposition is called as a Answers – Decomposition
lossless decomposition. Lossless
decompositions are generally preferred.
Answer: a
Using Functional Explanation: X→ Y is said to be trivial if X is
Dependencies a subset of Y. Thus X ⊂ Y implies X→Y is
trivial.
This set of RDBMS test focuses on 5. Which of the following is not a
“Decomposition Using Functional condition for X→ Y in Boyce codd
Dependencies”. normal form?
a) X → Y is trivial
1. An instance of a relation that satisfies b) X is the superkey for the relational
all real world constraints is known as? schema R
a) Proper relation c) Y is the superkey for the relational
b) Ideal relation schema R
c) Perfect relation d) All of the mentioned
d) Legal relation View Answer
View Answer
Answer: c
Answer: d Explanation: Y does not need to be a
Explanation: A relation that satisfies all the superkey of the relation for the given
real world constraints is called as a legal functional dependency to satisfy BCNF. X→
relation. An instance of a legal relation is Y must be trivial and X must be the
called as a legal instance. superkey of the relation R.
2. If K → R then K is said to be the 6. Which of the following is used to
_______ of R express database consistency?
a) Candidate key a) Primary keys
b) Foreign key b) Functional dependencies
c) Super key c) Check clause
d) Domain d) All of the mentioned
View Answer View Answer
Answer: c Answer: d
Explanation: If K → R then k is said to be Explanation: Primary keys, Functional
the superkey of R i.e. K uniquely identifies dependencies, Check clause are all used to
every tuple in the relation R. express database consistency.
3. X → Y holds on a schema k(K) if? Y?7. Which of the following is not a
a) At least one legal instance satisfies condition for the third normal form in the
the functional dependency case of X
b) No legal instance satisfies the a) X→ Y is trivial
functional dependency b) X is the superkey for R
c) Each and every legal instance c) Each attribute in Y-X is a candidate
satisfies the functional dependency key for R
d) None of the mentioned d) Each attribute in X-Y is a candidate
View Answer key for R
Answer: c View Answer
Explanation: X → Y holds on a schema k(K)
Answer: d
if each and every legal instance satisfies the
Explanation: Each attribute in X-Y is a
functional dependency. Even if one instance
candidate key for R is not a necessary
does not satisfy the functional dependency
condition for the third normal form in the
X→ Y does not hold on a schema.
case of X → Y. X→Y is trivial and X is the
4. X→ Y is trivial if? superkey of R are necessary conditions for
a) X ⊂ Y the third normal form.
b) Y ⊂ X 8. F+ is called as the ________ of F
c) X ⊇ Y a) Closure
d) None of the mentioned b) Sum
View Answer c) Cartesian product
d) None of the mentioned also hold on that schema. We say such FDs
View Answer are logically implied by F. A functional
dependency f on R is logically implied by a
Answer: a set of functional dependencies F on r if
Explanation: F+ is called as the closure of F. every instance of r(R) that satisfies F also
It contains all the possible combinations of a satisfies f.
functional dependency set in it. 2. If F is a set of functional
9. State true or false: A functional dependencies, then the closure of F is
dependency must first satisfy the denoted by?
second normal form to satisfy the third a) F*
normal form. b) Fo
a) True c) F+
b) False d) F
View Answer View Answer
Answer: a Answer: c
Explanation: A functional dependency must Explanation: If F is a set of functional
first satisfy the second normal form to satisfy dependencies, then the closure of F is
the third normal form. The second normal denoted by F+. It is the set of all functional
form must in turn satisfy first normal form. dependencies logically implied by F.
10. State true or false: The fourth normal 3. If a functional dependency is
form does not exist and it is instead reflexive, B is a subset of A and A is the
called as the BCNF. set of attributes, then
a) True a) B→A holds
b) False b) A→B holds
View Answer c) AB→C holds
Answer: b d) None of the mentioned
Explanation: The fourth normal form exists View Answer
and is different from the Boyce Codd normal
Answer: b
form which is called as BCNF.
Explanation: If a functional dependency is
reflexive, B is a subset of A and A is the set
of attributes, then A→B holds. This is called
RDBMS Questions and the reflexivity rule of Armstrong’s axioms.
Answers – Functional- 4. State true or false: Armstrong’s
axioms allow us to generate all F+ for
Dependency Theory any given F
This set of RDBMS Multiple Choice a) True
Questions & Answers (MCQs) focuses b) False
on “Functional Dependency Theory”. View Answer
Answer: a
1. A functional dependency f on R is
Explanation: Armstrong’s axioms allow us to
_______ by a set of functional generate all F+ for any given F and hence
dependencies F on r if every instance of are called complete.
r(R) that satisfies f also satisfies F. 5. Armstrong axioms are called sound
a) Logically Defined because?
b) Logically Derived a) They are expensive
c) Logically implied b) They cannot generate correct
d) None of the mentioned functional dependencies
View Answer c) They allow us to generate the
Answer: c complete closure
Explanation: Given a set F of functional d) They cannot generate incorrect
dependencies on a schema, we can prove functional dependencies
that certain other functional dependencies View Answer
Answer: d a) Canonical cover
Explanation: Armstrong’s axioms are called b) Complete cover
as sound axioms because they do not c) Canonical dependency
generate incorrect functional dependencies. d) Canonical clause
6. State true or false: Functional View Answer
dependencies are transitive
a) True Answer: a
b) False Explanation: A Canonical cover Fc for F is a
View Answer set of dependencies such that F logically
implies all dependencies in Fc, and Fc
Answer: a logically implies all dependencies in F. In Fc,
Explanation: All functional dependencies are no functional dependency should contain an
transitive. This is the transitivity rule of extraneous attribute and each left side of
Armstrong’s axioms. functional dependency should be unique.
7. If A→B, A→ C then which of the
following is true?
a) A→BC RDBMS Questions and
b) A→B Answers – Decomposition
c) A→C
d) All of the mentioned Algorithms
View Answer
This set of RDBMS Multiple Choice
Answer: d Questions & Answers (MCQs) focuses
Explanation: Applying the union rule to the on “Decomposition Algorithms”.
given question, we get, A→BC is true. The
other two options are specified in the 1. What does the BCNF decomposition
question itself. algorithm do?
8. If B is an attribute and A→B, Then B a) States a method to decompose a
is said to be ________ by a. relation satisfying BCNF
a) Logically implied b) States a method for joining two
b) Functionally implied relations satisfying BCNF
c) Logically determined c) States a method to decompose a
d) Functionally determined relational schema such that there are no
View Answer multiple occurrences
d) None of the mentioned
Answer: d
Explanation: If B is an attribute and A→B,
View Answer
Then B is said to be functionally determined Answer: a
by a. Explanation: If a relation is not in BCNF, it
9. We say that a decomposition having can be decomposed into simpler relations
the property F’+ = F+ is a __________ that are in BCNF. The BCNF decomposition
decomposition. algorithm states a method to decompose a
a) Dependency losing relation satisfying BCNF.
b) Dependency preserving 2. The 3NF decomposition algorithm is
c) Lossless also called as _______
d) None of the mentioned a) 3NF normal algorithm
View Answer b) 3NF synthesis algorithm
c) 3NF generator
Answer: b d) Functional dependence algorithm
Explanation: We say that a decomposition
View Answer
having the property F’+ = F+ is a
dependency preserving decomposition. Answer: b
10. A _________ Fc for F is a set of Explanation: The 3NF decomposition
dependencies such that F logically algorithm is also called as 3NF synthesis
implies all dependencies in Fc, and Fc algorithm since it takes a set of
logically implies all dependencies in F. dependencies and adds one schema at a
time, instead of decomposing the initial a) Equality generating dependencies
schema repeatedly. b) Tuple generating dependencies
3. Which of the following is desirable in c) Multi-purpose dependencies
a database design with functional d) None of the mentioned
dependencies? View Answer
a) BCNF
b) Losslessness Answer: a
Explanation: Functional dependencies are
c) Dependency preservation
sometimes referred to as equality
d) All of the mentioned generating dependencies because they
View Answer require other tuples of a certain form to be
Answer: A good database design must present in the relation.
satisfy BCNF, must be lossless, must be 8. The _______ is a set of all functional
dependency preserving. These are the and multi values dependencies implied
goals of database design with functional by a set of functional dependencies
dependency. a) Star
4. State true or false: SQL specifies a b) Closure
way of mentioning functional c) Derivation
dependencies d) Evolution
a) True View Answer
b) False
Answer: b
View Answer
Explanation: The closure is a set of all
Answer: b functional and multi values dependencies
Explanation: SQL does not specify a way to implied by a set of functional dependencies
mention functional dependencies. on a given relation. It is denoted by giving a
Functional dependencies are just used for “+” superscript.
theoretical improvement of database while 9. State true or false: If a relational
implementing them in SQL later. schema is in _______ NF and A is a
5. State true or false: Most current subset of R and B is also a subset of R
database systems do not support then it is that A is a superkey is a trivial
constraints on materialized view multi values dependency.
a) True a) 1
b) False b) 2
View Answer c) 3
Answer: a
d) 4
Explanation: Most current database systems View Answer
do not support constraints on materialized Answer: d
view. Explanation: If a relational schema is in 4NF
6. Multi valued dependencies are also and A is a subset of R and B is also a
called as __________ subset of R then it is that A is a superkey is
a) Equality generating dependencies a trivial multi values dependency.
b) Tuple generating dependencies 10. Which of the following normal forms
c) Multi-purpose dependencies does not exist?
d) None of the mentioned a) BCNF
View Answer b) PJNF
c) 5NF
Answer: b
Explanation: Multi valued dependencies are
d) None of the mentioned
also called as tuple generating View Answer
dependencies because they require other Answer: d
tuples of a certain form to be present in the Explanation: All of the mentioned normal
relation. forms i.e. BCNF, PJNF, 5NF exist. BCNF is
7. Functional dependencies are Boyce Codd normal form, 5NF is the fifth
sometimes referred to as ________
normal form and PJNF is project join normal d) Annormalization
form. View Answer
Answer: b
RDBMS Questions and Explanation: The process of making a
normalized schema unnormalized is called
Answers – Normal Forms as denormalization. Designers use it to tune
performance of systems to support time-
This set of RDBMS Multiple Choice critical operations.
Questions & Answers (MCQs) focuses 4. State true or false: Crosstabs are not
on “Database Design Process”. desirable in a database design
a) True
1. Which of the following is not a
b) False
process of generating a good relational
View Answer
schema?
a) Converting ER diagrams to relational Answer: a
schema Explanation: Crosstabs may be useful for
b) Decomposing the relational schema the users but they are not desirable in a
while satisfying functional dependencies database system because the queries would
c) Joining multiple relations together to get more complicated due to the addition of
cross tabs.
form a single relation containing all the
5. The data that have a time interval
attributes
associated with them during which they
d) A design of relations which is then
are valid are called as ________
tested and modified to satisfy given
a) Timed data
normal forms
b) Temporal data
View Answer
c) Model data
Answer: c d) Clocked data
Explanation: Joining multiple relations View Answer
together to form a single relation containing
all the attributes is not a method for the Answer: b
development of good relational schema Explanation: The data that have a time
because it might violate the normal forms if interval associated with them during which
it is combined. they are valid are called as Temporal data.
2. What is unique role assumption? We use the term snapshot to mean the
a) The attribute name has a unique value of the data at a particular point in time.
meaning in the database 6. The value of the data at a particular
b) The attributes are all unique time is called as?
c) No two tuples have even a single a) Instance
same value in a relation b) Picture
d) None of the mentioned c) Snapshot
View Answer d) None of the mentioned
View Answer
Answer: a
Explanation: Unique role assumption means Answer: c
that the attribute names must have unique Explanation: The value of the data at a
meaning in the database. This prevents us particular time is called as a snapshot. This
from using the same attribute to mean is used in temporal data.
different things in different schemas. 7. Functional dependencies that have a
3. The process of making a normalized time associated with them during which
schema unnormalized is called as they are valid are called as________
_________ a) Timed functional dependencies
a) Unnormalization b) Clocked functional dependencies
b) Denormalization c) Temporal functional dependencies
c) Renormalization d) Modeled functional dependencies
View Answer
Answer: c This set of RDBMS Multiple Choice
Explanation: Functional dependencies that Questions & Answers (MCQs) focuses
have a time associated with them during on “Web Fundamentals”.
which they are valid are called as temporal
functional dependencies. All snapshots of 1. Browsers use a standardized syntax
the relation should satisfy the functional called?
dependency for it to be a temporal functional a) TCP/IP
dependency. b) HTML
8. State true or false: Overlapping time c) XML
intervals cannot be prevented d) Java
a) True View Answer
b) False
View Answer Answer: b
Explanation: The Hypertext Markup
Answer: b Language [HTML] is the standardized
Explanation: IF a system supports a native syntax used by the browsers which supports
valid time type, then the system can detect formatted information as well as forms
and prevent overlapping time intervals. based interfaces.
9. Which of the following is the time of 2. A ______ is a globally unique name
temporal data that record when a fact for every document that can be
was recorded in a database? accessed on the Web
a) Transaction time a) ID
b) Valid time b) UCL
c) Enter time c) URL
d) Exit time d) UML
View Answer View Answer
Answer: a Answer: c
Explanation: The transaction time is the time Explanation: A URL (Uniform resource
of temporal data that records when a fact locator) is a globally unique name for every
was recorded in a database. document that can be accessed on the
10. To specify the foreign keys in Web.
relations referencing temporal data we 3. What is the full form of HTTP?
need to specify _______ a) Hyper Text Trial Program
a) The time interval b) Hyper Text Transfer Protocol
b) The Boolean value for the working c) Hyper Text Technology Protocol
c) The integer corresponding to the d) Hyper Text Trial Protocol
relation number View Answer
d) None of the mentioned
Answer: b
View Answer Explanation: HTTP – Hyper Text Transfer
Answer: a Protocol. This is aprotocol for transferring
Explanation: To specify the foreign keys in HTML documents.
relations referencing temporal data we need 4. A ______ is a program running on the
to specify the time interval. The time interval server which accepts requests from a
specification thus preserves referential browser and sends HTML documents
integrity in the relation. a) Web server
b) Web transmitter
c) Web intermediate
RDBMS Questions and d) Web multitasker
Answers – Web View Answer
Fundamentals Answer: a
Explanation: A Web Server is a program
running on the server which accepts
requests from a browser and sends HTML
documents. The browser and the web 9. Which of the following functions are
server communicate via HTTP. done by a web server?
5. What is the use of CGI? a) Accept requests from a web browser
a) It specifies the path of data transfer b) Sends back results in HTML
b) It specifies how the server c) Executes programs with arguments
communicates with the application supplied by the user
programs d) All of the mentioned
c) It charts out error handling View Answer
procedures in case an error arises
d) None of the mentioned Answer: d
Explanation: A web server accepts requests
View Answer
from a web browser and sends back results
Answer: b in HTML. The most important feature of a
Explanation: CGI specifies how the server web server is to execute programs with
communicates with application programs. arguments supplied by the user.
The application program communicates with 10. What is the function of the cascading
a database server in order to get data. style sheet
6. The extra information of a site a) Allows us to edit the HTML document
maintained at the client end is called as b) It is an IDE that allows us to write
_______ HTML codes more efficiently
a) Cookie c) It allows us to use the same style on
b) Password multiple HTML documents
c) History d) It acts as an intermediary to provide a
d) Sessions variety of information services
View Answer View Answer
Answer: a Answer: c
Explanation: The extra information of a site Explanation: The cascading style sheet
maintained at the client end is called as allows us to use the same style sheet on
cookie. It is a small piece of text containing multiple HTML documents allowing us to
identifying information with an associated maintain a distinctive but uniform look on all
name. the pages of a Web site.
7. State true or false: HTTP is
connectionless
a) True RDBMS Questions and
b) False Answers – Servlets and
View Answer
JSP
Answer: a
Explanation: HTTP is connectionless This set of RDBMS Multiple Choice
because most computer have a limit on the Questions & Answers (MCQs) focuses
simultaneous connections they can
on “Servlets and JSP”.
accommodate. If this limit is exceeded then
access is denied to further users. 1. The _______ specification defines an
8. What is the full form of CGI? application programming interface for
a) Common graphics interface communication between the server and
b) Common gateway interface the application program
c) Common gateway internet a) Java Servlet
d) Common gateway information b) JDBC
View Answer c) Java Applet
Answer: b d) Java Swing
Explanation: The full form of CGI is View Answer
Common Gateway Interface. This defines Answer: a
how a web server communicates with an Explanation: The java servlet specification
application program. defines an application programming
interface for communication between the allows HTML programmers to mix static
server and the application program. The HTML with dynamically generated HTML.
HttpServlet class in Java implements the 6. While using Javascript, the browser
servlet API specification. parses the HTML code into a tree like
2. State true or false: Servlets are used structure defined by a standard called
to generate dynamic responses to HTTP ________
requests. a) DOS
a) True b) DOD
b) False c) DOM
View Answer d) DON
Answer: a View Answer
Explanation: Servlets are used to generate Answer: c
dynamic responses to HTTP requests. The Explanation: While using Javascript, the
task of a servlet is to process a request browser parses the HTML code into a tree
dynamically. like structure defined by a standard called
3. Which of these functions is not a part Document Object Model (DOM). Javascript
of the servlet lifecycle code can modify the tree structure to carry
a) Checking if an instance of servlet out certain operations.
exists or not 7. Javascript is used to create dynamic
b) Invoking the service method of the webpages using technologies that are
servlet collectively called ________
c) Shutting down the servlet a) Ajax
d) Pausing the servlet for a given period b) Thor
of time. c) Dynamo
View Answer d) Achilles
View Answer
Answer: d
Explanation: Pausing the servlet for a given Answer: a
amount of time is not a part of the servlet Explanation: Javascript is used to create
lifecycle. A servlet can be checked, invoked dynamic webpages using technologies that
and destroyed but it cannot be paused. are collectively called Ajax.
4. Which of the following application 8. What are scripting languages?
servers do not provide built in support a) The programming languages that pre
for servlets? decide the web page content
a) Tomcat server b) The programming languages that are
b) Glassfish simpler and offer same protection
c) JBoss c) The programming languages that
d) None of the mentioned trade off simplicity for protection.
View Answer d) None of the mentioned
Answer: d
View Answer
Explanation: All of the mentioned application Answer: b
servers provide built in support for servlets. Explanation: Scripting languages are those
Glassfish and Tomcat are the most languages that are simpler with enriched
prominently used application servers. user interface features but offer the same
5. What is the full form of JSP? protection as that of Java.
a) Java servlet program 9. What are client side scripting
b) Java server pages languages?
c) Java server pages a) The languages designed to be
d) Java server program executed on the client’s web browser
View Answer b) The languages designed to be
Answer: b
executed on the server
Explanation: The full form of JSP is Java c) The languages designed to reduce
Server Pages. It is a scripting language that the amount of data costs incurred at the
client end 2. The ___________ provides a high
d) The languages designed to be level view of data and actions on data
executed in multiple computers a) Business-logic layer
paralleled with each other b) Data access layer
View Answer c) Data transfer layer
d) Business manager layer
Answer: a
Explanation: Client side scripting languages
View Answer
are those languages that are designed to be Answer: a
executed on the client’s web browser. These Explanation: The Business-logic layer
languages provide constructs that can be provides a high level view of data and
embedded with an HTML document. actions on data. An object oriented
10. State true or false: Executing approach is used to code this layer.
programs at the client side is slower 3. The _________ layer provides the
than executing programs on the server interface between the business logic
a) True layer and the underlying database
b) False a) Business-logic layer
View Answer b) Data access layer
Answer: b
c) Data transfer layer
Explanation: Executing programs on the d) Business manager layer
client side is faster than executing programs View Answer
on the server which includes sending every Answer: b
interaction to the server. Explanation: The data-access layer provides
the interface between the business logic
layer and the underlying database. The data
RDBMS Questions and access layer provides the mapping from the
Answers – Application object oriented data model to the relational
model.
Architectures 4. What are workflows in a business
logic layer?
This set of RDBMS Multiple Choice a) They describe how a particular task
Questions & Answers (MCQs) focuses that involves servers is handled
on “Application Architectures”. b) They describe how multiple tasks
1. Which of the following is true involving a single participant is handled
regarding the model-view- controller c) They describe how a particular task
architecture? involving multiple participants is
a) The model corresponds to the handled.
business logic layer d) None of the mentioned
b) The view defines the presentation of View Answer
data Answer: c
c) The controller receives events, Explanation: Business logic includes
executes actions on the model and workflows. Workflows in a business logic
returns a view layer describe how a particular task
d) All of the mentioned involving multiple participants is handled.
View Answer 5. State true or false: The code
implementing the actions in the business
Answer: d
logic layer ensures that business rules
Explanation: In the model-view-controller
architecture, the model corresponds to the
are followed
business logic layer, the view defines the a) True
way data is presented and the controller b) False
receives events, executes actions on the View Answer
model and returns a view.
Answer: a
Explanation: The code implementing the
actions in the business logic layer ensures usage
that business rules are followed. For c) They are the tools that prevent
example a student can only enroll in a database querying and instead they
course if the prerequisites are completed. generate pie charts and graphs
6. What is the full form of JSON? d) None of the mentioned
a) JavaScript Object Native View Answer
b) JavaScript Object Notation
c) JavaScript Object Negation Answer: a
d) Java Object Notation Explanation: Report generators are the tools
View Answer to generate human readable reports from a
database. They integrate querying the
Answer: b database with the creation of formatted text
Explanation: JSON – JavaScript Object and summary charts.
Notation. This is an encoding for javascript 10. Which of the following methods is
objects. used to reduce overhead?
7. Which of the following features does a) Connection pooling
Rapid Application Development b) Parallel Processing
possess? c) Caching Query Results at the server
a) Provide a library of functions to d) All of the mentioned
generate UI elements View Answer
b) Provide drag and drop features in a n
IDE Answer: d
Explanation: To reduce overhead, any of the
c) Auto generation of code for the user
following methods can be used. Connection
interface from a declarative specification pooling, Parallel processing or caching
d) All of the mentioned query results at the server. Caching query
View Answer results at the server enables to reduce the
Answer: d number of database accesses every time a
Explanation: The main features of Rapid similar request is sent.
Application development are to provide a
library of functions for GUI development, to
provide drag and drop features in an IDE, RDBMS Questions and
Auto-generation of code for the user Answers – Application
interface from a declarative specification.
8. Which of the following is not a web Security
application development framework
feature? This set of RDBMS Multiple Choice
a) An object oriented model Questions & Answers (MCQs) focuses
b) A declarative way of specifying a form on “Application Security”.
with validation constraints 1. If an attacker manages to get an
c) Creating mass servers for effective application to execute an SQL query
handling of data created by the attacker, then such
d) A template scripting system attacks are called as _________
View Answer a) SQL attacks
Answer: c b) SQL injection attacks
Explanation: Creating mass servers for c) SQL usage attack
effective handling of data is not a part of the d) SQL destroyer attack
web application development framework View Answer
feature.
Answer: b
9. What are report generators?
Explanation: If an attacker manages to get
a) They are the tools to generate human an application to execute an SQL query
readable reports from a database created by the attacker, then such attacks
b) They are the tools that generate are called as SQL injection attacks.
reports on the statistics of the database
2. An attack on a website that stores and 6. What are man in the middle attacks?
displays text to a user is known as a) Users are forced to use a second
______ attack server which causes the attack
a) SQL attack b) Users are forced to divert to a fake
b) XSS attack site where the attack takes place
c) XRP attack c) Users are fooled by similar GUI and
d) None of the mentioned data is extracted from them.
View Answer d) None of the mentioned
View Answer
Answer: b
Explanation: An attack on a website that Answer: b
stores and displays text to a user is known Explanation: Man in the middle attacks are
as XSS attack. It is called as cross site those attacks in which the users are forced
scripting attack. to divert to a fake site where the attack
3. The URL of the page that had the link takes place. The fake site is then used to
that the user clicked to access the page obtain the data from the user.
is called as _____ 7. What are phishing attacks?
a) Source a) Users are forced to use a second
b) Linker server which causes the attack
c) Leaker b) Users are forced to divert to a fake
d) Referrer site where the attack takes place
View Answer c) Users are fooled by similar GUI and
data is extracted from them.
Answer: d
d) None of the mentioned
Explanation: The URL of the page that had
the link that the user clicked to access the
View Answer
page is called as referrer. The HTTP Answer: c
protocol allows the server to check the Explanation: Phishing attacks are those
referrer. attacks in which users are fooled by similar
4. State true or false: Password leakage GUI and data is extracted from them. The
is a major security problem fake site is then used to obtain the data from
a) True the user.
b) False 8. What is the standard for exchanging
View Answer authentication and authorization
information between two different
Answer: a
security domains?
Explanation: Password leakage is a major
security problem because the leaked
a) SABM
password grants access to malicious b) STML
visitors. c) SPTA
5. The system where two independent d) SAML
pieces of data are used to identify a user View Answer
is called as ______ Answer: d
a) Two system authentication Explanation: SAML (Security assertion
b) ID password authentication Markup Language) is the standard for
c) Two factor authentication exchanging authentication and authorization
d) Multi data authentication information between two different security
View Answer domains. This provides a cross-organization
sign-on.
Answer: c 9. A log of all changes to the application
Explanation: The system where two data is called as __________
independent pieces of data are used to
a) Audit trail
identify a user is called as two-factor
authentication. The two factors should not
b) Audit log
share a common vulnerability. c) Audit lead
d) Data log memory
View Answer d) None of the mentioned
View Answer
Answer: a
Explanation: A log of all changes to the Answer: a
application data is called as audit trail. This Explanation: Data is retained in flash
helps us maintain security as it tracks all the memory. Power losses do not affect the
breaches on the system. data stored in flash memory.
10. Which of the following is a valid 3. What is the full form of USB?
encryption technique? a) Universal Serial Binary
a) Parallel key encryption b) Universal Storage Base
b) Public key encryption c) Universal Serial Bus
c) Systematic key encryption d) Uninterrupted Service Bus
d) All of the mentioned View Answer
View Answer
Answer: c
Answer: b Explanation: USB – Universal Serial Bus.
Explanation: Out of the given options, only This is currently the most popular and
public key encryption is a valid approach to convenient way of data transmittal.
an encryption technique. In this, there are 4. DVD is a form of ______ storage
two different keys to encrypt the data. a) Magnetic storage
b) USB storage
c) Tape storage
RDBMS Questions and d) Optical storage
Answers – Magnetic Disk View Answer
and Flash Storage Answer: d
Explanation: DVD is a form of optical
This set of This set of RDBMS Quiz storage. The data on a DVD is read by an
focuses on “Magnetic Disk and Flash optical reader.
Storage”. Multiple Choice Questions & 5. Which of the following is a part of the
Answers (MCQs) focuses on “Basic Magnetic disk assembly?
Storage, Magnetic Disk and Flash a) Spindle
Storage”. b) Read write head
c) Arm
1. Statement 1: Cache storage is very d) All of the mentioned
fast View Answer
Statement 2: Cache storage is very
cheap Answer: d
a) Both the statements are true Explanation: In a magnetic disk assembly,
Spindle is the central cylindrical rod, Read
b) Statement 1 is true but statement 2 is
write head is used to read and write data
false and the arm is used to hold the magnetic
c) Statement 1 is false but statement 2 is disk.
true 6. When a large number of disks are
d) Both the statements are false connected by a high speed network to a
View Answer number of server computers, it is known
Answer: b as ________ architecture
Explanation: Cache storage is very fast but a) Storage area network
it is the costliest form of storage. b) High performance network
2. What is the difference between flash c) Multiple disk network
memory and main memory? d) Local area network
a) Data is retained in flash memory View Answer
b) Data access is faster in flash memory
Answer: a
c) Data storage is very large in flash Explanation: When a large number of disks
are connected by a high speed network to a data and storing it in a temporary memory
number of server computers, it is known as location called as the data buffer for future
Storage Area Network (SAN) architecture. requests. The data in the buffer is temporary
These disks are usually arranged by a local and is deleted after usage.
organization technique called RAID. 11. What is an NVRAM?
7. The time from when a read or write a) RAM which is non-volatile in nature
request is issued to when the actual b) RAM whose data is not lost during
data transfer begins is called _______ power failures
a) Seek time c) RAM that significantly speeds up data
b) Access time transfers
c) Average latency time d) All of the mentioned
d) Data transfer rate View Answer
View Answer
Answer: d
Answer: b Explanation: A non-volatile random access
Explanation: The time from when a read or memory or NVRAM is the one which is non-
write request is issued to when the actual volatile, data is retained during power failure
data transfer begins is called access time. and which considerably speeds up the disk
Data transfer rate is the rate at which data writes.
can be retrieved from the storage. 12. Files that support log disks are
8. The time for repositioning the arm is called as ________
called as _________ a) Logging file systems
a) Seek time b) Jorte File Systems
b) Access time c) Journaling File Systems
c) Reposition time d) Channelizing File Systems
d) Latency time View Answer
View Answer
Answer: c
Answer: a Explanation: Files that support log disks are
Explanation: The time for repositioning the called as Journaling File Systems.
arm is called as Seek time. Journaling file systems can be implemented
9. Which of the following is a measure of without a separate log disk, keeping the
reliability of a disk? data and the log on the same disk.
a) Seek time advertisement
b) Average latency time
13. State true or false: NOR flash is
c) Mean time to failure
cheaper than NAND flash
d) Average seek time
a) True
View Answer
b) False
Answer: c View Answer
Explanation: The mean time to failure is the
measure of the reliability of a disk. It gives Answer: b
the mean of the times that most disks last. Explanation: NAND flash is significantly
cheaper than NOR flash and also has a
10. What is buffering?
higher storage capacity and hence is widely
a) The blocks read from disk are directly used.
accessed 14. The logical to physical page
b) The blocks read from disk are mapping is represented in a
temporarily stored in a memory ____________
c) The blocks read from disk are a) Logic physical table
organized in a particular fashion to cater b) Transition table
requests. c) Wear leveling table
d) None of the mentioned d) Logic log table
View Answer View Answer
Answer: b
Explanation: Buffering involves reading the
Answer: b d) Block level striping
Explanation: The logical to physical page View Answer
mapping is represented in a Transition table
which is generally available in memory. This Answer: c
is used for quick access of data. Explanation: Data striping by splitting bits
across multiple disks is called as bit level
striping. For example if we have an array of
RDBMS Questions and 8 disks, we write bit I of each byte to disk i.
5. How many levels of RAID exist?
Answers – RAID a) 5
b) 6
This set of RDBMS Multiple Choice
c) 7
Questions & Answers (MCQs) focuses d) 8
on “RAID”.
View Answer
1. What is the full form of RAID? Answer: c
a) Redundant Array of Independent Explanation: There exist a total of 7 RAID
Disks levels ranging from 0 to 6.
b) Reliable Array of Independent Disks 6. RAID level 0 refers to?
c) Redundant Asset Increment Data a) Disk arrays with striping at the level of
d) Reliable Aggravation of Immaculate blocks
Data b) Disk mirroring with block striping
View Answer c) Memory style error correcting code
Answer: a d) Block interleaved distributed parity
Explanation: The full form of RAID is View Answer
Redundant array of Independent Disks. This Answer: a
disk organization technique improves Explanation: RAID level 0 refers to Disk
performance and reliability. arrays with striping at the level of blocks.
2. The process of duplicating every disk This level does not have any redundancy.
is called _______ 7. RAID level 1 refers to?
a) Incremention a) Disk arrays with striping at the level of
b) Arraying blocks
c) Mirroring b) Disk mirroring with block striping
d) Reflecting c) Memory style error correcting code
View Answer d) Block interleaved distributed parity
Answer: c View Answer
Explanation: The simplest technique to Answer: b
introduce redundancy is to duplicate every Explanation: RAID level 1 refers to Disk
disk. This process is known as Mirroring. mirroring with block striping. This is also
3. State true or false: Using RAID called as RAID 10 or RAID 1+0.
increases the mean time to failure 8. RAID level 2 refers to?
a) True a) Disk arrays with striping at the level of
b) False blocks
View Answer b) Disk mirroring with block striping
Answer: a c) Memory style error correcting code
Explanation: Using RAID enables us to use d) Block interleaved distributed parity
multiple disks which when combined View Answer
together increase the mean time to failure.
Answer: c
4. Data striping by splitting bits across
Explanation: RAID level 2 refers to Memory
multiple disks is called as _______ style error correcting code. Memory systems
a) RAID striping have long parity bits for error detection and
b) Array striping correction.
c) Bit level striping
9. RAID level 5 refers to? Answer: b
a) Disk arrays with striping at the level of Explanation: Jukeboxes are the devices that
blocks store a lot of optical disks and load them
b) Disk mirroring with block striping automatically on demand.
c) Memory style error correcting code 3. Which of the following is true about
d) Block interleaved distributed parity file header?
View Answer a) It is allocated at the beginning of the
file
Answer: d b) It has information about the file
Explanation: RAID level 5 refers to Block c) It generally contains the address of
interleaved distributed parity. It partitions the first record in it
both the data and parity among N+1 disks.
d) All of the mentioned
10. Which of the factors need not be View Answer
taken into consideration while choosing
a RAID level? Answer: d
a) Monetary cost Explanation: A file header is a certain
b) I/O requirements number of bytes allocated at the beginning
c) Performance when the disk has failed of the file. It contains a variety of information
about the file and it can be used to point the
d) None of the mentioned
first record by storing the address of the first
View Answer record in it.
Answer: d 4. How can variable length records arise
Explanation: Monetary cost, I/O in a file
requirements, performance when disk has a) Storage of multiple record types in a
failed are to be taken into consideration file
while choosing a RAID level. b) Record types that allow variable
lengths for one or more fields
c) Record types that allow repeating
RDBMS Questions and fields, such as arrays or multisets
Answers – File Organization d) All of the mentioned
View Answer
This set of RDBMS Multiple Choice
Questions & Answers (MCQs) focuses Answer: d
Explanation: Variable length records arise in
on “Tertiary Storage and File
a system in several ways like, Storage of
Organization”. multiple record types in a file. Record types
1. What is the approximate storage that allow variable lengths for one or more
capacity of CDs in MB fields. Record types that allow repeating
fields, such as arrays or multisets.
a) 300
5. What does a null bitmap indicate?
b) 700
a) The database does not exist
c) 1100
b) The record does not exist
d) 1500
c) The attributes of a record do not have
View Answer
a value
Answer: b d) The attributes are missing from
Explanations: CDs generally have a storage record
capacity of 700 Megabytes and DVDs have View Answer
a storage capacity of around 4.7 Gigabytes.
2. The devices that store a lot of optical Answer: c
disks are called as Explanation: A null-bitmap indicates that the
a) Optical reservoirs attributes of a particular record have null
values.
b) Jukeboxes
6. State true or False: Variable length
c) Karaoke machines
records cannot be implemented
d) Sequential access machines
a) True
View Answer
b) False a) True
View Answer b) False
View Answer
Answer: b
Explanation: Variable length records can be Answer: b
implemented in databases. There are Explanation: It is tough to delete a record
different techniques to implement variable from the fixed length records but it is easier
length records. to delete a record from the variable length
7. The linked list formed by the deleted record. Thus, implementation of variable
records is called as ______ records is preferred.
a) Delete list
b) Free list
c) Null list RDBMS Questions and
d) Non-existent list Answers – Organization of
View Answer
Records in Files
Answer: b
Explanation: As the addresses can be This set of RDBMS MCQs focuses on
thought of as pointers, the deleted records “Organization of Records in Files”.
thus form a linked list. The linked list formed
by the deleted records is called as a free list. 1. What is heap file organization?
8. The slotted page structure is used for a) Any record can be placed wherever
_________ there is a space for the record
a) Organizing records in a block b) Records are stored in a sequential
b) Organizing blocks in a database order according to a search key
c) Deleting records from a block c) A hash function is computed on some
d) None of the mentioned attribute and that decides the block
View Answer d) None of the mentioned
View Answer
Answer: a
Explanation: The slotted page structure is Answer: a
used for organizing records in a block. The Explanation: Heap file organization means
slotted page structure contains a header at that any record can be placed wherever
the beginning of each block. there is space for that record. There is no
9. The header in the slotted page ordering of records. Typically there is a
structure does not contain which of the single file for each relation.
following data? 2. What is sequential file organization?
a) The number of record entries in the a) Any record can be placed wherever
header there is a space for the record
b) The end of free space in a block b) Records are stored in a sequential
c) The size of all the records put order according to a search key
together in the header c) A hash function is computed on some
d) An array containing location and size attribute and that decides the block
of each record d) None of the mentioned
View Answer View Answer
Answer: c Answer: b
Explanation: The header in the slotted page Explanation: Sequential file organization
structure does not contain the size of all the means that Records are stored in a
records put together in the header but it sequential order according to a search key.
contains the number of record entries, the The records are ordered.
end of free space and an array containing 3. What is hashing file organization?
location and size of each record. a) Any record can be placed wherever
10. State true or false: It is easier to there is a space for the record
delete a record from the fixed length b) Records are stored in a sequential
records order according to a search key
c) A hash function is computed on some introducing an external attribute
attribute and that decides the block d) None of the mentioned
d) None of the mentioned View Answer
View Answer
Answer: a
Answer: c Explanation: A multitable clustering file
Explanation: Hashing file organization organization stores the related records of
means that a hash function is computed on two or more relations in each block. This
some attribute and that decides the block. allows us to read records that satisfy a join
The result of the hash function specifies condition by using one block read.
which block of the file the record should be 8. Which of the following need to be
placed in. stored in the data dictionary?
4. What is a search key in sequential file a) Name of the relation
organization? b) Domains and lengths of attributes
a) A number assigned to each record c) Integrity constraints
b) Necessarily the primary key d) All of the mentioned
c) Any attribute or a set of attributes View Answer
d) None of the mentioned
Answer: d
View Answer
Explanation: Name of the relation, Domains
Answer: c and lengths of attributes and Integrity
Explanation: A search key in sequential file constraints all must be stored in the data
organization is any attribute or a set of dictionary.
attributes that need not be a primary key or 9. The subsystem responsible for the
even a superkey. allocation of buffer space is called as
5. Metadata about the relations are _______
stored in ________ a) Buffer allocator
a) File header b) Buffer manager
b) Data dictionary c) Buffer enhancer
c) Data query d) Buffer intermediary
d) Data analyser View Answer
View Answer
Answer: b
Answer: b Explanation: The subsystem responsible for
Explanation: A relational schema needs to the allocation of buffer space is called as
maintain data about the data called as buffer manager. Programs on the database
metadata. Metadata about the relations is make requests to the buffer manager and it
stored in the Data dictionary. in in turn allocates the buffer space.
6. Data dictionary is also called as 10. What is the full form of LRU (in
________ buffer replacement strategy)?
a) Data log a) Least Reactive User
b) System log b) Least Recently Used
c) System catalog c) Least Read URL
d) System database log d) Lowest Reading User
View Answer View Answer
Answer: c Answer: b
Explanation: Data dictionary is also called Explanation: The full form of LRU is Least
as System Catalog. Recently Used. In this, the least recently
7. What is a multitable clustering file used program is substituted by the new
organization? request.
a) It stores related records of two or
more relations in each block
b) It stores related data about the RDBMS Questions and
relations in each block Answers – Ordered Indices
c) It links each and every block by
This set of RDBMS Multiple Choice Answer: b
Questions & Answers (MCQs) focuses Explanation: The time it takes to delete a
on “Ordered Indices”. data item is called as deletion time. This
value includes finding the item to be deleted
1. The types of access that are and the time taken to update the index
supported efficiently are called as structure.
________ 5. The additional space occupied by an
a) Access modes index structure is called as _________
b) Access types a) Access modes
c) Access time b) Space types
d) Access overhead c) Access time
View Answer d) Space overhead
View Answer
Answer: b
Explanation: The types of access that are Answer: d
supported efficiently are called as Access Explanation: The additional space occupied
types. Access types can include finding by an index structure is called as space
records with a specified attribute value or overhead. It is usually a worthwhile sacrifice
within a particular range. to achieve improved performance.
2. The time it takes to find a particular 6. If the file containing the records is
data item is called as ___________ sequentially ordered, a ___________ is
a) Insertion time an index whose search key also defines
b) Deletion time the sequential order of the file.
c) Time overhead a) Clustering data
d) Access time b) Cluttering index
View Answer c) Clustering index
d) Clustering number
Answer: d
Explanation: The time it takes to find a
View Answer
particular data item or a set of data items Answer: b
using the technique in question is called as Explanation: If the file containing the records
access time. is sequentially ordered, a Clustering index is
3. The time it takes to insert a new data an index whose search key also defines the
item is called ____________ sequential order of the file. Clustering
a) Insertion time indices are also called as primary indices
b) Deletion time but they do not denote an index on the
c) Time overhead primary key. Such indices can be built on
d) Access time any search key.
View Answer 7. State true or false: Clustering indices
are also called as primary indices
Answer: a a) True
Explanation: The time it takes to insert a b) False
new data item is called Insertion time. This View Answer
value includes the time taken to find the
correct place to insert the new data item as Answer: a
well as the time it takes to update the index Explanation: If the file containing the records
structure. is sequentially ordered, a Clustering index is
4. The time it takes to delete a data item an index whose search key also defines the
is called as _________ sequential order of the file. Clustering
a) Insertion time indices are also called as primary indices.
b) Deletion time 8. If an index entry appears for every
c) Time overhead search key value in the file, it is called
d) Access time as ________
View Answer a) Dense key
b) Dense index
c) Sparse key
d) Sparse index RDBMS Questions and
View Answer
Answers – B+ trees
Answer: b
Explanation: In a dense index, an index This set of RDBMS Multiple Choice
entry appears for every search key value in Questions & Answers (MCQs) focuses
the file. In a dense clustering index, the
index record contains the search-key value
on “B+ Tree Index Files”.
and a pointer to the first data record with 1. State true or false: B+ trees are not
that search-key value. always balanced trees.
9. If an index entry appears for only a) True
some of the search key values in the b) False
file, it is called as ________ View Answer
a) Dense key
b) Dense index Answer: b
c) Sparse key Explanation: B+ trees are always balanced.
d) Sparse index Every path from the root to the leaf of the
tree is of the same length.
View Answer
2. What are the leaf nodes in a B+ tree?
Answer: d a) The topmost nodes
Explanation: In a sparse index, an index b) The bottommost nodes
entry appears for only some of the search c) The nodes in between the top and
key values. Sparse indices can be used only bottom nodes
if the relation is stored in the sorted order of d) None of the mentioned
the search key i.e. if the index is a clustering
index.
View Answer
10. Indices with two or more levels are Answer: b
called as? Explanation: The bottommost nodes that
a) Multiple Indices mark the end of a tree are known as the leaf
b) Multilevel indices nodes in a B+ tree.
c) Bi- tri- Indices 3. Non-leaf nodes are also called as
d) None of the mentioned __________
View Answer a) Internal nodes
b) External nodes
Answer: b c) Middle nodes
Explanation: Indices with two or more levels d) Primary nodes
are called as multilevel indices. They require
significantly few I/O operations than
View Answer
searching using binary search. Answer: a
advertisement Explanation: Non leaf nodes are also known
as internal nodes. A non-leaf node may hold
11. A search key containing more than up to n pointers and should hold at least n/2
one attribute is called a _________ pointers.
search key 4. The queries used to find all records
a) Multiple with search key values in a particular
b) Multilevel range are known as ________
c) Composite a) Gap queries
d) Primary b) Graph queries
View Answer c) Range queries
Answer: b d) None of the mentioned
Explanation: A search key containing more View Answer
than one attribute is called as a composite Answer: c
search key. The structure of the index is the Explanation: The queries used to find all
same as that of any other index, the only records with search key values in a
difference being that it is not a single search particular range are known as Range
attribute but a list of attributes.
queries. These type of queries are executed 8. Insertion of a large number of entries
using procedures. at a time into an index is referred to as
5. Statement 1: Insertion of record might _______ of the index.
require the change in position of the a) Bulk loading
initial nodes. b) Mass insertion
Statement 2: Deletion of records might c) Quick insertion
require the change in position of the d) Quick loading
initial nodes. View Answer
a) Both the statements are true
b) Statement 1 is true but statement 2 is Answer: a
Explanation: Insertion of a large number of
false
entries at a time into an index is referred to
c) Statement 2 is true but statement 1 is as bulk loading of the index. This reduces
false the time complexity as multiple entries are
d) Both the statements are false loaded at the same time.
View Answer 9. ___________ are the indices that
Answer: a store the values of some attributes along
Explanation: Both insertion and deletion of with the pointers to the recor.
records might require the change in position a) Binary indices
of the initial nodes because the new data b) Covering indices
value might not exactly fit into the B+ tree. c) Key indices
Thus rotation of the nodes is generally d) Static indices
required. View Answer
6. If a relation can have more than one
record containing the same search key Answer: b
value, the search key is said to be a Explanation: Covering indices are the
indices that store the values of some
__________
attributes along with the pointers to the
a) Unique search key record. Storing extra attribute values is
b) Non unique search key useful as they allow us to Answer queries
c) Multiple search key without actually looking up the records.
d) Identical search key
View Answer
Answer: b
RDBMS Questions and
Explanation: If a relation can have more Answers – Static Hashing
than one record containing the same search
key value, the search key is said to be a This set of RDBMS Multiple Choice
non-unique search key. A problem with non- Questions & Answers (MCQs) focuses
unique search keys is inefficiency during on “Static Hashing”.
delete operations.
7. State true or false: The fanout of 1. The term ______ is used to denote a
nodes can be increased by using a unit of storage that can store one or
technique called _________ more records
a) Prefix compression a) Basket
b) Postfix compression b) Bucket
c) Prefix expansion c) Unit
d) Postfix expansion d) Set
View Answer View Answer
Answer: a Answer: b
Explanation: The fanout of nodes can be Explanation: The term bucket is used to
increased by using a technique called prefix denote a unit of storage that can store one
compression. In this, we do not store the or more records. A bucket is typically a disk
entire value of the search key at the node. block but it can also be larger than a disk
We only store the prefix of the search key. block.
advertisement
2. If K denotes the set of all the search b) There are insufficient buckets
key values, and B denotes the set of all c) When Bucket skew occurs
bucket addresses, a function from K to B d) All of the mentioned
is called as __________ View Answer
a) Bucket function
Answer: d
b) Address function Explanation: Bucket overflow can occur in
c) Hash function many ways. When a bucket does not have
d) Search function enough space, there are insufficient
View Answer buckets, when a bucket skew occurs.
Answer: c 6. Some buckets are assigned more
Explanation: If K denotes the set of all the records than the others which causes
search key values, and B denotes the set of bucket overflow, this condition is called
all bucket addresses, a function h from K to as ________
B is called as the hash function. It a) Bucket sufficiency
determines which bucket should contain the b) Bucket insufficiency
data in question. c) Bucket skew
3. In a __________ , we obtain the d) Bucket normalcy
address of the disk block containing a View Answer
desired record directly by computing a
function on the search key value of the Answer: c
Explanation: Some buckets are assigned
record
more records than the others which causes
a) Hash file organization bucket overflow, this condition is called as
b) Hash index organization Bucket skew. Skew occurs if multiple
c) Hashing address records have the same search key or if the
d) None of the mentioned given hash function is non uniform.
View Answer 7. Overflow handling using a linked list
Answer: a of buckets is called as ____________
Explanation: Hashing can be used for 2 a) Bucket chaining
different purposes, hash file organization b) Overflow chaining
and hash index organization. In a Hash file c) Bucket linking
organization, we obtain the address of the d) Overflow linking
disk block containing a desired record View Answer
directly by computing a function on the
search key value of the record. Answer: b
4. In a __________ we organize the Explanation: All the overflow buckets are
chained together in a linked list. Overflow
search keys, with their associated
handling using a linked list of buckets is
pointers, into a hash file structure called as Overflow chaining.
a) Hash file organization 8. State true or false: A hash index
b) Hash index organization organizes the search keys, with their
c) Hashing address associated pointers, into a hash file
d) None of the mentioned structure
View Answer a) True
Answer: b b) False
Explanation: Hashing can be used for 2 View Answer
different purposes, hash file organization
and hash index organization. In a hash Answer: a
index organization, we organize the search Explanation: A hash index organizes the
keys, with their associated pointers, into a search keys, with their associated pointers,
hash file structure. into a hash file structure. We can construct a
hash index by applying a hash function on a
5. What is a bucket overflow?
search key and store the key and its
a) When a bucket does not have enough associated pointers in the bucket.
space
9. Which of the following is the worst d) Movable hashing
hash function among the given choices View Answer
a) The sum of the digits modulo 8
Answer: b
b) The sum of the digits modulo 2 Explanation: Dynamic hashing is also called
c) The sum of the digits modulo 5 as extendable hashing because it can
d) The sum of the digits accommodate the growth and shrinkage of
View Answer the database.
Answer: d 3. Which of the following operations can
Explanation: The sum of the digits classifies be performed on an extendable hash
the data into the highest number of buckets, structure?
thus making the job to track the buckets a) Lookup
more difficult than the rest. b) Insertion
10. State true or false: Hash indices are c) Deletion
only primary index structures d) All of the mentioned
a) True View Answer
b) False
Answer: d
View Answer Explanation: We can perform lookup,
Answer: a insertion and deletion on a dynamic hash
Explanation: Hash indices are only structure.
secondary index structures. A hash index is 4. The space overhead in dynamic
never needed as a clustering index hashing is ________ than that of static
structure. hashing
a) More
b) Less
RDBMS Questions and c) Equal
Answers – Dynamic d) None of the mentioned
View Answer
Hashing
Answer: b
This set of RDBMS Multiple Choice Explanation: The space overhead in
Questions & Answers (MCQs) focuses dynamic hashing is less than that of static
on “Dynamic Hashing”. hashing. This is because the hash function
is chosen based on the size of the file at
1. Dynamic hashing allows us to? some anticipated point in the future.
a) Accommodate the growth of the 5. Which of the following is a
database disadvantage of the dynamic hashing
b) Accommodate the shrinkage of the structure
database a) Buckets can be allocated dynamically
c) Allows modification of hash function b) Lookup involves additional level of
d) All of the mentioned indirection
View Answer c) It involves a lesser space overhead
d) Hash structure can be modified
Answer: d
Explanation: Dynamic hashing allows us to
dynamically
accommodate the growth of the database View Answer
and the shrinkage of the database by Answer: b
allowing us to change the hash function Explanation: In dynamic hashing, lookup
dynamically. involves an additional level of indirection.
2. Dynamic hashing is also called as The rest of the options are the advantages
_________ of dynamic hashing.
a) Extended hashing 6. The form of dynamic hashing that
b) Extendable hashing avoids the additional level of indirection
c) Static hashing is called as _________
a) Linear hashing
b) Static hashing 10. Which of the following hash function
c) Directive hashing classifies data into the highest number
d) Indirective hashing of buckets ?
View Answer a) Sum of digits modulo 8
b) Sum of digits modulo 5
Answer: a
Explanation: The form of dynamic hashing
c) Sum of digits modulo 2
that avoids the additional level of indirection d) Sum of digits
is called as Linear hashing. This has more View Answer
overflow buckets than extendable hashing. Answer: d
7. Hash structures are not the best Explanation: The sum of the digits hash
choice for which of the following? function classifies the data into 10 different
a) A search key on which individual buckets thus making it the highest.
point queries are likely
b) A search key which is invalid
c) A search key on which range queries RDBMS Questions and
are likely Answers – Bitmap Indices
d) A search key on which multi-level
queries are likely This set of RDBMS Multiple Choice
View Answer Questions & Answers (MCQs) focuses
Answer: c on “Bitmap Indices”.
Explanation: Hash structures are not the 1. A bitmap is _______
best choice for search keys on which range
a) An array of bits
queries are likely because the range queries
might contain different values of the search b) An index of bits
keys which might result in improper c) A function mapping all the bits of data
placement in the hash table. d) None of the mentioned
8. Which of the following is an issue that View Answer
needs to be considered while choosing Answer: a
an indexing technique? Explanation: A bitmap is simply an array of
a) Frequency of insertion and deletion bits. A bitmap can be used for various
b) Data types of the data purposes such as bitmap indexing.
c) Number of items in the relation 2. A _________ on the attribute A of
d) None of the mentioned relation r consists of one bitmap for each
View Answer value that A can take
a) Bitmap array
Answer: a
Explanation: The frequency of insertion and b) Bitmap index
deletion has to be taken into consideration c) Bitmap excess
while choosing an indexing technique. The d) Bitmap
frequency of insertion and deletion View Answer
determines the hash index.
Answer: b
9. Which of the following hash function Explanation: A bitmap index on the attribute
classifies data into least number of A of relation r consists of one bitmap for
buckets? each value that A can take. Each bitmap
a) Sum of digits modulo 8 contains as many bits as the number of
b) Sum of digits modulo 5 records in the relation.
c) Sum of digits modulo 2 3. Intersection of the bitmaps is done by
d) Sum of digits a) Logical AND
View Answer b) Logical OR
c) Logical NOT
Answer: a
Explanation: The sum of digits modulo 2 d) Logical NOR
classifies the data into only 2 buckets i.e. 0 View Answer
and 1.
Answer: a a) Remove index
Explanation: The intersection of the bitmaps b) Delete index
is done by the logical AND operation. This is c) Drop index
similar to the binary set intersection d) None of the mentioned
operation which is done by the logical AND
View Answer
operation.
4. What does an existence bitmap do? Answer: c
a) It recognizes deleted records Explanation: We delete and index in SQL
b) It inserts values into empty bitmaps using the drop index command. Syntax:
c) It makes sure that no records are drop index ;
deleted 9. State true or false: Intersection
d) None of the mentioned operations are extremely slow on
View Answer bitmaps
a) True
Answer: a b) False
Explanation: An existence bitmap is used to View Answer
recognize deleted records and not to
prevent deletion of records. It also does not Answer: b
insert any records into empty bitmaps. Explanation: Intersection operations are
5. The complement operation in bitmaps extremely fast on bitmaps making them
is done by using ideal for supporting queries on multiple
a) Logical AND attributes.
b) Logical OR 10. Which of the following operations is
c) Logical NOT used for the union of bitmaps?
d) Logical NOR a) Logical AND
View Answer b) Logical OR
c) Logical NOT
Answer: c d) Logical NOR
Explanation: The complement operation in View Answer
bitmaps is done by using the logical not
operator. This is similar to the binary Answer: b
complement operation. Explanation: The logical OR operation is
6. State true or false: Bitmaps can be used for the computation of the union of
combined with B+ trees bitmaps. This is similar to the binary set
a) True union operation.
b) False
View Answer
RDBMS Questions and
Answer: a
Explanation: Bitmaps can be combined with
Answers – Query
B+ trees for relations where a few attribute Processing – Selection
values are extremely common.
7. We create an index in SQL using Operation & Sorting
_______ command
This set of RDBMS Multiple Choice
a) Create index
Questions & Answers focuses on “Query
b) New index
Processing – Selection Operation &
c) Create new index
Sorting”.
d) Develop index
View Answer 1. Which of the following are steps in
Answer: a
query processing?
Explanation: We create an index in SQL a) Parsing and translation
using the create index command. Eg: create b) Optimization
index dept_index on instructor(dept_name). c) Evaluation
8. We delete and index in SQL using the d) All of the mentioned
________ command View Answer
Answer: d Answer: a
Explanation: Parsing and translation, Explanation: Search algorithms that use an
optimization, evaluation are all the basic index are called as index scans. We use the
steps to process a query. selection predicate to guide us through the
2. A relational algebra operation choice of index to use in processing the
annotated with instructions on how to query.
evaluate it is called _______ 6. Sorting of relations that do not fit in
a) Evaluation algebra memory is called as _______
b) Evaluation plan a) Internal sorting
c) Evaluation primitive b) External sorting
d) Evaluation engine c) Overflow sorting
View Answer d) Overload sorting
View Answer
Answer: c
Explanation: A relational algebra operation Answer: b
annotated with instructions on how to Explanation: Sorting of relations that do not
evaluate it is called Evaluation primitive. The fit in memory is called as external sorting.
evaluation primitive is the basis for 7. A selection of the form satisfying the
evaluation of queries. intersection of all records satisfying
3. A sequence of primitive operations individual simple conditions is
that can be used to evaluate a query are a) Conjunctive selection
called as __________ b) Disjunctive selection
a) Query evaluation algebra c) Negation
b) Query evaluation plan d) None of the mentioned
c) Query evaluation primitive View Answer
d) Query evaluation engine
Answer: a
View Answer
Explanation: A selection of the form
Answer: b satisfying the intersection of all records
Explanation: A sequence of primitive satisfying individual simple conditions is a
operations that can be used to evaluate a conjunctive selection. This is a form of
query are called as Query evaluation plan. complex selection predicate.
This is used by the query evaluation engine 8. A selection of the form satisfying the
to process the queries. union of all records satisfying individual
4. The lowest level operator to access simple conditions is
data in query processing is _______ a) Conjunctive selection
a) File scan b) Disjunctive selection
b) File manipulation c) Negation
c) File handling d) None of the mentioned
d) File organization View Answer
View Answer
Answer: b
Answer: a Explanation: A selection of the form
Explanation: The lowest level operator to satisfying the intersection of all records
access data in query processing is file scan. satisfying individual simple conditions is a
File scans are algorithms that locate and disjunctive selection. This is a form of
retrieve records that fulfill a selection complex selection predicate.
criterion. 9. A selection of the form giving all the
5. Search algorithms that use an index records not satisfying simple individual
are referred to as _________ conditions is ______
a) Index scans a) Conjunctive selection
b) Search scans b) Disjunctive selection
c) Primary scans c) Negation
d) Equality scans d) None of the mentioned
View Answer View Answer
Answer: c b) Hash join
Explanation: A selection of the form giving c) Nested loop join
all the records not satisfying simple d) Block nested loop join
individual conditions is negation. This is a View Answer
form of complex selection predicate.
10. Which of the following can be Answer: c
implemented? Explanation: The given algorithm is called
a) Conjunctive selection using one index as a nested loop join because it basically
b) Conjunctive selection using consists of two nested for loops in it i.e. one
for loop is inside another for loop.
composite index
3. If nested loop join is done on a per
c) Conjunctive selection by intersection
of identifiers block basis rather than on a per tuple
basis, it is called as
d) All of the mentioned
View Answer a) Equi join
b) Hash join
Answer: d c) Nested loop join
Explanation: Conjunctive selection using d) Block nested loop join
one index, conjunctive selection using View Answer
composite index and conjunctive selection
by intersection of identifiers can be Answer: d
implemented. These are A7, A8, A9 Explanation: If nested loop join is done on a
algorithms that use an index. per block basis rather than on a per tuple
basis, it is called as Block nested loop join.
Within each pair of blocks, every tuple in
RDBMS Questions and one block is paired with every tuple in the
other block to generate all possible
Answers – Join and Other combinations.
Operations 4. The merge join can be used to
compute
This set of RDBMS Multiple Choice a) Natural joins
Questions & Answers (MCQs) focuses b) Equi joins
on “Join and Other Operations”. c) Both the mentioned
d) None of the mentioned
1. A join of the form r ⨝r.A=s.B s is View Answer
called as
a) Equi join Answer: c
b) Left outer join Explanation: The merge join can be used to
c) Right outer join compute both equijoins and natural joins.
This is also called as the sort-merge-join
d) Full outer join
algorithm.
View Answer
5. The ___________ merges the sorted
Answer: a relation with leaf entries of the
Explanation: A join of the form r ⨝r.A=s.B s secondary B+ tree index.
is called as equi-join where A and B are sets a) Merge join algorithm
of attributes of r and s respectively. b) Hybrid merge join algorithm
2. for each tuple tr in r do begin c) Hash join algorithm
FOR each tuple ts IN s do BEGIN d) Hybrid Hash join algorithm
test pair (tr , ts ) TO see IF they View Answer
satisfy the JOIN condition _
IF they do, ADD tr • ts TO the Answer: b
RESULT; Explanation: The Hybrid merge join
END algorithm merges the sorted relation with
END leaf entries of the secondary B+ tree index.
The result contains tuples from the sorted
What type of join is this? relation and addresses for tuples from the
a) Equi join unsorted relation.
6. The splitting of input until each same way as that of duplicate
partition of the build input fits the elimination.
memory is called as ______ a) True
a) Temporary partitioning b) False
b) Block partitioning View Answer
c) Recursive partitioning
Answer: a
d) Byte partitioning Explanation: The aggregation functions can
View Answer be implemented in the same way as that of
Answer: c duplicate elimination.
Explanation: The splitting of input until each
partition of the build input fits the memory is
called as recursive partitioning. RDBMS Questions and
7. Overflow resolution is performed Answers – Evaluation of
when,
a) A hash index overflow is detected Expressions
b) Extra hash indices are to be added
c) When the number of partitions are to This set of RDBMS Multiple Choice
Questions & Answers (MCQs) focuses
be increased
d) None of the mentioned on “Evaluation of Expressions”.
View Answer 1. If the results of one operation are
Answer: a passed on to the other, it is called as
Explanation: Hash table overflows can be ________
handled by either overflow resolution or a) Chain
overflow avoidance. Overflow resolution is b) Pipeline
performed when a hash index overflow is c) Materialized
detected. d) Tree
8. Which of the following is not a set View Answer
operation
Answer: b
a) Union
Explanation: If the results of one operation
b) Intersection are passed on to the other, it is called as
c) And operation Pipelined. This can be used to evaluate
d) Set difference several expressions simultaneously.
View Answer 2. The result of each intermediate
Answer: c operation are created and then are used
Explanation: The AND operation is not a set for valuation of the next level operations,
operation, it is a logical bit operation. this evaluation is called as ________
advertisement a) Chain evaluation
b) Pipeline evaluation
9. Which of the following joins preserves c) Materialized evaluation
the tuples of the relation on the left side d) Demand driven evaluation
of the operator? View Answer
a) Left outer join
b) Natural join Answer: c
c) Right outer join Explanation: The result of each intermediate
d) None of the mentioned operation are created and then are used foe
valuation of the next level operations, this
View Answer
evaluation is called as Materialized
Answer: a evaluation. This is not space effective as we
Explanation: Left outer join and full outer join need to construct the temporary relations
both preserve the tuples on the left side of which must be written to a disk.
the operator. 3. If the system makes repeated
10. State true or false: The aggregation requests for tuples from the operation at
functions can be implemented in the the top of the table, it is called as
_________ d) None of the mentioned
a) Demand driven pipeline View Answer
b) Producer driven pipeline
Answer: d
c) Query driven pipeline Explanation: Pipelined join technique, both
d) None of the mentioned left and right are evaluation techniques that
View Answer can be used to organize data.
Answer: a 8. State true or false: Hybrid hash join is
Explanation: If the system makes repeated partially pipelined on the probe relation
requests for tuples from the operation at the a) True
top of the table, it is called as demand b) False
driven pipeline. Each time an operation View Answer
receives a request for tuples, it computes
the next tuple or tuples to be returned and Answer: a
then returns that tuple. Explanation: Hybrid hash join is partially
4. If the operations do not wait to pipelined on the probe relation since it can
output tuples from the first partition as tuples
produce tuples, then it is called as
are received for the probe relation.
_________
9. The usage of two buffers, with one
a) Demand driven pipeline
continuing execution of the algorithm
b) Producer driven pipeline
while the other is written is called as
c) Query driven pipeline
__________
d) None of the mentioned
a) Double execution
View Answer
b) Multi tasking
Answer: b c) Double buffering
Explanation: If the operations do not wait to d) Double algorithm
produce tuples, then it is called as producer View Answer
driven pipeline. IT does not wait to produce
tuples but it produces tuples eagerly. Answer: c
5. State true or false: Sorting is an Explanation: The usage of two buffers, with
inherently blocking operation one continuing execution of the algorithm
while the other is written is called as Double
a) True
buffering. This makes the algorithm quicker
b) False by performing CPU operations
View Answer simultaneously with the I/O operations.
Answer: a 10. Which of the following functions
Explanation: Sorting is an inherently does an iterator not provide
blocking operation i.e. output is not given a) Open()
until all the tuples from their input are b) Next()
examined c) Close()
6. State true or false: Join is an d) Wait()
inherently blocking operation View Answer
a) True
b) False Answer: d
Explanation: The iterator does not provide
View Answer
the wait() function but it provides open(),
Answer: b next() and close() operations.
Explanation: Join is not an inherently
blocking algorithm. This is because all the
tuples need not be examined to execute the RDBMS Questions and
join operation.
7. Which of the following techniques
Answers – Transformation
does not exist? of Relational Expressions
a) Pipelined join technique
b) Left pipelined join technique
c) Right pipelined join technique
This set of RDBMS online test focuses difference operator affects the result of the
on “Transformation of Relational operation.
Expressions”. 5. State true or false: The projection
operation does not distribute over the
1. If on every legal database instant, the union operation
two expressions generate the same set a) True
of tuples, the expressions are called as b) False
a) Equal View Answer
b) Equivalent
c) Similar Answer: b
d) Identical Explanation: The projection operation
distributes over the union operation.
View Answer
6. If no rule can be derived from any
Answer: b combination of others then the set of
Explanation: If on every legal database rules is said to be ________
instant, the two expressions generate the a) Primitive
same set of tuples, the expressions are b) Axiomatic
called as Equivalent relational algebra
c) Minimal
expressions. The order of the tuples is
completely irrelevant for equivalency.
d) Atomic
2. State true or false: Selection View Answer
operations are commutative Answer: c
a) True Explanation: A set of equivalence rules is
b) False said to be minimal if no rule can be derived
View Answer from any combination of others. Query
optimizers use minimal sets of equivalence
Answer: a rules.
Explanation: Selection operations are 7. Theta join operations are
commutative i.e. selection1(selection2(R)) = a) Commutative
selection2(selection1(R)).
b) Associative
3. Which of the following operations are c) Distributive under projection
associative d) All of the mentioned
a) Natural joins View Answer
b) Theta joins
c) Both the mentioned Answer: d
d) None of the mentioned Explanation: The theta join operations are
View Answer commutative, associative and are
distributive under projection.
Answer: c 8. Which of the following operations is
Explanation: Both natural join operation and associative
theta join operation are associative. The a) Set union
commutativity and associativity of the join
b) Set intersection
operations are important for join reordering
in query optimization.
c) Set difference
4. Which of the following set operations d) Theta join
is not commutative? View Answer
a) Union Answer: d
b) Intersection Explanation: The theta join operation is
c) Set difference associative within a certain set of conditions
d) None of the mentioned whereas the rest of the operations are non-
View Answer associative in each and every condition.
9. Which of the following set operations
Answer: c does the selection operation distribute
Explanation: The set difference operation is over?
not commutative. As the position of the set
a) Union
b) Intersection
c) Difference d) None of the mentioned
d) All of the mentioned View Answer
View Answer
Answer: a
Answer: d Explanation: Most of the databases store
Explanation: The selection operation the distribution of values for each attribute
distributes over Set union, intersection, set as a histogram.in which the values for the
difference. attributes are divided into various ranges.
10. State true or false: Multiple 3. What is the function of the equi-width
equivalence rules can be used one after histogram?
the other on a query a) Adjusts boundaries of the ranges
a) True such that each range has the same
b) False number of values
View Answer b) Divides range of values into equal
sized ranges
Answer: a
c) Divides the range of values into
Explanation: Multiple equivalence rules can
be used one after the other on a query or on
ideally sized ranges
parts of the query. This can be used to d) Does not divide the range of values.
simplify the query greatly thus reducing its View Answer
time complexity. Answer: b
Explanation: The equi width histogram
divides the range of values into equal sized
RDBMS Questions and ranges.
Answers – Estimating 4. What kind of a sample must be used
for statistical analysis?
Statistics of Expression a) A random sample
Results b) A sample having excessive
representation of a relation
This set of RDBMS Multiple Choice c) A sample having suppressive
Questions & Answers (MCQs) focuses representation of a relation
on “Estimating Statistics of Expression d) None of the mentioned
Results”. View Answer
1. Which of the following information Answer: a
does the database system catalog Explanation: A random sample must be
store? taken into consideration for statistical
a) Number of tuples analysis because it gives a fair result on the
b) Number of blocks data analysis.
c) Size of a tuple of a relation 5. The ________ SQL command
d) All of the mentioned generates statistics on a particular
View Answer relation
a) Statistic
Answer: d b) Analyze
Explanation: The database system catalog c) Modify
stores the number of tuples, number of d) Runstats
blocks, size of a tuple in a relation and the
View Answer
blocking factor in it as statistical data.
2. Most databases store the distribution Answer: b
of values for each attribute as a Explanation: The analyze command is used
__________ to generate statistics on a particular set of
a) Histogram relations. The runstats command is also
b) Pie chart valid but not in SQL. It is used in IBM DB2.
c) Line graph 6. The union of all records satisfying the
individual simple conditions Oi is called
as ________
a) Conjunctive selection d) Inner join
b) Disjunctive selection View Answer
c) Negation
Answer: c
d) None of the mentioned Explanation: The size of an aggregation is
View Answer simply V(A,r) where r is the relation and A is
Answer: b a distinct value since there is one tuple in
Explanation: The union of all records the aggregation for every distinct value in A.
satisfying the individual simple conditions Oi
is called as disjunctive selection. It is a form
of a complex selection. RDBMS Questions and
7. The intersection of all records Answers – Choice of
satisfying the individual simple
conditions Oi is called as ________ Evaluation Plans
a) Conjunctive selection
This set of RDBMS Multiple Choice
b) Disjunctive selection
c) Negation Questions & Answers (MCQs) focuses
on “Choice of Evaluation Plans”.
d) None of the mentioned
View Answer 1. A ________ explores the space of all
Answer: a query evaluation plans that are
Explanation: The intersection of all records equivalent to a given query.
satisfying the individual simple conditions Oi a) Cost based optimizer
is called as conjunctive selection. It is a form b) Space based optimizer
of a complex selection. c) Time based optimizer
8. State true or false: Estimation of the d) None of the mentioned
size of the result of a join is not possible View Answer
a) True
Answer: a
b) False Explanation: A cost based optimizer
View Answer explores the space of all query evaluation
Answer: b plans that are equivalent to a given query,
Explanation: Estimation of the result of a join and chooses the one with the least
is possible and can be done using the estimated cost.
Cartesian product and intersections of the 2. What is the disadvantage of cost
two relations. It is more complicated than based optimizers?
estimating size of a selection. a) It is too expensive
9. Size estimation can be done for which b) It is inefficient in producing results
of the following processes? c) It does not perform the desired
a) Projection function
b) Aggregation d) None of the mentioned
c) Set operation View Answer
d) All of the mentioned
Answer: a
View Answer Explanation: Cost based optimizers may be
Answer: d expensive as exploring space of all possible
Explanation: Size estimation can be done plans might prove to be costly.
for projection, aggregation, set operations, 3. A particular sort order is said to be
join operations and also the selection _________ sort order if it could be
operation. useful for a later operation.
10. The size of a _____ is simply V(A,r) a) Interesting
where r is the relation and A is a distinct b) Reusable
value c) Efficient
a) Projection d) Good
b) Outer join View Answer
c) Aggregation
Answer: a operand of each join is in one of the initial
Explanation: A particular sort order is said to relations are called as left deep join orders.
be interesting-sort order if it could be useful 8. Caching and reuse of query plans is
for a later operation. called as ________
4. The rule that allows transformation of a) Query caching
a logical operation to a physical b) Plan caching
operation is called c) Plan memorizing
a) Logical equivalence rule d) None of the mentioned
b) Physical equivalence rule View Answer
c) Memory equivalence rule
d) None of the mentioned Answer: b
Explanation: Caching and reuse of query
View Answer
plans is called as plan caching. It is used
Answer: b because the optimal plan for the new
Explanation: The rule that allows constants may differ from the optimal plan
transformation of a logical operation to a for the initial values.
physical operation is called as a physical 9. What technique is used for the
equivalence rule. It is a new class of evaluation of a query with a nested sub
equivalence rules. query?
5. State true or false: Making multiple a) Caching
copies of the same sub-expressions b) Decorrelated evaluation
must be avoided c) Correlated evaluation
a) True d) Time based evaluation
b) False View Answer
View Answer
Answer: c
Answer: a Explanation: The technique used to evaluate
Explanation: For promoting space efficiency, a query with a nested sub query is called as
making multiple copies of the same sub- correlated evaluation. It is not very efficient
expressions must be avoided. as a large number of I/O operations may
6. Optimizers use __________ to occur.
reduce the cost of optimization. 10. The process of replacing a nested
a) Analyzers query with a query with a join is known
b) Statistics as _________
c) Heuristics a) Correlation
d) Caches b) Decorrelation
View Answer c) Cache handling
d) Join replacement
Answer: c
Explanation: Cost based optimizers may be
View Answer
expensive as exploring space of all possible Answer: b
plans might prove to be costly. So, Explanation: The process of replacing a
optimizers use heuristics to reduce the cost nested query with a query with a join is
of optimization. known as decorrelation. It is more
7. The join orders where the right complicated when the nested sub query
operand of each join is in one of the uses aggregate functions inside it.
initial relations are called as ________
a) Right deep join orders
b) Left deep join orders RDBMS Questions and
c) Outer join orders Answers – Materialized
d) None of the mentioned
View Answer Views and Advanced Topics
Answer: b
in Query Optimization
Explanation: The join orders where the right
This set of RDBMS online quiz focuses materialized view management techniques.
on “Materialized Views and Advanced Most database systems perform immediate
Topics in Query Optimization”. view management.
5. What are differentials in view
1. A view whose contents are computed management?
and stored is called as _______ a) The differences between relations
a) Storage view b) The changes made to a relation
b) Backup view c) The changes made to an expression
c) Materialized view d) More than one of the mentioned
d) Advanced view View Answer
View Answer
Answer: d
Answer: c Explanation: The changes made to a
Explanation: A view whose contents are relation or and expression are known as
computed and stored is called as a differentials in materialized view
materialized view. I does not only store the management.
query defining the view. 6. The sequence of queries that reflect
2. The task of keeping a view up to date the typical load on the system are
with the underlying data is called as known as ________
________ a) Efficacies
a) View handling b) Workload
b) View maintenance c) Selection
c) View management d) Balancers
d) None of the mentioned View Answer
View Answer
Answer: b
Answer: b Explanation: The sequence of queries that
Explanation: The task of keeping a view up reflect the typical workload on the system
to date with the underlying data is called as are known as workload.
view maintenance. 7. The problem of an update affecting
3. What is incremental materialized view the execution of a query associated with
maintenance? the update is known as the _________
a) Modifying all the parts of the view a) Updation problem
b) Modifying only the affected parts of b) Incremental problem
the view c) Halloween problem
c) Not modifying the view d) Optimization problem
d) None of the mentioned View Answer
View Answer
Answer: c
Answer: b Explanation: The problem of an update
Explanation: Modifying only the affected affecting the execution of a query
parts of the materialized view is called as associated with the update is known as the
incremental view maintenance. It is much Halloween problem. This was because it
more efficient than ordinary view was first recognized on the Halloween day
management. at IBM.
4. Which of the following is a type of 8. Reducing the complexity of complex
materialized view management? queries by similarly handling sub-
a) Incremental view management queries is known as ______
b) Immediate view management a) Complex query handling
c) Deferred view management b) Multi query optimization
d) All of the mentioned c) Complex query optimization
View Answer d) Parametric query optimization
Answer: d
View Answer
Explanation: Incremental, immediate and Answer: b
deferred are all different types of Explanation: Reducing the complexity of
complex queries by similarly handling sub- a) Isolation
queries is known as multi query b) Durability
optimization. c) Atomicity
9. Which of the following is a multi-query d) None of the mentioned
optimization technique View Answer
a) Shared scan optimization
b) Parametric query optimization Answer: c
c) Index optimization Explanation: The all or none policy is
commonly referred to as atomicity. It
d) All of the mentioned
ensures that a work is either completed or
View Answer not completed and there are no intermediate
Answer: a stages.
Explanation: Shared scan optimization is a 3. Which of the following is a property of
multi query optimization technique. transactions?
10. If a query is optimized without a) Atomicity
providing specific values for its b) Durability
parameters the technique is called c) Isolation
__________ d) All of the mentioned
a) Complex query handling View Answer
b) Multi query optimization
Answer: d
c) Complex query optimization Explanation: Atomicity, Durability and
d) Parametric query optimization Isolation are all properties of transactions.
View Answer 4. Execution of translation in isolation
Answer: d preserves the _________ of a database
Explanation: If a query is optimized without a) Atomicity
providing specific values for its parameters b) Consistency
the technique is called parametric query c) Durability
optimization. d) All of the mentioned
View Answer
RDBMS Questions and Answer: b
Explanation: Execution of translation in
Answers – Transaction isolation preserves the consistency of a
Concept and Model database. It ensures that no other
transaction is running concurrently.
This set of RDBMS Multiple Choice 5. Which of the following is not a
Questions & Answers (MCQs) focuses property of a transaction?
on “Transaction Concept and Model”. a) Atomicity
b) Simplicity
1. Collections of operations that form a c) Isolation
single logical unit of work are called d) Durability
__________ View Answer
a) Views
b) Networks Answer: b
Explanation: Simplicity is not a property of a
c) Units
transaction. Atomicity, Isolation, Durability
d) Transactions are all parts of ACID properties.
View Answer 6. Which of the following systems is
Answer: d responsible for ensuring durability?
Explanation: Collections of operations that a) Recovery system
form a single logical unit of work are called b) Atomic system
transactions. A database system must c) Concurrency control system
ensure proper execution of transactions. d) Compiler system
2. The “all-or-none” property is View Answer
commonly referred to as _________
Answer: a committed and failed are different states of a
Explanation: The recovery system is transaction.
responsible for the maintenance of advertisement
durability. In addition, it also ensures
atomicity. 11. The execution sequences in
7. Which of the following systems is concurrency control are termed as
responsible for ensuring isolation? ________
a) Recovery system a) Serials
b) Atomic system b) Schedules
c) Concurrency control system c) Organizations
d) Compiler system d) Time tables
View Answer View Answer
Answer: c Answer: b
Explanation: The concurrency control Explanation: The execution sequences in
system is responsible for ensuring isolation concurrency control are known as
in a database system. schedules.
8. State true or false: Information 12. The scheme that controls the
residing in the volatile storage does not interaction between executing
usually survive system crashes transactions is called as _____
a) True a) Concurrency control scheme
b) False b) Multiprogramming scheme
View Answer c) Serialization scheme
d) Schedule scheme
Answer: a View Answer
Explanation: Information residing in the
volatile storage does not usually survive Answer: a
system crashes but the information in stable Explanation: The scheme that controls the
storage can survive system crashes interaction between executing transactions
efficiently. is called as concurrency control scheme.
9. A transaction that has not been
completed successfully is called as
_______ RDBMS Questions and
a) Compensating transaction Answers – Serializability
b) Aborted transaction
c) Active transaction This set of RDBMS Multiple Choice
d) Partially committed transaction Questions & Answers (MCQs) focuses
View Answer on “Serializability”.
Answer: b 1. I and J are _________ if they are
Explanation: Aborted transaction is a state operations by different transactions on
after the transaction has been rolled back
the same data item, and at least one of
and the database has been restored to the
state prior to the transaction. them is a write operation.
10. Which of the following is not a a) Conflicting
transaction state? b) Overwriting
a) Active c) Isolated
b) Partially committed d) Durable
c) Failed View Answer
d) Compensated Answer: a
View Answer Explanation: I and J are conflicting if they
are operations by different transactions on
Answer: d the same data item, and at least one of
Explanation: Compensated is not a them is a write operation.
transaction state. But active, partially
2. If a schedule S can be transformed Answer: a
into a schedule S’ by a series of swaps Explanation: A Serializability order of the
of non-conflicting instructions, then S transactions can be obtained by finding a
and S’ are linear order consistent with the partial order
of the precedence graph. This process is
a) Non conflict equivalent
called as topological sorting.
b) Equal
6. State true or false: If I = read(Q) and J
c) Conflict equivalent
= read(Q) then the order of I and J does
d) Isolation equivalent
not matter.
View Answer
a) True
Answer: c b) False
Explanation: If a schedule S can be View Answer
transformed into a schedule S’ by a series of
swaps of non-conflicting instructions, then S Answer: a
and S’ are conflict equivalent. Not all serial Explanation: If I = read(Q) and J = read(Q)
schedules are conflict equivalent to each then the order of I and J does not matter
other. because both I and J are read operations on
3. A schedule is __________ if it is the query.
conflict equivalent to a serial schedule. 7. State true or false: If I = read(Q) and J
a) Conflict serializable = write(Q) then the order of I and J does
b) Conflicting not matter.
c) Non serializable a) True
d) None of the mentioned b) False
View Answer View Answer

Answer: a Answer: b
Explanation: A schedule is conflict Explanation: If I = read(Q) and J = write(Q)
serializable if it is conflict equivalent to a then the order of I and J matters because
serial schedule. The concept of conflict both I and J are different operations on the
equivalence leads to the concept. query. The order of execution determines
the state of the database that is being read
4. The set of ________ in a precedence
or written.
graph consists of all the transactions advertisement
participating in the schedule
a) Vertices 8. Which of the following is the most
b) Edges expensive method?
c) Directions a) Timestamping
d) None of the mentioned b) Plain locking
View Answer c) Predicate locking
Answer: a d) Snapshot isolation
Explanation: The set of vertices in a View Answer
precedence graph consists of all the Answer: c
transactions participating in the schedule. Explanation: Predicate locking is the most
Precedence graph is a simple and efficient expensive method and is generally not used
way of determining conflict serializability of in most databases.
the schedule.
5. A ___________of the transactions
can be obtained by finding a linear order RDBMS Questions and
consistent with the partial order of the
precedence graph. Answers – Transaction
a) Serializability order Isolation
b) Direction graph
c) Precedence graph This set of RDBMS Multiple Choice
d) Scheduling scheme Questions & Answers (MCQs) focuses
View Answer on “Transaction Isolation”.
1. A transaction that performs only one Tj such that Tj reads a data item previously
operation is called as a _________ written by Ti , the commit operation of Ti
a) Partial schedule appears before the commit operation of Tj.
b) Complete schedule 5. State true or false: Transactions can
c) Dependent schedule only run serially
d) Independent schedule a) True
View Answer b) False
View Answer
Answer: a
Explanation: A transaction that performs Answer: b
only one operation is called as a partial Explanation: Transactions are safer run
schedule because we don’t include commit serially but can also be run concurrently.
or rollback operations on them. 6. Which of the following are the
2. The phenomenon in which one failure advantages of transaction concurrency?
leads to a series of transaction rollbacks a) Increased throughput
is called as ________ b) Increased utilization
a) Cascading rollback c) Reduces average response time
b) Cascadeless rollback d) All of the mentioned
c) Cascade cause View Answer
d) None of the mentioned Answer: d
View Answer Explanation: Concurrency in transactions
Answer: a allow increased throughput, utilization. They
Explanation: The phenomenon in which one also reduce average response time.
failure leads to a series of transaction 7. The average time for a transaction to
rollbacks is called as cascading rollback. be completed after it has been
B=It is named so because one failure submitted is called as __________
causes the rollback of several other a) Minimum response time
transactions serially. b) Average response time
3. State true or false: Every cascadeless c) Average reaction time
schedule is also recoverable d) Minimum reaction time
a) True View Answer
b) False
View Answer Answer: b
Explanation: The average time for a
Answer: a transaction to be completed after it has been
Explanation: Every cascadeless schedule is submitted is called as Average response
also recoverable because in a cascadeless time. This gets decreased when
schedule, the commit operations occur in concurrency is used in transactions.
the same sequence as that of write and read advertisement
operations of two transactions respectively.
4. A ___________ is one where, for 8. If a schedule is equivalent to a serial
each pair of transactions Ti and Tj such schedule, it is called as a _________
that Tj reads a data item previously a) Serializable schedule
written by Ti , the commit operation of Ti b) Equivalent schedule
appears before the commit operation of c) Committed schedule
Tj d) None of the mentioned
a) Partial schedule View Answer
b) Dependent schedule Answer: a
c) Recoverable schedule Explanation: If a schedule is equivalent to a
d) None of the mentioned serial schedule, it is called as a Serializable
View Answer schedule.
9. Which of the following is not a type of
Answer: c
Explanation: A Recoverable schedule is one a schedule?
where, for each pair of transactions Ti and a) Partial schedule
b) Dependent schedule Answer: c
c) Recoverable schedule Explanation: Repeatable read allows only
d) None of the mentioned committed data to be read and further
View Answer requires that no other transaction is allowed
to update it between two reads of a data
Answer: d item by a transaction. However, the
Explanation: All of the mentioned schedules transaction may not be serializable with
i.e. partial schedule, dependent schedule, respect to other transactions.
recoverable schedule are different types of 4. ________ allows only committed data
schedules. to be read, but does not require
repeatable reads
a) Read uncommitted
RDBMS Questions and b) Serializable
Answers – Transaction c) Repeatable read
d) Read committed
Isolation Levels View Answer
This set of RDBMS Question Bank Answer: d
focuses on “Transaction Isolation Explanation: Read committed allows only
Levels”. committed data to be read, but does not
require repeatable reads. For instance,
1. Which of the following is a transaction between two reads of a data item by the
isolation level as specified by SQL transaction, another transaction may have
standard? updated the data item and committed.
a) Serializable 5. ___________ allows uncommitted
b) Repeatable read data to be read
c) Read committed a) Read uncommitted
d) All of the mentioned b) Serializable
View Answer c) Repeatable read
d) Read committed
Answer: a
Explanation: Serializable, repeatable read,
View Answer
read committed and read uncommitted are Answer: a
the four levels of transactions. Explanation: Real uncommitted allows
2. State true or false: Serializable level uncommitted data to be read. It is the lowest
may allow both serializable and non- isolation level allowed by SQL.
serializable executions 6. State true or false: All the isolation
a) True levels disallow dirty writes
b) False a) True
View Answer b) False
View Answer
Answer: a
Explanation: Serializable level generally Answer: a
allows only serializable executions but in Explanation: All the isolation levels above
some special cases, it may also allow non- additionally disallow dirty writes, that is, they
serializable execution. Disallow writes to a data item that has
3. ________ allows only committed data already been written by another transaction
to be read and further requires that no that has not yet committed or aborted.
other transaction is allowed to update it 7. When is a timestamp allotted
between two reads of a data item by a a) When execution begins
transaction. b) When execution is taking place
a) Read uncommitted c) When execution is completed
b) Serializable d) None of the mentioned
c) Repeatable read View Answer
d) Read committed
View Answer
Answer: a a) Shared mode
Explanation: Timestamp is allotted when b) Exclusive mode
execution of a transaction begins. c) Read only mode
advertisement d) Write only mode
8. In ___________ isolation each View Answer
transaction is given its own version of Answer: b
the database Explanation: If a transaction has obtained an
a) Timestamp exclusive mode lock, then it can both read
b) Snapshot and write on the item on which it in
c) Lock based operating.
d) All of the mentioned 3. A transaction can proceed only after
View Answer the concurrency control manager
________ the lock to the transaction
Answer: b a) Grants
Explanation: In snapshot isolation, each b) Requests
transaction is given its own version or
c) Allocates
snapshot of the database on which it can
operate. d) None of the mentioned
9. What is the disadvantage of locking? View Answer
a) Does not control concurrency Answer: a
b) Is not atomic Explanation: A transaction can proceed only
c) Is not durable after the concurrency control manager
d) Has a poor degree of concurrency grants the lock to the transaction.
View Answer 4. If a transaction can be granted a lock
on an item immediately in spite of the
Answer: Locking has a poor degree of presence of another mode, then the two
concurrency. It in fact has no concurrency at
modes are said to be ________
all.
a) Concurrent
b) Equivalent
RDBMS Questions and c) Compatible
d) Executable
Answers – Lock Based View Answer
Protocols Answer: c
Explanation: If a transaction can be granted
This set of RDBMS Multiple Choice a lock on an item immediately in spite of the
Questions & Answers (MCQs) focuses presence of another mode, then the two
on “Lock Based Protocols”. modes are said to be compatible.
5. A transaction is made to wait until all
1. If a transaction has obtained a
________ locks held on the item are
__________ lock, it can read but cannot
released
write on the item
a) Compatible
a) Shared mode
b) Incompatible
b) Exclusive mode
c) Concurrent
c) Read only mode
d) Equivalent
d) Write only mode
View Answer
View Answer
Answer: a
Answer: a
Explanation: A transaction is made to wait
Explanation: If a transaction Ti has obtained
until all compatible locks held on the item
a shared-mode lock (denoted by S) on item
are released. This ensures that no other
Q, then Ti can read, but cannot write, Q.
transaction is concurrently accessing the
2. If a transaction has obtained a same item.
________ lock, it can both read and 6. State true or false: It is not necessarily
write on the item desirable for a transaction to unlock a
data item immediately after its final c) More than one of the mentioned
access d) None of the mentioned
a) True View Answer
b) False
Answer: c
View Answer Explanation: The two phased locking
Answer: a protocol consists of the growing phase and
Explanation: It is not necessarily desirable the shrinking phase.
for a transaction to unlock a data item advertisement
immediately after its final access because
serializability may be violated due to this. 11. If a transaction may obtain locks but
7. The situation where no transaction may not release any locks then it is in
can proceed with normal execution is _______ phase
known as ________ a) Growing phase
a) Road block b) Shrinking phase
b) Deadlock c) Deadlock phase
c) Execution halt d) Starved phase
d) Abortion View Answer
View Answer Answer: a
Answer: b Explanation: If a transaction may obtain
Explanation: The situation where no locks but may not release any locks then it
transaction can proceed with normal is in growing phase. Growing phase is a
execution is known as a deadlock. phase in two phased locking protocol.
8. The protocol that indicates when a 12. If a transaction may release locks
transaction may lock and unlock each of but may not obtain any locks, it is said to
the data items is called as __________ be in ______ phase
a) Locking protocol a) Growing phase
b) Unlocking protocol b) Shrinking phase
c) Granting protocol c) Deadlock phase
d) Conflict protocol d) Starved phase
View Answer View Answer

Answer: a Answer: b
Explanation: The protocol that indicates Explanation: If a transaction may release
when a transaction may lock and unlock locks but may not obtain any locks, it is said
each of the data items is called as locking to be in shrinking phase. Shrinking phase is
protocol. Locking protocols restrict the a phase in two phased locking protocol.
number of schedules.
9. If a transaction Ti may never make
progress, then the transaction is said to
RDBMS Questions and
be ____________ Answers – Deadlock
a) Deadlocked Handling
b) Starved
c) Committed This set of RDBMS Multiple Choice
d) Rolled back Questions & Answers (MCQs) focuses
View Answer on “Deadlock Handling”.
Answer: b 1. A system is in a _______ state if there
Explanation: If a transaction Ti may never
exists a set of transactions in which
make progress, then the transaction is said
to be starved. every transaction is waiting for another
10. The two phase locking protocol transaction in the set.
consists which of the following phases? a) Deadlock
a) Growing phase b) Starved
b) Shrinking phase c) Isolated
d) None of the mentioned transactions do not starve and it is also easy
View Answer to implement and is hence widely used if
transactions are short and long waits are
Answer: a likely to be due to deadlocks.
Explanation: A system is in a deadlock state 6. The _________ graph describes
if there exists a set of transactions in which deadlocks precisely
every transaction is waiting for another
a) Wound wait graph
transaction in the set.
b) Wait die graph
2. Which of the following is not a method
c) Wait for graph
in deadlock handling
d) None of the mentioned
a) Deadlock prevention
View Answer
b) Deadlock detection
c) Deadlock recovery Answer: c
d) Deadlock distribution Explanation: The wait for graph describes
View Answer deadlocks precisely. Existence of a cycle in
this graph implies that a deadlock will occur.
Answer: d 7. How do we generally recover from a
Explanation: Deadlock distribution is not a deadlock?
method in deadlock handling whereas,
a) By aborting all the transactions
deadlock prevention is followed by deadlock
detection and deadlock recovery.
b) By rolling back all the transactions
3. Deadlocks can be prevented using c) By rolling back only a selected
a) Preemption and transaction rollbacks number of transactions
b) Wait and die scheme d) None of the mentioned
c) Wound-wait scheme View Answer
d) All of the mentioned Answer: c
View Answer Explanation: We generally recover from
deadlocks by rolling back only a selected
Answer: d number of transactions
Explanation: Preemption and transaction advertisement
rollbacks, wait and die scheme, wound wait
scheme are all different methods of 8. State true or false: Partial rollback is
deadlock prevention. not possible.
4. State true or false: Wait die scheme is a) True
a non-preemptive technique b) False
a) True View Answer
b) False
View Answer Answer: b
Explanation: Partial rollback is possible but it
Answer: a requires the system too maintain an
Explanation: The wait-die scheme is a non- additional amount of information on the
preemptive technique. When transaction Ti states of the transactions.
requests a data item currently held by Tj , Ti 9. Which of the following steps must be
is allowed to wait only if it has a timestamp taken while choosing a victim?
smaller than that of Tj (that is, Ti is older a) Avoiding starvation
than Tj ). Otherwise, Ti is rolled back (dies).
b) Number of transactions involved in
5. Lock timeouts have which of the
rollback
following advantages?
c) Data items used by the transaction
a) Unnecessary rollbacks do not occur
d) All of the mentioned
b) Transactions do not starve
View Answer
c) It is easy to implement
d) All of the mentioned Answer: d
View Answer Explanation: While choosing a victim we
much choose the one with a minimum cost.
Answer: d That is the one which avoids starvation, the
Explanation: In lock timeout method, one with the least number of transaction
unnecessary rollbacks do not occur,
involved in the rollback and the one with the largest timestamp of any transaction that
least amount of data items used. can execute write(Q) successfully.
4. R-timestamp(Q) denotes?
a) The largest timestamp of any
RDBMS Questions and transaction that can execute write(Q)
Answers – Timestamp successfully
b) The largest timestamp of any
based Protocols transaction that can execute read(Q)
successfully
This set of Basic RDBMS Questions and c) The smallest timestamp of any
Answers focuses on “Timestamp Based transaction that can execute write(Q)
Protocols”. successfully
1. Which of the following cannot be used d) The smallest timestamp of any
to implement a timestamp transaction that can execute read(Q)
a) System clock successfully
b) Logical counter View Answer
c) External time counter Answer: b
d) None of the mentioned Explanation: R-timestamp(Q) denoted the
View Answer largest timestamp of any transaction that
Answer: c can execute read(Q) successfully.
Explanation: An external time counter 5. A ________ ensures that any
cannot be used to implement a timestamp. conflicting read and write operations are
System clock and a logical counter can be executed in timestamp order
used. a) Organizational protocol
2. A logical counter is _________ after a b) Timestamp ordering protocol
new timestamp has been assigned c) Timestamp execution protocol
a) Incremented d) 802-11 protocol
b) Decremented View Answer
c) Doubled
Answer: b
d) Remains the same Explanation: A timestamp ordering protocol
View Answer ensures that any conflicting read and write
Answer: a operations are executed in timestamp order.
Explanation: A logical counter is 6. The default timestamp ordering
incremented after a new timestamp has protocol generates schedules that are
been assigned everytime. a) Recoverable
3. W-timestamp(Q) denotes? b) Non-recoverable
a) The largest timestamp of any c) Starving
transaction that can execute write(Q) d) None of the mentioned
successfully View Answer
b) The largest timestamp of any
Answer: b
transaction that can execute read(Q) Explanation: The timestamp ordering
successfully protocol generates schedules that are non-
c) The smallest timestamp of any recoverable. But it can be extended to make
transaction that can execute write(Q) the schedules recoverable.
successfully 7. State true or false: The Thomas write
d) The smallest timestamp of any rule has a greater potential concurrency
transaction that can execute read(Q) than the timestamp ordering protocol
successfully a) True
View Answer b) False
Answer: a
View Answer
Explanation: W-timestamp(Q) denotes The
Answer: a write(Q) operation and the transaction Ti
Explanation: The Thomas write rule has a rolls back.
greater potential concurrency than the
timestamp ordering protocol. This is
because it is a modified version of the RDBMS Questions and
timestamp ordering protocol in which
obsolete write operations can be ignored Answers – Validation Based
under certain circumstances. Protocols
8. Which of the following timestamp
based protocols generates serializable This set of RDBMS Multiple Choice
schedules? Questions & Answers (MCQs) focuses
a) Thomas write rule on “Validation Based Protocols”.
b) Timestamp ordering protocol
c) Validation protocol 1. The _________ requires each
d) None of the mentioned transaction executes in two or three
View Answer different phases in its lifetime
a) Validation protocol
Answer: a b) Timestamp protocol
Explanation: Thomas write rule protocol c) Deadlock protocol
generates serializable schedules that no d) View protocol
other protocol can generate.
View Answer
9. In timestamp ordering protocol,
suppose that the transaction Ti issues Answer: a
read(Q) and TS(Ti)<W-timestamp(Q), Explanation: The validation protocol requires
then each transaction to execute in two or three
a) Read operation is executed different phases in its lifetime depending on
whether it is a read only or an update
b) Read operation is rejected
transaction.
c) Write operation is executed
2. During __________ phase, the
d) Write operation is rejected
system reads data and stores them in
View Answer
variables local to the transaction.
Answer: b a) Read phase
Explanation: Suppose that transaction Ti b) Validation phase
issues read(Q). If TS(Ti ) < W-timestamp(Q), c) Write phase
then Ti needs to read a value of Q that was d) None of the mentioned
already overwritten. Hence, the read View Answer
operation is rejected, and Ti is rolled back.
10. In timestamp ordering protocol, Answer: a
suppose that the transaction Ti issues Explanation: During the read phase, the
write(Q) and TS(Ti)<W-timestamp(Q), system reads data and stores them in
then variables local to the transaction. It performs
all write operations on temporary local
a) Read operation is executed
variables without updates on the actual
b) Read operation is rejected database.
c) Write operation is executed 3. During the _________ phase the
d) Write operation is rejected validation test is applied to the
View Answer transaction
Answer: d a) Read phase
Explanation: In timestamp ordering protocol, b) Validation phase
suppose that the transaction Ti issues c) Write phase
write(Q) and TS(Ti)<W-timestamp(Q), then d) None of the mentioned
the value of Q that Ti is producing was View Answer
needed previously, and the system
assumed that the value would never be Answer: b
produced. Hence the system rejects the Explanation: During the validation phase,
the validation test is applied to the
transaction. This determines whether the timestamps for each transaction start(i),
transaction is allowed to proceed or not validation(i), finish(i). The validation phase is
without causing a violation of serializability. used to record the time at which a
4. During the _______ phase, the local transaction has finished its read phase and
variables that hold the write operations has started its validation phase.
are copied to the database 8. Which of the following timestamps is
a) Read phase used to record the time when a
b) Validation phase database has completed its write
c) Write phase operation?
d) None of the mentioned a) Start(i)
View Answer b) Validation(i)
c) Finish(i)
Answer: c d) Write(i)
Explanation: During the write phase, the
View Answer
local variables that hold the write operations
are copied to the database. Read only Answer: c
operations omit this phase. Explanation: There are three different
5. Read only operations omit the timestamps for each transaction start(i),
_______ phase validation(i), finish(i). Finish(i) is used to
a) Read phase record the time when a transaction has
b) Validation phase finished its write phase.
c) Write phase 9. State true or false: Locking and
d) None of the mentioned timestamp ordering force a wait or
View Answer rollback whenever a conflict is detected.
a) True
Answer: c b) False
Explanation: Read only operations do not View Answer
allow write operation to be performed on
them. So, they omit the write phase but Answer: a
execute the read and validation phases. Explanation: Locking and timestamp
6. Which of the following timestamp is ordering force a wait or rollback whenever a
used to record the time at which the conflict is detected. This property is called
transaction started execution? pessimism of locking and timestamp
a) Start(i) protocols.
b) Validation(i) 10. State true or false: We determine the
c) Finish(i) serializability order of validation protocol
d) Write(i) by the validation ordering technique
View Answer a) True
b) False
Answer: a View Answer
Explanation: There are three different
timestamps for each transaction start(i), Answer: b
validation(i), finish(i). Start(i) is used to Explanation: We determine the serializability
record the time at which the transaction order of the validation protocol by the
execution started. timestamp ordering technique. There is no
7. Which of the following timestamps is technique called as the validation ordering
used to record the time when a technique to determine the serializability
order of the validation protocol.
transaction has finished its read phase?
a) Start(i)
b) Validation(i) RDBMS Questions and
c) Finish(i)
d) Write(i) Answers – Multiversion
View Answer Schemes, Snapshot
Answer: b Isolation
Explanation: There are three different
This set of RDBMS Questions and 5. Under ________ the system uses
Answers for Entrance exams focuses on locking mechanism that applies only to
“Multiversion Schemes, Snapshot updates
Isolation”. a) First updater wins
b) First committer wins
1. In _______ schemes, each write
c) First writer wins
operation creates a new version of Q d) None of the mentioned
a) Multiversion
View Answer
b) Snapshot isolation
c) Lock based Answer: a
d) Timestamp Explanation: Under first updater wins, the
View Answer system uses a locking mechanism that
applies only to updates. Read operations do
Answer: a not get affected by this mechanism.
Explanation: In multiversion schemes, each 6. The situation in which each pair of
write operation creates a new version of Q. transactions has read a data written by
When a transaction issues a read operation, the other, but there is no data written by
the concurrency control manager selects
the transactions is called as _______
one of the versions of Q to be read.
a) Deadlock
2. If the first update is overwritten by a
b) Read skew
second, it is called as a _______ update
c) Deadlock skew
a) Useful
d) Write skew
b) Overlapping
View Answer
c) Lost
d) Concurrent Answer: d
View Answer Explanation: The situation in which each
pair of transactions has read a data written
Answer: c by the other, but there is no data written by
Explanation: If the first update is overwritten the transactions is called as write skew.
by a second, it is called as a lost update. 7. Oracle uses __________ for the
This generally occurs whenever two
serializable isolation level
transactions are allowed to write on the
database.
a) Multiversion scheme
3. State true or false: Snapshot isolation b) Timestamp protocol
prevents lost updates c) Lock based protocol
a) True d) Snapshot isolation
b) False View Answer
View Answer Answer: d
Explanation: Oracle uses snapshot isolation
Answer: a
for the serializable isolation level.
Explanation: Snapshot isolation prevents
PostgreSQL also uses only snapshot
lost updates because it does not allow two
isolation for the serializable isolation level.
transactions to simultaneously write on the
same database.
8. State true or false: Snapshot isolation
4. Which of the following is a variant of has low overhead
snapshot isolation a) True
a) First committer wins b) False
b) First updater wins View Answer
c) More than one of the mentioned Answer: a
d) None of the mentioned Explanation: Snapshot isolation is attractive
View Answer in practice because it has a relatively very
low overhead.
Answer: c 9. In ________ no two aborts occur
Explanation: First committer wins and first
unless two concurrent transactions
updater wins are two different variations of
snapshot isolation.
update the same data item.
a) Multiversion scheme
b) Timestamp protocol b) Phantom problem
c) Lock based protocol c) Index locking
d) Snapshot isolation d) Index problem
View Answer View Answer
Answer: d Answer: c
Explanation: In snapshot isolation no two Explanation: Index locking avoids locking
aborts occur unless two concurrent the entire index. Any transaction that inserts
transactions update the same data item. a tuple into a relation must insert information
This makes snapshot isolation attractive but into every index maintained on the relation.
it does not ensure serializability. 3. Which of the following is included in
10. Which of the following transactions the operational mechanism of the index
can multiversion two phase locking locking protocol?
protocol not differentiate. a) Every transaction must have at least
a) Read only transactions one index
b) Update transactions b) A transaction that performs a lookup
c) All of the mentioned must acquire a shared lock on all the
d) Double operator transactions index leaf nodes that it accesses
View Answer c) The rule of the two phase locking
Answer: d
mechanism must be observed
Explanation: The multiversion two phase d) All of the mentioned
locking protocol cannot differentiate double View Answer
operator transactions but it can differentiate Answer: d
between read only transactions and update Explanation: The operational mechanism of
transactions. the index locking protocol includes, every
transaction must have at least one index. A
transaction that performs lookup must
RDBMS Questions and acquire a shared lock on all the index leaf
Answers – Insert, Delete nodes that it accesses. The rule of the two
phase locking mechanism must be followed.
Operations and Predicate 4. _________ is a form of two degree
Reads consistency designed for programs that
iterate over tuples of a relation by using
This set of RDBMS Multiple Choice cursors.
Questions & Answers (MCQs) focuses a) Cursor stability
on “Insert, Delete Operations and b) Serializability
Predicate Reads”. c) Non-serializability
d) Predicate locking
1. ________ deletes a data item from a View Answer
database
a) Delete(Q) Answer: a
b) Insert(Q) Explanation: Cursor stability is a form of two
c) Drop(Q) degree consistency designed for programs
that iterate over tuples of a relation by using
d) None of the mentioned
cursors. It ensures that the tuple that is
View Answer currently being processed is locked in
Answer: a shared mode and any modified tuples are
Explanation: Delete(Q) deletes a data item locked in exclusive mode until the
from a database. Insert(Q) inserts a new transaction commits.
data item Q into the database and assign Q 5. Transactions that involve user
an initial value. interactions are called __________
2. Which of the following does not lock a) Validations
the entire index b) Conversations
a) Phantom locking c) Interfaces
d) None of the mentioned 9. State true or false: Exclusive locks are
View Answer held until transaction commit in degree
two consistency
Answer: b
Explanation: Transactions that involve user
a) True
interactions are called as conversation. b) False
These are named differently to differentiate View Answer
them from regular transactions. Validation Answer: a
using version numbers is very useful for Explanation: Exclusive locks are held until
such transactions. transaction commit in degree two
6. State true or false: Key value locking consistency, no transaction can read an
provides increased concurrency uncommitted value.
a) True
b) False
View Answer RDBMS Questions and
Answer: a Answers – Failure
Explanation: Key value locking provides
increased concurrency. Using key value
Classification and Storage
improperly however might cause phantom
phenomenon to occur.
This set of RDBMS Problems focuses
7. To prevent the phantom on “Failure Classification and Storage”.
phenomenon, _______ is used 1. Which of the following can cause a
a) Key value locking transaction failure
b) Next key locking a) Logical error
c) Previous key locking b) System error
d) None of the mentioned c) More than one of the mentioned
View Answer d) None of the mentioned
Answer: b View Answer
Explanation: The failure of a system to Answer: c
prevent a non serialized tuple when two Explanation: Logical errors and system
transactions conflict with each other is called errors are the two types of errors that can
as phantom phenomenon. To prevent the generally cause transaction failures.
phantom phenomenon, the next key locking 2. If the transaction can no longer
is used.
continue with its normal execution
advertisement
because of some internal condition, it is
8. Which of the following does cursor called as a _________
stability ensure a) Logical error
a) The tuple that is currently being b) System error
processed by the iteration is locked in c) System crash
shared mode d) None of the mentioned
b) The tuple that is currently being View Answer
processed is not locked in shared mode Answer: a
c) Any modified tuples are not locked in Explanation: If the transaction can no longer
exclusive mode continue with its normal execution because
d) None of the mentioned of some internal condition, it is called as a
View Answer logical error such as bad input, data not
found, overflow or resource limit exceeded.
Answer: a 3. If a system has entered and
Explanation: Cursor stability ensures that
undesirable state due to which it is
the tuple that is currently being processed
by the iteration is locked in shared mode unable to continue with normal
and any modified tuples are locked in execution, it is called as _________
exclusive mode until the transaction a) Logical error
commits. b) System error
c) System crash storage is the least secure whereas stable
d) None of the mentioned storage is the most secure among them.
View Answer 7. If a failure has occurred in the midst of
a transfer, it is called as _________
Answer: b a) Successful completion
Explanation: If a system has entered and
b) Partial failure
undesirable state due to which it is unable to
continue with normal execution, it is called
c) Total failure
as a system error. The transaction however d) None of the mentioned
can be re-executed at a later time. View Answer
4. If there is a hardware malfunction or a Answer: b
bug in the database that causes the loss Explanation: If a failure has occurred in the
of content of volatile storage, it is called midst of a transfer, it is called as partial
as ________ failure. After a partial failure, the destination
a) Logical error has incorrect information.
b) System error 8. State true or false: The destination
c) System crash block has incorrect information in case
d) None of the mentioned of a total failure
View Answer a) True
b) False
Answer: c
View Answer
Explanation: If there is a hardware
malfunction or a bug in the database that Answer: b
causes the loss of content of volatile Explanation: In case of total failure, the
storage, it is called as a system crash. The failure occurs sufficiently early during the
data in the non-volatile storage remains transfer that the destination block remains
intact and it is not corrupted. intact. Thus there is no corruption of data at
5. The assumption that the hardware the destination.
errors bring the system to a halt is called 9. The partitions of the database into
as ________ fixed length storage units are called as
a) Halter assumption __________
b) Phantom assumption a) Blocks
c) Fail-stop assumption b) Tuples
d) Disk failure c) Relations
View Answer d) None of the mentioned
View Answer
Answer: c
Explanation: The assumption that the Answer: a
hardware errors bring the system to a halt is Explanation: The database is partitioned into
called as fail-stop assumption. Well- fixed length storage units called as blocks.
designed systems have numerous internal Blocks are the units of data transfer and
checks that bring a system to a halt may contain several data items.
whenever there is an error. Hence, the fail 10. The blocks residing on the disk are
stop assumption is a reasonable one. referred to as ___________
6. Which of the following is not a a) Physical blocks
classification of storage b) Buffer blocks
a) Volatile storage c) Disk blocks
b) Nonvolatile storage d) Disk buffer
c) Stable storage View Answer
d) None of the mentioned
View Answer Answer: a
Explanation: The blocks residing on the disk
Answer: d are referred to as physical blocks. The
Explanation: Volatile storage, non-volatile blocks residing temporarily in the main
storage and stable storage are three memory are referred to as buffer blocks.
different classifications of storage. Volatile advertisement
11. The area of memory where blocks c) Old value
temporarily reside is called as ________ d) All of the mentioned
a) Block buffer View Answer
b) Disk buffer
Answer: d
c) Physical buffer Explanation: An update log record describes
d) None of the mentioned a single database write. It has four fields in
View Answer it. The update log record has a transaction
Answer: b identifier, data-item identifier, old value, new
Explanation: The area of memory where value.
blocks temporarily reside is called as the 4. The unique identifier of the
disk buffer. The disk buffer is used to store transaction that performed the write
the buffer blocks which hold temporary data. operation is called as _______
a) Transaction identifier
b) Data-item identifier
RDBMS Questions and c) Old value
Answers – Recovery and d) New value
View Answer
Atomicity
Answer: a
This set of RDBMS Multiple Choice Explanation: The unique identifier of the
Questions & Answers (MCQs) focuses transaction that performed the write
operation is called as transaction identifier.
on “Recovery and Atomicity”.
This is a field in the update log record.
1. The most widely used structure for 5. The value of the data item prior to the
recording database modification is write is called as _________
called as _______ a) Transaction identifier
a) Log b) Data-item identifier
b) List c) Old value
c) Queue d) New value
d) Stack View Answer
View Answer Answer: c
Answer: a Explanation: The value of the data item prior
Explanation: The most widely used structure to the write is called as old value. This is
for recording database modification is called stored in the update log record.
as a log. The log is a sequence of log 6. If a transaction does not modify the
records recording all the update activities in database until it has committed it is said
the database. to use a _______ modification technique
2. An update log record describes a a) Deferred
________ database write b) Immediate
a) Single c) More than one of the mentioned
b) Double d) None of the mentioned
c) Triple View Answer
d) Quadruple
Answer: a
View Answer
Explanation: If a transaction does not modify
Answer: a the database until it has committed it is said
Explanation: An update log record describes to use a deferred modification technique.
a single database write. It has four fields in it Deferred modification has the overhead that
which are, transaction identifier, data-item transactions need to make local copies of all
identifier, old value, new value. updated data items.
3. Which of the following fields does the 7. We say that a transaction has been
update log record have? ________ when its commit log record
a) Transaction identifier has been output to stable storage.
b) Data-item identifier a) Locked
b) Completed RDBMS Questions and
c) Committed
d) Released Answers – SQL Data
View Answer Definition
Answer: c
Explanation: We say that a transaction has This set of RDBMS Multiple Choice
been committed when its commit log record Questions & Answers (MCQs) focuses
has been output to stable storage. At that on “SQL Data Definition Problems (Bank
point, all the earlier records have already Database Schema)”.
been output to stable storage.
8. State true or false: Using checkpoints Q1) Create a Bank Database schema
reduces overhead with the following relations and select an
a) True appropriate primary key.
b) False account(account_number,
View Answer branch_name, balance)
branch (branch_name, branch_city,
Answer: a assets)
Explanation: Using checkpoints reduces customer (customer_name
overhead because the search process is customer_street, customer_city)
time consuming and searching for
loan (loan_number, branch_name,
transactions does not take place if we use
checkpoints. amount)
9. A __________ checkpoint is a depositor((customer_name,
checkpoint where transactions are account_number)
allowed to perform updates even while borrower(customer_name,
buffer blocks are being written out. loan_number)
a) Temporary View Answer
b) Fuzzy Answer: create table account
c) Permanent (account_number varchar(15) not null
d) Recovery unique,
View Answer branch_name varchar(15) not null,
balance number not null,
Answer: b primary key(account_number));
Explanation: A fuzzy checkpoint is a create table branch
checkpoint where transactions are allowed (branch_name varchar(15) not null
to perform updates even while buffer blocks
unique,
are being written out.
branch_city varchar(15) not null,
10. If the database modifications occur
assets number not null,
while the transaction is still active, the
primary key(branch_name));
transaction is said to use the
__________ modification technique create table customer
a) Deferred (customer_name varchar(15) not null
b) Immediate unique,
c) More than one of the mentioned customer_street varchar(12) not null,
d) None of the mentioned customer_city varchar(15) not null,
View Answer primary key(customer_name));
Answer: b create table loan
Explanation: If the database modifications (loan_number varchar(15) not null
occur while the transaction is still active, the unique,
transaction is said to use the immediate
branch_name varchar(15) not null,
modification technique. Deferred
modification has overhead whereas amount number not null,
immediate modification doesn’t have any primary key(loan_number));
overhead.
create table depositor insert into customer values (‘McBride’,
(customer_name varchar(15) not null, ‘Safety’, ‘Rye’);
account_number varchar(15) not null,
insert into branch values (‘Downtown’,
primary key(customer_name,
account_number), ‘Brooklyn’, 900000);
insert into branch values (‘Redwood’,
foreign key(account_number) references
account(account_number), ‘Palo Alto’, 2100000);
insert into branch values (‘Perryridge’,
foreign key(customer_name) references
customer(customer_name)); ‘Horseneck’, 1700000);
insert into branch values (‘Mianus’,
create table borrower ‘Horseneck’, 400200);
(customer_name varchar(15) not null, insert into branch values (‘Round Hill’,
loan_number varchar(15) not null, ‘Horseneck’, 8000000);
primary key(customer_name, insert into branch values (‘Pownal’,
loan_number), ‘Bennington’, 400000);
foreign key(customer_name) references insert into branch values (‘North Town’,
customer(customer_name), ‘Rye’, 3700000);
foreign key(loan_number) references insert into branch values (‘Brighton’,
loan(loan_number)); ‘Brooklyn’, 7000000);
insert into branch values (‘Central’,
NOTE: Please insert the following data ‘Rye’, 400280);
into the database for the execution of
further queries. insert into account values (‘A-101’,
‘Downtown’, 500);
insert into customer values (‘Jones’, insert into account values (‘A-215’,
‘Main’, ‘Harrison’); ‘Mianus’, 700);
insert into customer values (‘Smith’, insert into account values (‘A-102’,
‘Main’, ‘Rye’); ‘Perryridge’, 400);
insert into customer values (‘Hayes’, insert into account values (‘A-305’,
‘Main’, ‘Harrison’); ‘Round Hill’, 350);
insert into customer values (‘Curry’, insert into account values (‘A-201’,
‘North’, ‘Rye’); ‘Perryridge’, 900);
insert into customer values (‘Lindsay’, insert into account values (‘A-222’,
‘Park’, ‘Pittsfield’); ‘Redwood’, 700);
insert into customer values (‘Turner’, insert into account values (‘A-217’,
‘Putnam’, ‘Stamford’); ‘Brighton’, 750);
insert into customer values (‘Williams’, insert into account values (‘A-333’,
‘Nassau’, ‘Princeton’); ‘Central’, 850);
insert into customer values (‘Adams’, insert into account values (‘A-444’,
‘Spring’, ‘Pittsfield’); ‘North Town’, 625);
insert into customer values (‘Johnson’,
‘Alma’, ‘Palo Alto’); advertisement
insert into customer values (‘Glenn’,
‘Sand Hill’, ‘Woodside’); insert into depositor values
insert into customer values (‘Brooks’, (‘Johnson’,’A-101′);
‘Senator’, ‘Brooklyn’); insert into depositor values (‘Smith’, ‘A-
insert into customer values (‘Green’, 215’);
‘Walnut’, ‘Stamford’); insert into depositor values (‘Hayes’, ‘A-
insert into customer values (‘Jackson’, 102’);
‘University’, ‘Salt Lake’); insert into depositor values (‘Hayes’, ‘A-
insert into customer values (‘Majeris’, 101’);
‘First’, ‘Rye’); insert into depositor values (‘Turner’, ‘A-
305’);
insert into depositor values
(‘Johnson’,’A-201′); This set of RDBMS Multiple Choice
insert into depositor values (‘Jones’, ‘A- Questions & Answers (MCQs) focuses
217’); on “SQL Queries – I”.
insert into depositor values (‘Lindsay’,’A-
222′); 1. List all branch names and their
assests
insert into depositor values (‘Majeris’,’A-
333′); View Answer
insert into depositor values (‘Smith’, ‘A- Answer: select branch_name, assets from
444’); branch;
2. List all accounts of Brooklyn branch
insert into loan values (‘L-17’, View Answer
‘Downtown’, 1000);
insert into loan values (‘L-23’, Answer: select account_number from
‘Redwood’, 2000); account natural join branch where
insert into loan values (‘L-15’, branch_city=’Brooklyn’;
‘Perryridge’, 1500); 3. List all loans with amount > 1000.
insert into loan values (‘L-14’, View Answer
‘Downtown’, 1500); Answer: select * from loan where
insert into loan values (‘L-93’, ‘Mianus’, amount>1000;
500); 4. List all accounts of Perryridge branch
insert into loan values (‘L-11’, ‘Round with balance < 1000.
Hill’, 900); View Answer
insert into loan values (‘L-16’,
Answer: select account_number from
‘Perryridge’, 1300);
account where branch_name=’Perryridge’
insert into loan values (‘L-20’, ‘North and balance < 1000;
Town’, 7500); 5. List Numbers of accounts with
insert into loan values (‘L-21’, ‘Central’, balances between 700 and 900
570); View Answer
insert into borrower values (‘Jones’, ‘L- Answer: select count(account_number) from
17’); account where balance > 700 and balance <
insert into borrower values (‘Smith’, ‘L- 900;
23’); 6. Change the assests of Perryridge
insert into borrower values (‘Hayes’, ‘L- branch to 340000000.
15’); View Answer
insert into borrower values (‘Jackson’,
‘L-14’); Answer: update branch set assets =
340000000 where
insert into borrower values (‘Curry’, ‘L-
branch_name=’Perryridge’;
93’);
7. Transfer the accounts and loans of
insert into borrower values (‘Smith’, ‘L-
Perryridge branch to Downtown branch.
11’);
View Answer
insert into borrower values (‘Williams’,’L-
17′); Answer: update account set
insert into borrower values (‘Adams’, ‘L- branch_name=’Downtown’ where
16’); branch_name=’Perryridge’;
insert into borrower values (‘McBride’, update loan set branch_name=’Downtown’
where branch_name = ‘Perryridge’;
‘L-20’);
insert into borrower values (‘Smith’, ‘L- 8. Transfer Rs. 100 from account A-101
21’); to A-215.
View Answer
Answer: update account
RDBMS Questions and set balance = case
Answers – SQL Queries – I when account_number=’A-101′ then
balance-100 3. Change the size of the branch_city to
when account_number=’A-215′ then varchar(20).
balance+100 View Answer
else balance
end; Answer: ALTER TABLE branch ALTER
9. Delete the branch Perryridge. COLUMN branch_city type varchar(20);
View Answer 4. Drop the column phoneNo from
customer table.
Answer: delete from account where View Answer
branch_name=’Perryridge’;
delete from branch where Answer: ALTER TABLE customer drop
branch_name=’Perryridge’; phoneNo;
delete from loan where 5. For all customers who have a loan
branch_name=’Perryridge’; from the bank, find their names, loan
10. Waive off all the loans with amount < numbers, and loan amount.
1000. View Answer
View Answer
Answer: select
Answer: delete from borrower where customer_name,loan_number,amount from
loan_number in borrower
(select loan_number from loan where natural join loan;
amount<1000); 6. Find the customer names, loan
delete from loan where amount<1000; numbers, and loan amounts, for all
loans at the Perryridge branch.
View Answer
RDBMS Questions and
Answer: select
Answers – SQL Queries – II customer_name,loan_number,amount from
depositor
This set of RDBMS Questions and natural join loan where
Answers for Campus interviews focuses loan.branch_name=’Perryridge’;
on “Sql Queries – II”. 7. For all customers who have a loan
1. Delete the accounts and loans of from the bank, find their names and loan
Downtown branch. numbers with the attribute loan_number
View Answer replaced by loan_id.
View Answer
Answer: delete from depositor where
account_number IN Answer: select
(select account_number from account where customer_name,loan_number as
branch_name=’Downtown’); loan_id,amount from depositor
delete from account where natural join loan;
advertisement
branch_name=’Downtown’;
delete from borrower where 8. Find the names of all branches that
loan_number IN have assets greater than atleast one
(select loan_number from loan where branch located in Brooklyn.
branch_name=’Downtown’); View Answer

delete from loan where Answer: select branch_name from branch


where assets >
branch_name=’Downtown’;
(select min(assets) from branch where
2. Add a column phoneNo to customer branch_city = ‘Brooklyn’);
table. 9. Find the names of all customers
View Answer whose street address includes the
substring ‘Main’.
Answer: alter table customer add phoneNo View Answer
numeric(10);
Answer: select customer_name from Answer: select avg(balance),branch_name
customer where customer_street from account natural join depositor
like ‘%Main%’; group by branch_name;
10. List loan data, ordered by 6. Find the number of depositors for
decreasing amounts, then increasing each branch (Use distinct).
loan numbers. View Answer
View Answer
Answer: select count(Distinct
Answer: select * from loan order by amount customer_name),branch_name
desc, loan_number asc; from account natural join depositor
group by branch_name;
7. Find those branches where the
RDBMS Questions and average accounts balance is more than
Answers – SQL Queries – Rs. 1200.
View Answer
III
Answer: select branch_name from account
This set of RDBMS Questions and group by branch_name
having avg(balance)>1200
Answers for Aptitude test focuses on
“Sql Queries – III”. 8. Find the number of branches of the
bank.
1. Find all the bank customers having a View Answer
loan, an account, or both at the bank.
Answer: select count(distinct branch_name)
View Answer from branch;
Answer: select customer_name from 9. Find the average balance for each
depositor customer who lives in Harrison and has
union all at least three accounts.
select customer_name from borrower; View Answer
2. Find all the bank customers having
both a loan and an account at the bank Answer: /*select avg(balance) from account
where account_number in
View Answer
(
Answer: select customer_name from select account_number from depositor
depositor where customer_name =
intersect all (select customer_name from depositor
select customer_name from borrower; group by customer_name
3. Find all customers who have an having count(account_number) >= 2
account but no loan at the bank. intersect
View Answer select customer_name from customer where
customer_city = ‘Harrison’));*/
Answer: select customer_name from select avg(balance), customer_name
depositor from
except depositor natural join account natural
select customer_name from borrower; join customer
Aggregate Functions where customer_city = ‘Harrison’ group
(avg,min,max,sum,count) / Group By by customer_name
4. Find the average account balance at having count(customer_name)>=2;
the Perryridge branch.
View Answer advertisement

Answer: select avg(balance) from account Null values


where branch_name=’Perryridge’; 10. Find all loan numbers that appear in
5. Find the average account balance at the loan relation with null values for
each branch. amount.
View Answer View Answer
Answer: select loan_number from loan each branch in Brooklyn.
where amount is null. View Answer
Answer: select branch_name from branch
RDBMS Questions and where
assets > some(select assets from branch
Answers – SQL Queries – where branch_city = ‘Brooklyn’);
IV 6. Find all customers who have both an
account and a loan at the bank
This set of RDBMS Assessment View Answer
Questions and Answers focuses on “Sql Answer: select distinct customer_name from
Queries – IV”. borrower as b1
where exists (select customer_name from
1. Find all the customers who have both
depositor as b2
a loan and an account at the Perryridge where b1.customer_name =
branch b2.customer_name);
View Answer 7. Find all customers who have an
Answer: select customer_name from loan account at all the branches located in
natural join borrower Brooklyn.
where branch_name = ‘Perryridge’ and View Answer
customer_name in
(select customer_name from account Answer: select customer_name from
natural join depositor account as b1 natural join depositor
where branch_name = ‘Perryridge’); where exists (select * from branch
where b1.branch_name = ‘Downtown’
2. Find all customers who do have a
and b1.branch_name=’Brighton’);
loan at the bank, but do not have an
8. Find all customers who have at most
account at the bank.
one account at the Perryridge branch
View Answer
View Answer
Answer: select customer_name from loan
Answer: select customer_name from
natural join borrower
account natural join depositor
where customer_name not in
where branch_name = ‘Perryridge’ group by
(select customer_name from account
customer_name
natural join depositor);
having count(account_number)<=1;
3. Select the names of customers who
9. Find all customers who have at least
have a loan at the bank, and whose
two accounts at the perryridge branch
names are neither Smith nor Jones
View Answer
View Answer
Answer: select customer_name from
Answer: select customer_name from loan account natural join depositor
natural join borrower where branch_name = ‘Perryridge’ group by
where branch_name = ‘Perryridge’ and customer_name
customer_name not in having count(account_number)>=2;
(‘Smith’, ‘Jones’);
Complex queries
4. Find the names of all branches that
10. Find the average account balance of
have assets greater than those of at
those branches where the account
least one branch located in Brooklyn.
balance is greater than Rs. 1200.
View Answer
View Answer
Answer: select branch_name from branch
Answer: select avg(balance),branch_name
where
from account
assets > some(select assets from branch
where balance > 1200 group by
where branch_city = ‘Brooklyn’);
branch_name;
5. Find the names of all branches that
have an asset value greater than that of

You might also like