You are on page 1of 143

CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: c
Explana on: Column has only one set of
CS8492 - DATABASE values. Keys are constraints and row is one
whole set of a ributes. Entry is just a piece
MANAGEMENT of data.

SYSTEMS 3. The term _______ is used to refer to a row.


a) A ribute
b) Tuple
CSE - IV Semester / c) Field
d) Instance
Second Year Answer: b
Explana on: Tuple is one entry of the

Regula ons 2017 rela on with several a ributes which are


fields.

4. The term a ribute refers to a


___________ of a table.
a) Record
UNIT I RELATIONAL b) Column
c) Tuple
DATABASES d) Key

1. A rela onal database consists of a Answer: b


collec on of Explana on: A ribute is a specific domain in
a) Tables the rela on which has entries of all tuples.
b) Fields
c) Records 5. For each a ribute of a rela on, there is a
d) Keys set of permi ed values, called the ________
of that a ribute.
Answer: a a) Domain
Explana on: Fields are the column of the b) Rela on
rela on or tables. Records are each row in a c) Set
rela on. Keys are the constraints in a d) Schema
rela on.
Answer: a
2. A ________ in a table represents a Explana on: The values of the a ribute
rela onship among a set of values. should be present in the domain. Domain is a
a) Column set of values permi ed.
b) Key
c) Row 6. Database __________ which is the logical
d) Entry design of the database, and the database
_______ which is a snapshot of the data in
the database at a given instant in me.
a) Instance, Schema

www.studymaterialz.in 1
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Rela on, Schema 10. The tuples of the rela ons can be of
c) Rela on, Domain ________ order.
d) Schema, Instance a) Any
b) Same
Answer: d c) Sorted
Explana on: Instance is an instance of me d) Constant
and schema is a representa on.
Answer: a
7. Course(course_id,sec_id,semester) Explana on: The values only count. The
Here the course_id,sec_id and semester are order of the tuples does not ma er.
__________ and course is a _________
a) Rela ons, A ribute
b) A ributes, Rela on 1. Which one of the following is a set of one
c) Tuple, Rela on or more a ributes taken collec vely to
d) Tuple, A ributes uniquely iden fy a record?
a) Candidate key
Answer: b b) Sub key
Explana on: The rela on course has a set of c) Super key
a ributes course_id,sec_id,semester . d) Foreign key

8. Department (dept name, building, budget) Answer: c


and Employee (employee_id, name, dept Explana on: Super key is the superset of all
name, salary) the keys in a rela on.
Here the dept_name a ribute appears in
both the rela ons. Here using common 2. Consider a ributes ID, CITY and NAME.
a ributes in rela on schema is one way of Which one of this can be considered as a
rela ng ___________ rela ons. super key?
a) A ributes of common a) NAME
b) Tuple of common b) ID
c) Tuple of dis nct c) CITY
d) A ributes of dis nct d) CITY, ID

Answer: c Answer: b
Explana on: Here the rela ons are Explana on: Here the id is the only a ribute
connected by the common a ributes. which can be taken as a key. Other a ributes
are not uniquely iden fied.
9. A domain is atomic if elements of the
domain are considered to be ____________ 3. The subset of a super key is a candidate
units. key under what condi on?
a) Different a) No proper subset is a super key
b) Indivisbile b) All subsets are super keys
c) Constant c) Subset is a super key
d) Divisible d) Each subset is a super key

Answer: b Answer: a
Explana on: None. Explana on: The subset of a set cannot be

www.studymaterialz.in 2
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

the same set. Candidate key is a set from a c) Super


super key which cannot be the whole of the d) Sub
super set.
Answer: b
4. A _____ is a property of the en re rela on, Explana on: The primary key has to be
rather than of the individual tuples in which referred in the other rela on to form a
each tuple is unique. foreign key in that rela on.
a) Rows
b) Key 8. The rela on with the a ribute which is the
c) A ribute primary key is referenced in another rela on.
d) Fields The rela on which has the a ribute as a
primary key is called ______________
Answer: b a) Referen al rela on
Explana on: Key is the constraint which b) Referencing rela on
specifies uniqueness. c) Referenced rela on
d) Referred rela on
5. Which one of the following a ribute can
be taken as a primary key? Answer: c
a) Name Explana on: None.
b) Street
c) Id 9. The ______ is the one in which the
d) Department primary key of one rela on is used as a
normal a ribute in another rela on.
Answer: c a) Referen al rela on
Explana on: The a ributes name, street and b) Referencing rela on
department can repeat for some tuples. But c) Referenced rela on
the id a ribute has to be unique. So it forms d) Referred rela on
a primary key.
Answer: c
6. Which one of the following cannot be Explana on: None.
taken as a primary key?
a) Id 10. A _________ integrity constraint requires
b) Register number that the values appearing in specified
c) Dept_id a ributes of any tuple in the referencing
d) Street rela on also appear in specified a ributes of
at least one tuple in the referenced rela on.
Answer: d a) Referen al
Explana on: Street is the only a ribute b) Referencing
which can occur more than once. c) Specific
d) Primary
7. An a ribute in a rela on is a foreign key if
the _______ key from one rela on is used as Answer: a
an a ribute in that rela on. Explana on: A rela on, say r1, may include
a) Candidate among its a ributes the primary key of
b) Primary another rela on, say r2. This a ribute is
called a foreign key from r1, referencing r2.

www.studymaterialz.in 3
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

The rela on r1 is also called the referencing a) Select


rela on of the foreign key dependency, and b) Join
r2 is called the referenced rela on of the c) Union
foreign key. d) Intersec on

Answer: b
1. Using which language can a user request Explana on: Join finds the common tuple in
informa on from a database? the rela ons and combines it.
a) Query
b) Rela onal 5. The result which opera on contains all
c) Structural pairs of tuples from the two rela ons,
d) Compiler regardless of whether their a ribute values
match.
Answer: a a) Join
Explana on: Query language is a method b) Cartesian product
through which the database entries can be c) Intersec on
accessed. d) Set difference

2. Student(ID, name, dept name, tot_cred) Answer: b


In this query which a ributes form the Explana on: Cartesian product is the
primary key? mul plica on of all the values in the
a) Name a ributes.
b) Dept
c) Tot_cred 6. The _______opera on performs a set
d) ID union of two “similarly structured” tables
a) Union
Answer: d b) Join
Explana on: The a ributes name, dept and c) Product
tot_cred can have same values unlike ID. d) Intersect

3. Which one of the following is a procedural Answer: a


language? Explana on: Union just combines all the
a) Domain rela onal calculus values of rela ons of same a ributes.
b) Tuple rela onal calculus
c) Rela onal algebra 7. The most commonly used opera on in
d) Query language rela onal algebra for projec ng a set of tuple
from a rela on is
Answer: c a) Join
Explana on: Domain and Tuple rela onal b) Projec on
calculus are non-procedural language. Query c) Select
language is a method through which d) Union
database entries can be accessed.
Answer: c
4. The_____ opera on allows the combining Explana on: Select is used to view the tuples
of two rela ons by merging pairs of tuples, of the rela on with or without some
one from each rela on, into a single tuple. constraints.

www.studymaterialz.in 4
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

8. The _______ operator takes the results of Answer: b


two queries and returns only rows that Explana on: Data Defini on language is the
appear in both result sets. language which performs all the opera on in
a) Union defining structure of rela on.
b) Intersect
c) Difference 2. Which one of the following provides the
d) Projec on ability to query informa on from the
database and to insert tuples into, delete
Answer: b tuples from, and modify tuples in the
Explana on: The union operator gives the database?
result which is the union of two queries and a) DML(Data Manipula on Langauge)
difference is the one where query which is b) DDL(Data Defini on Langauge)
not a part of second query. c) Query
d) Rela onal Schema
9. A ________ is a pictorial depic on of the
schema of a database that shows the Answer: a
rela ons in the database, their a ributes, Explana on: DML performs the change in
and primary keys and foreign keys. the values of the rela on.
a) Schema diagram
b) Rela onal algebra 3.
c) Database diagram
CREATE TABLE employee (name VARCHAR, id I
d) Schema flow NTEGER)

Answer: a What type of statement is this?


Explana on: None. a) DML
b) DDL
10. The _________ provides a set of
c) View
opera ons that take one or more rela ons as
d) Integrity constraint
input and return a rela on as an output.
a) Schema c representa on Answer: b
b) Rela onal algebra Explana on: Data Defini on language is the
c) Scheme diagram language which performs all the opera on in
d) Rela on flow defining structure of rela on.
Answer: b 4.
Explana on: None.
SELECT * FROM employee

1. Which one of the following is used to What type of statement is this?


define the structure of the rela on, dele ng a) DML
rela ons and rela ng schemas? b) DDL
a) DML(Data Manipula on Langauge) c) View
b) DDL(Data Defini on Langauge) d) Integrity constraint
c) Query
d) Rela onal Schema Answer: a
Explana on: Select opera on just shows the

www.studymaterialz.in 5
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

required fields of the rela on. So it forms a DELETE FROM r; //r - relation
DML.
This command performs which of the
5. The basic data type char(n) is a _____ following ac on?
length character string and varchar(n) is a) Remove rela on
_____ length character. b) Clear rela on entries
a) Fixed, equal c) Delete fields
b) Equal, variable d) Delete rows
c) Fixed, variable
d) Variable, equal Answer: b
Explana on: Delete command removes the
Answer: c entries in the table.
Explana on: Varchar changes its length
accordingly whereas char has a specific 9.
length which has to be filled by either le ers INSERT INTO instructor VALUES (10211, ’Sm
or spaces. ith’, ’Biology’, 66000);

6. An a ribute A of datatype varchar(20) has What type of statement is this?


the value “Avi”. The a ribute B of datatype a) Query
char(20) has value ”Reed”. Here a ribute A b) DML
has ____ spaces and a ribute B has ____ c) Rela onal
spaces. d) DDL
a) 3, 20
b) 20, 4 Answer: b
c) 20, 20 Explana on: The values are manipulated. So
d) 3, 4 it is a DML.

Answer: a 10. Updates that violate __________ are


Explana on: Varchar changes its length disallowed.
accordingly whereas char has a specific a) Integrity constraints
length which has to be filled by either le ers b) Transac on control
or spaces. c) Authoriza on
d) DDL constraints
7. To remove a rela on from an SQL
database, we use the ______ command. Answer: a
a) Delete Explana on: Integrity constraint has to be
b) Purge maintained in the entries of the rela on.
c) Remove
d) Drop table
1.
Answer: d
Explana on: Drop table deletes the whole Name
structure of the rela on .purge removes the Annie
table which cannot be obtained again. Bob
8. Callie

www.studymaterialz.in 6
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Derek SELECT ID, name, dept name, salary *


1.1
WHERE instructor;
Which of these query will display the the
table given above ? a) Salary*1.1
a) Select employee from name b) ID
b) Select name c) Where
c) Select name from employee d) Instructor
d) Select employee
Answer: c
Answer: c Explana on: Where selects the rows on a
Explana on: The field to be displayed is par cular condi on. From gives the rela on
included in select and the table is included in which involves the opera on. Since
the from clause. Instructor is a rela on it has to have from
clause.
2. Here which of the following displays the
unique values of the column? 5. The ________ clause is used to list the
a ributes desired in the result of a query.
SELECT ________ dept_name
FROM instructor; a) Where
b) Select
a) All c) From
b) From d) Dis nct
c) Dis nct
d) Name Answer: b
Explana on: None
Answer: c
Explana on: Dis nct keyword selects only 6. This Query can be replaced by which one
the entries that are unique. of the following?

SELECT name, course_id


3. The ______ clause allows us to select only
FROM instructor, teaches
those rows in the result rela on of the ____ WHERE instructor_ID= teaches_ID;
clause that sa sfy a specified predicate.
a) Where, from a) Select name,course_id from
b) From, select teaches,instructor where
c) Select, from instructor_id=course_id;
d) From, where b) Select name, course_id from instructor
natural join teaches;
Answer: a c) Select name, course_id from instructor;
Explana on: Where selects the rows on a d) Select course_id from instructor join
par cular condi on. From gives the rela on teaches;
which involves the opera on.
Answer: b
4. The query given below will not give an Explana on: Join clause joins two tables by
error. Which one of the following has to be matching the common column.
replaced to get the desired output?
7.

www.studymaterialz.in 7
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

SELECT * FROM employee WHERE salary>10000 Answer: d


AND dept_id=101;
Explana on: This query do not have from
Which of the following fields are displayed as clause which specifies the rela on from
which the values has to be selected.
output?
a) Salary, dept_id
10. In the given query which of the keyword
b) Employee has to be inserted?
c) Salary
d) All the field of employee rela on INSERT INTO employee _____ (1002,Joey,200
0);
Answer: d
Explana on: Here * is used to select all the a) Table
fields of the rela on. b) Values
c) Rela on
8. d) Field

Employee_id Name Salary Answer: b


1001 Annie 6000 Explana on: Value keyword has to be used
to insert the values into the table.
1009 Ross 4500
1018 Zeith 7000
1.
This is Employee table.
Which of the following employee_id will be SELECT name ____ instructor name, course
id
displayed for the given query? FROM instructor, teaches
WHERE instructor.ID= teaches.ID;
SELECT * FROM employee WHERE employee_id>
1009;
Which keyword must be used here to rename
the field name?
a) 1009, 1001, 1018
a) From
b) 1009, 1018
b) Rename
c) 1001
c) As
d) 1018
d) Join
Answer: d
Answer: c
Explana on: Greater than symbol does not
Explana on: As keyword is used to rename.
include the given value unlike >=.

9. Which of the following statements 2.


contains an error? SELECT * FROM employee WHERE dept_name="C
a) Select * from emp where empid = 10003; omp Sci";
b) Select empid from emp where empid =
10006; In the SQL given above there is an error .
c) Select empid from emp; Iden fy the error.
d) Select empid where empid = 1009 and a) Dept_name
lastname = ‘GELLER’; b) Employee

www.studymaterialz.in 8
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) “Comp Sci” c) Same


d) From d) Ascending

Answer: c Answer: d
Explana on: For any string opera ons single Explana on: Specifica on of descending
quoted(‘) must be used to enclose. order is essen al but it not for ascending.

3. 6.

SELECT emp_name SELECT *


FROM department FROM instructor
WHERE dept_name LIKE ’ _____ Computer Sci ORDER BY salary ____, name ___;
ence’;
To display the salary from greater to smaller
Which one of the following has to be added and name in ascending order which of the
into the blank to select the dept_name which following op ons should be used?
has Computer Science as its ending string? a) Ascending, Descending
a) % b) Asc, Desc
b) _ c) Desc, Asc
c) || d) Descending, Ascending
d) $
Answer: c
Answer: a Explana on: None.
Explana on: The % character matches any
substring. 7.

4. ’_ _ _ ’ matches any string of ______ three SELECT name


characters. ’_ _ _ %’ matches any string of at FROM instructor
WHERE salary <= 100000 AND salary >= 9000
______ three characters. 0;
a) Atleast, Exactly
b) Exactly, Atleast This query can be replaced by which of the
c) Atleast, All following ?
d) All, Exactly a)

Answer: b SELECT name


Explana on: None. FROM instructor
WHERE salary BETWEEN 90000 AND 100000;

5. b)
SELECT name
SELECT name
FROM instructor
FROM employee
WHERE dept name = ’Physics’
WHERE salary <= 90000 AND salary>=100000;
ORDER BY name;

By default, the order by clause lists items in c)


______ order. SELECT name
a) Descending FROM employee
b) Any WHERE salary BETWEEN 90000 AND 100000;

www.studymaterialz.in 9
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

d) 10. _____ operator is used for appending two


strings.
SELECT name a) &
FROM instructor
WHERE salary BETWEEN 100000 AND 90000; b) %
c) ||
Answer: a d) _
Explana on: SQL includes a between
comparison operator to simplify where Answer: c
clauses that specify that a value be less than Explana on: || is the concatena on
or equal to some value and greater than or operator.
equal to some other value.

1. The union opera on is represented by


a) ∩
8. b) U
c) –
SELECT instructor.* d) *
FROM instructor, teaches
WHERE instructor.ID= teaches.ID;
Answer: b
This query does which of the following Explana on: Union operator combines the
opera on? rela ons.
a) All a ributes of instructor and teaches are
2. The intersec on operator is used to get
selected
the _____ tuples.
b) All a ributes of instructor are selected on
a) Different
the given condi on
b) Common
c) All a ributes of teaches are selected on
c) All
given condi on
d) Repea ng
d) Only the some a ributes from instructed
and teaches are selected Answer: b
Explana on: Intersec on operator ignores
Answer: b
unique tuples and takes only common ones.
Explana on: The asterisk symbol “ * ” can be
usedin the select clause to denote “all 3. The union opera on automa cally
a ributes.” __________ unlike the select clause.
a) Adds tuples
9. In SQL the spaces at the end of the string
b) Eliminates unique tuples
are removed by _______ func on.
c) Adds common tuples
a) Upper
d) Eliminates duplicate
b) String
c) Trim Answer: d
d) Lower Explana on: None.
Answer: c 4. If we want to retain all duplicates, we must
Explana on: The syntax of trim is Trim(s); write ________ in place of union.
where s-string. a) Union all

www.studymaterialz.in 10
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Union some b) Degree


c) Intersect all c) Tuples
d) Intersect some d) En ty

Answer: a Answer: b
Explana on: Union all will combine all the Explana on: None.
tuples including duplicates.
8. _____ clause is an addi onal filter that is
5. applied to the result.
a) Select
(SELECT course id b) Group-by
FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009) c) Having
EXCEPT d) Order by
(SELECT course id
FROM SECTION Answer: c
WHERE semester = ’Spring’ AND YEAR= 2010)
;
Explana on: Having is used to provide
addi onal aggregate filtra on to the query.
This query displays
a) Only tuples from second part 9. _________ joins are SQL server default
b) Only tuples from the first part which has a) Outer
the tuples from second part b) Inner
c) Tuples from both the parts c) Equi
d) Tuples from first part which do not have d) None of the men oned
second part
Answer: b
Answer: d Explana on: It is op onal to give the inner
Explana on: Except keyword is used to keyword with the join as it is default.
ignore the values.
10. The _____________ is essen ally used to
6. For like predicate which of the following is search for pa erns in target string.
true. a) Like Predicate
b) Null Predicate
i) % matches zero OF more characters. c) In Predicate
ii) _ matches exactly one CHARACTER. d) Out Predicate
a) i-only Answer: a
b) ii-only Explana on: Like predicate matches the
c) i & ii string in the given pa ern.
d) None of the men oned

Answer: a 1. A _____ indicates an absent value that


Explana on:% is used with like and _ is used may exist but be unknown or that may not
to fill in the character. exist at all.
a) Empty tuple
7. The number of a ributes in rela on is b) New value
called as its
a) Cardinality

www.studymaterialz.in 11
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Null value 5. In an employee table to include the


d) Old value a ributes whose value always have some
value which of the following constraint must
Answer: c be used?
Explana on: None. a) Null
b) Not null
2. If the a ribute phone number is included c) Unique
in the rela on all the values need not be d) Dis nct
entered into the phone number column. This
type of entry is given as Answer: b
a) 0 Explana on: Not null constraint removes the
b) – tuples of null values.
c) Null
d) Empty space 6. Using the ______ clause retains only one
copy of such iden cal tuples.
Answer: c a) Null
Explana on: Null is used to represent the b) Unique
absence of a value. c) Not null
d) Dis nct
3. The predicate in a where clause can
involve Boolean opera ons such as and. The Answer: d
result of true and unknown is_______ false Explana on: Unique is a constraint.
and unknown is _____ while unknown and
unknown is _____ 7.
a) Unknown, unknown, false
b) True, false, unknown CREATE TABLE employee (id INTEGER,name VA
RCHAR(20),salary NOT NULL);
c) True, unknown, unknown INSERT INTO employee VALUES (1005,Rach,0)
d) Unknown, false, unknown ;
INSERT INTO employee VALUES (1007,Ross, )
Answer: d ;
INSERT INTO employee VALUES (1002,Joey,33
Explana on: None. 5);

4. Some of these insert statements will produce


SELECT name
an error. Iden fy the statement.
FROM instructor a) Insert into employee values (1005,Rach,0);
WHERE salary IS NOT NULL; b) Insert into employee values
Selects (1002,Joey,335);
c) Insert into employee values (1007,Ross, );
a) Tuples with null value
d) None of the men oned
b) Tuples with no null values
c) Tuples with any salary Answer: c
d) All of the men oned Explana on: Not null constraint is specified
which means sone value (can include 0 also)
Answer: b
should be given.
Explana on: Not null constraint removes the
tpules of null values.

www.studymaterialz.in 12
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

8. The primary key must be b) Single value


a) Unique c) Aggregate value
b) Not null d) Both Collec on of values & Single value
c) Both Unique and Not null
d) Either Unique or Not null Answer: a
Explana on: None.
Answer: c
Explana on: Primary key must sa sfy unique 2.
and not null condi on for sure.
SELECT __________
FROM instructor
9. You a empt to query the database with WHERE dept name= ’Comp. Sci.’;
this command:
Which of the following should be used to find
SELECT nvl (100 / quantity, NONE)
FROM inventory;
the mean of the salary ?
a) Mean(salary)
Why does this statement cause an error b) Avg(salary)
when QUANTITY values are null? c) Sum(salary)
a) The expression a empts to divide by a null d) Count(salary)
value
b) The data types in the conversion func on Answer: b
are incompa ble Explana on: Avg() is used to find the mean
c) The character string none should be of the values.
enclosed in single quotes (‘ ‘)
3.
d) A null value used in an expression cannot
be converted to an actual value SELECT COUNT (____ ID)
FROM teaches
Answer: a WHERE semester = ’Spring’ AND YEAR = 2010
Explana on: The expression a empts to ;
divide by a null value is erroneous in sql.
If we do want to eliminate duplicates, we use
10. The result of _____unknown is unknown. the keyword ______in the aggregate
a) Xor expression.
b) Or a) Dis nct
c) And b) Count
d) Not c) Avg
d) Primary key
Answer: d
Explana on: Since unknown does not hold Answer: a
any value the value cannot have a reverse Explana on: Dis nct keyword is used to
value. select only unique items from the rela on.

4. All aggregate func ons except _____


1. Aggregate func ons are func ons that take ignore null values in their input collec on.
a ___________ as input and return a single a) Count(a ribute)
value. b) Count(*)
a) Collec on of values

www.studymaterialz.in 13
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Avg b)
d) Sum
SELECT DISTINCT course_id
FROM instructor
Answer: b WHERE name NOT IN (’Fall’, ’Spring’);
Explana on: * is used to select all values
including null. c)
5. A Boolean data type that can take values (SELECT course id
true, false, and________ FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)
a) 1
b) 0
d)
c) Null
d) Unknown SELECT COUNT (DISTINCT ID)
FROM takes
Answer: d WHERE (course id, sec id, semester, YEAR)
IN (SELECT course id, sec id, semester, Y
Explana on: Unknown values do not take
EAR
null value but it is not known. FROM teaches
WHERE teaches.ID= 10101);
6. The ____ connec ve tests for set
membership, where the set is a collec on of Answer: a
values produced by a select clause. The ____ Explana on: None.
connec ve tests for the absence of set
membership.
a) Or, in
b) Not in, in 8. The phrase “greater than at least one” is
c) In, not in represented in SQL by _____
d) In, or a) < all
b) < some
Answer: c c) > all
Explana on: In checks, if the query has the d) > some
value but not in checks if it does not have the
value. Answer: d
Explana on: >some takes atlest one value
7. Which of the following should be used to above it .
find all the courses taught in the Fall 2009
semester but not in the Spring 2010 9. Which of the following is used to find all
semester . courses taught in both the Fall 2009 semester
a) and in the Spring 2010 semester .
a)
SELECT DISTINCT course id
FROM SECTION SELECT course id
WHERE semester = ’Fall’ AND YEAR= 2009 AN FROM SECTION AS S
D WHERE semester = ’Fall’ AND YEAR= 2009 AN
course id NOT IN (SELECT course id D
FROM SECTION EXISTS (SELECT *
WHERE semester = ’Spring’ AND YEAR= 2010) FROM SECTION AS T
; WHERE semester = ’Spring’ AND YEAR= 2010

www.studymaterialz.in 14
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

AND a) Avg(salary) should not be selected


S.course id= T.course id);
b) Dept_id should not be used in group by
b) clause
c) Misplaced group by clause
SELECT name d) Group by clause is not valid in this query
FROM instructor
WHERE salary > SOME (SELECT salary Answer: b
FROM instructor
Explana on: Any a ribute that is not present
WHERE dept name = ’Biology’);
in the group by clause must appear only
c) inside an aggregate func on if it appears in
the select clause, otherwise the query is
SELECT COUNT (DISTINCT ID) treated as erroneous.
FROM takes
WHERE (course id, sec id, semester, YEAR)
2. SQL applies predicates in the _______
IN (SELECT course id, sec id, semester, Y
EAR clause a er groups have been formed, so
FROM teaches aggregate func ons may be used.
WHERE teaches.ID= 10101); a) Group by
b) With
d)
c) Where
(SELECT course id d) Having
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010) Answer: b
Explana on: The with clause provides away
Answer: a of defining a temporary rela on whose
Explana on: None. defini on is available only to the query in
which the with clause occurs.

3. Aggregate func ons can be used in the


10. We can test for the nonexistence of select list or the_______clause of a select
tuples in a subquery by using the _____ statement or subquery. They cannot be used
construct. in a ______ clause.
a) Not exist a) Where, having
b) Not exists b) Having, where
c) Exists c) Group by, having
d) Exist d) Group by, where
Answer: b Answer: b
Explana on: Exists is used to check for the Explana on: To include aggregate func ons
existence of tuples. having clause must be included a er where.

4. The ________ keyword is used to access


1. a ributes of preceding tables or subqueries
SELECT dept_name, ID, avg (salary) in the from clause.
FROM instructor a) In
GROUP BY dept_name; b) Lateral
This statement IS erroneous because

www.studymaterialz.in 15
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Having Answer: d
d) With Explana on: With clause creates a
temporary rela on.
Answer: b
Explana on: 7. Subqueries cannot:
a) Use group by or group func ons
Eg : SELECT name, salary, avg salary
FROM instructor I1, lateral ( b) Retrieve data from a table different from
SELECT avg(salary) AS avg salary the one in the outer query
FROM instructor I2 c) Join tables
WHERE I2.dept name= I1.dept n d) Appear in select, update, delete, insert
ame);
statements.
Without the lateral clause, the subquery
cannot access the correla on variable Answer: c
Explana on: None.
I1 from the outer query.
8. Which of the following is not an aggregate
5. Which of the following creates a
func on?
temporary rela on for the query on which it
a) Avg
is defined?
a) With b) Sum
c) With
b) From
d) Min
c) Where
d) Select
Answer: c
Explana on: With is used to create
Answer: a
temporary rela on and its not an aggregate
Explana on: The with clause provides a way
func on.
of defining a temporary rela on whose
defini on is available only to the query in
9. The EXISTS keyword will be true if:
which the with clause occurs.
a) Any row in the subquery meets the
condi on only
6.
b) All rows in the subquery fail the condi on
WITH max_budget (VALUE) AS only
(SELECT MAX(budget) c) Both of these two condi ons are met
FROM department) d) Neither of these two condi ons is met
SELECT budget
FROM department, max_budget
WHERE department.budget = MAX budget.valu Answer: a
e; Explana on: EXISTS keyword checks for
existance of a condi on.
In the query given above which one of the
following is a temporary rela on? 10. How can you find rows that do not match
a) Budget some specified condi on?
b) Department a) EXISTS
c) Value b) Double use of NOT EXISTS
d) Max_budget c) NOT EXISTS
d) None of the men oned

www.studymaterialz.in 16
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: b INSERT INTO course (course id, title,


dept name, credits)
Explana on: None.
VALUES (’CS-437’, ’DATABASE Systems’,
’Comp. Sci.’, 4);

1. A Delete command operates on ______ b)


rela on.
a) One INSERT INTO instructor
b) Two SELECT ID, name, dept name, 18000
FROM student
c) Several WHERE dept name = ’Music’ AND tot cred
d) Null > 144;

Answer: a c)
Explana on: Delete can delete from only one
table at a me. INSERT INTO course VALUES (’CS-437’, ’DAT
ABASE Systems’, ’Comp. Sci.’, 4);
2.
d) Not possible
Delete from r where P;
Answer: b
The above command Explana on: Using select statement in insert
a) Deletes a par cular tuple from the rela on will include rows which are the result of the
b) Deletes the rela on selec on.
c) Clears all entries from the rela on
d) All of the men oned 5. Which of the following deletes all tuples in
the instructor rela on for those instructors
Answer: a associated with a department located in the
Explana on: Here P gives the condi on for Watson building which is in department
dele ng specific rows. rela on.
a)
3. Which one of the following deletes all the
DELETE FROM instructor
entries but keeps the structure of the
WHERE dept_name IN 'Watson';
rela on.
a) Delete from r where P; b)
b) Delete from instructor where dept name=
’Finance’; DELETE FROM department
c) Delete from instructor where salary WHERE building='Watson';
between 13000 and 15000;
c)
d) Delete from instructor;
DELETE FROM instructor
Answer: d WHERE dept_name IN (SELECT dept name
Explana on: Absence of condi on deletes all FROM department
rows. WHERE building =
’Watson’);

4. Which of the following is used to insert a d) None of the men oned


tuple from another rela on?
a)

www.studymaterialz.in 17
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: c CASE
WHEN pred1 ... result1
Explana on: The query must include
WHEN pred2 ... result2
building=watson condi on to filter the . . .
tuples. WHEN predn ... resultn
ELSE result0
6. END

UPDATE instructor b)
_____ salary= salary * 1.05;
CASE
Fill in with correct keyword to update the WHEN pred1 THEN result1
WHEN pred2 THEN result2
instructor rela on. . . .
a) Where WHEN predn THEN resultn
b) Set ELSE result0
c) In END
d) Select
c)
Answer: b CASE
Explana on: Set is used to update the WHEN pred1 THEN result1
par cular value. WHEN pred2 THEN result2
. . .
WHEN predn THEN resultn
7. _________ are useful in SQL update
ELSE result0
statements, where they can be used in the
set clause. d) All of the men oned
a) Mul ple queries
b) Sub queries Answer: b
c) Update Explana on: None.
d) Scalar subqueries
10. Which of the following rela on updates
Answer: d all instructors with salary over $100,000
Explana on: None. receive a 3 percent raise, whereas all others
receive a 5 percent raise.
8. The problem of ordering the update in a)
mul ple updates is avoided using
a) Set UPDATE instructor
b) Where SET salary = salary * 1.03
WHERE salary > 100000;
c) Case UPDATE instructor
d) When SET salary = salary * 1.05
WHERE salary <= 100000;
Answer: c
Explana on: The case statements can add b)
the order of upda ng tuples.
UPDATE instructor
SET salary = salary * 1.05
9. Which of the following is the correct WHERE salary < (SELECT avg (salary)
format for case statements. FROM instructor);
a)
c)

www.studymaterialz.in 18
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

UPDATE instructor The above query is equivalent to


SET salary = CASE
a)
WHEN salary <= 100000 THEN salary * 1.
03
ELSE salary * 1.05 SELECT *
END FROM student INNER JOIN takes USING (I
D);
d) None of the men oned
b)
Answer: a SELECT *
Explana on: The order of the two update FROM student OUTER JOIN takes USING (I
statements is important. If we changed the D);
order of the two statements, an instructor
with a salary just under $100,000 would c)
receive an over 8 percent raise. SQL provides SELECT *
a case construct that we can use to perform FROM student LEFT OUTER JOIN takes USI
both the updates with a single update NG (ID);
statement, avoiding the problem with the
order of updates. d) None of the men oned

Answer: a
1. The____condi on allows a general Explana on: Join can be replaced by inner
predicate over the rela ons being joined. join.
a) On
b) Using 4. What type of join is needed when you wish
c) Set to include rows that do not have matching
d) Where values?
a) Equi-join
Answer: a b) Natural join
Explana on: On gives the condi on for the c) Outer join
join expression. d) All of the men oned

2. Which of the join opera ons do not Answer: c


preserve non matched tuples? Explana on: An outer join does not require
a) Le outer join each record in the two joined tables to have
b) Right outer join a matching record..
c) Inner join
d) Natural join 5. How many tables may be included with a
join?
Answer: c a) One
Explana on: INNER JOIN: Returns all rows b) Two
when there is at least one match in BOTH c) Three
tables. d) All of the men oned

3. Answer: d
Explana on: Join can combine mul ple
SELECT * tables.
FROM student JOIN takes USING (ID);

www.studymaterialz.in 19
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

6. Which are the join types in join condi on: b) Select * from R cross join S
a) Cross join c) Select * from R union join S
b) Natural join d) Select * from R inner join S
c) Join with USING clause
d) All of the men oned Answer: b
Explana on: None.
Answer: d
Explana on: There are totally four join types
in SQL. 1. Which of the following creates a virtual
rela on for storing the query?
7. How many join types in join condi on: a) Func on
a) 2 b) View
b) 3 c) Procedure
c) 4 d) None of the men oned
d) 5
Answer: b
Answer: d Explana on: Any such rela on that is not
Explana on: Types are inner join, le outer part of the logical model, but is made visible
join, right outer join, full join, cross join. to a user as a virtual rela on, is called a view.

8. Which join refers to join records from the 2. Which of the following is the syntax for
right table that have no matching key in the views where v is view name?
le table are include in the result set: a) Create view v as “query name”;
a) Le outer join b) Create “query expression” as view;
b) Right outer join c) Create view v as “query expression”;
c) Full outer join d) Create view “query expression”;
d) Half outer join
Answer: c
Answer: b Explana on: <query expression> is any legal
Explana on: RIGHT OUTER JOIN: Return all query expression. The view name is
rows from the right table and the matched represented by v.
rows from the le table.
3.
9. The opera on which is not considered a
SELECT course_id
basic opera on of rela onal algebra is
FROM physics_fall_2009
a) Join WHERE building= ’Watson’;
b) Selec on
c) Union Here the tuples are selected from the
d) Cross product view.Which one denotes the view.
a) Course_id
Answer: a b) Watson
Explana on: None. c) Building
d) physics_fall_2009
10. In SQL the statement select * from R, S is
equivalent to Answer: c
a) Select * from R natural join S Explana on: View names may appear in a

www.studymaterialz.in 20
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

query any place where a rela on name may c) With check


appear. d) All of the men oned

4. Materialised views make sure that Answer: c


a) View defini on is kept stable Explana on: Views can be defined with a
b) View defini on is kept up-to-date with check op on clause at the end of the
c) View defini on is verified for error view defini on; then, if a tuple inserted into
d) View is deleted a er specified me the view does not sa sfy the view’s where
clause condi on, the inser on is rejected by
Answer: b the database system.
Explana on: None.
8. Consider the two rela ons instructor and
5. Upda ng the value of the view department
a) Will affect the rela on from which it is Instructor:
defined
b) Will not change the view defini on ID Name Dept_name Salary
c) Will not affect the rela on from which it is 1001 Ted Finance 10000
defined
1002 Bob Music 20000
d) Cannot determine
1003 Ron Physics 50000
Answer: a
Explana on: None. Department:

6. SQL view is said to be updatable (that is, Dept_name Building Budget


inserts, updates or deletes can be applied on Biology Watson 40000
the view) if which of the following condi ons
Chemistry Painter 30000
are sa sfied by the query defining the view?
a) The from clause has only one database Music Taylor 50000
rela on
b) The query does not have a group by or Which of the following is used to create view
having clause for these rela ons together?
c) The select clause contains only a ribute a)
names of the rela on and does not have any
CREATE VIEW instructor_info AS
expressions, aggregates, or dis nct SELECT ID, name, building
specifica on FROM instructor, department
d) All of the men oned WHERE instructor.dept name= department.de
pt name;
Answer: d
b)
Explana on: All of the condi ons must be
sa sfied to update the view in sql. CREATE VIEW instructor_info
SELECT ID, name, building
7. Which of the following is used at the end FROM instructor, department;
of the view to reject the tuples which do not
sa sfy the condi on in where clause? c)
a) With CREATE VIEW instructor_info AS
b) Check SELECT ID, name, building

www.studymaterialz.in 21
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

FROM instructor; Answer: d


Explana on: Syntax is – create view v as
d) <query expression>;.
CREATE VIEW instructor_info AS
SELECT ID, name, building
FROM department; 1. A _________ consists of a sequence of
query and/or update statements.
Answer: a a) Transac on
Explana on: None. b) Commit
c) Rollback
d) Flashback
9. For the view Create view instructor_info as Answer: a
SELECT ID, name, building
Explana on: Transac on is a set of opera on
FROM instructor, departme un l commit.
nt
WHERE instructor.dept nam 2. Which of the following makes the
e= department.dept name; transac on permanent in the database?
a) View
If we insert tuple into the view as insert into
b) Commit
instructor info values (’69987’, ’White’,
c) Rollback
’Taylor’);
d) Flashback
What will be the values of the other
a ributes in instructor and department Answer: b
rela ons? Explana on: Commit work commits the
a) Default value current transac on.
b) Null
c) Error statement 3. In order to undo the work of transac on
d) 0 a er last commit which one should be used?
a) View
Answer: b b) Commit
Explana on: The values take null if there is c) Rollback
no constraint in the a ribute else it is an d) Flashback
Erroneous statement.
Answer: c
10. Explana on: Rollback work causes the
CREATE VIEW faculty AS
current transac on to be rolled back; that is,
SELECT ID, name, dept name it undoes all the updates performed by the
FROM instructor; SQL statements in the transac on.

Find the error in this query. 4. Consider the following ac on:


a) Instructor
b) Select TRANSACTION.....
Commit;
c) View …as ROLLBACK;
d) None of the men oned

www.studymaterialz.in 22
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

What does Rollback do? Answer: a


a) Undoes the transac ons before commit Explana on: None.
b) Clears all transac ons
c) Redoes the transac ons before commit 8. A transac on completes its execu on is
d) No ac on said to be
a) Commi ed
Answer: d b) Aborted
Explana on: Once a transac on has c) Rolled back
executed commit work, its effects can no d) Failed
longer be undone by rollback work.
Answer: a
5. In case of any shut down during Explana on: A complete transac on always
transac on before commit which of the commits.
following statement is done automa cally?
a) View 9. Which of the following is used to get back
b) Commit all the transac ons back a er rollback?
c) Rollback a) Commit
d) Flashback b) Rollback
c) Flashback
Answer: c d) Redo
Explana on: Once a transac on has
executed commit work, its effects can no Answer: c
longer be undone by rollback work. Explana on: None.

6. In order to maintain the consistency during 10. ______ will undo all statements up to
transac ons, database provides commit?
a) Commit a) Transac on
b) Atomic b) Flashback
c) Flashback c) Rollback
d) Retain d) Abort

Answer: b Answer: c
Explana on: By atomic, either all the effects Explana on: Flashback will undo all the
of the transac on are reflected in the statements and Abort will terminate the
database, or none are (a er rollback). opera on.

7. Transac on processing is associated with


everything below except 1. To include integrity constraint in an
a) Conforming an ac on or triggering a exis ng rela on use :
response a) Create table
b) Producing detail summary or excep on b) Modify table
report c) Alter table
c) Recording a business ac vity d) Drop table
d) Maintaining a data
Answer: c
Explana on: SYNTAX – alter table table-

www.studymaterialz.in 23
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

name add constraint, where constraint can Inorder to ensure that the value of budget is
be any constraint on the rela on. non-nega ve which of the following should
be used?
2. Which of the following is not an integrity a) Check(budget>0)
constraint? b) Check(budget<0)
a) Not null c) Alter(budget>0)
b) Posi ve d) Alter(budget<0)
c) Unique
d) Check ‘predicate’ Answer: a
Explana on: A common use of the check
Answer: b clause is to ensure that a ribute values
Explana on: Posi ve is a value and not a sa sfy specified condi ons, in effect crea ng
constraint. a powerful type system.

3. 5. Foreign key is the one in which the


________ of one rela on is referenced in
CREATE TABLE Employee(Emp_id NUMERIC NOT
NULL, Name VARCHAR(20) , dept_name VARCHA another rela on.
R(20), Salary NUMERIC UNIQUE(Emp_id,Name) a) Foreign key
); b) Primary key
INSERT INTO Employee VALUES(1002, Ross, C c) References
SE, 10000)
INSERT INTO Employee VALUES(1006,Ted,Fina d) Check constraint
nce, );
INSERT INTO Employee VALUES(1002,Rita,Sal Answer: b
es,20000); Explana on: The foreign-key declara on
specifies that for each course tuple, the
What will be the result of the query?
department name specified in the tuple must
a) All statements executed
exist in the department rela on.
b) Error in create statement
c) Error in insert into Employee 6.
values(1006,Ted,Finance, );
d) Error in insert into Employee CREATE TABLE course
values(1008,Ross,Sales,20000); ( . . .
FOREIGN KEY (dept name) REFERENCES depart
ment
Answer: d . . . );
Explana on: The not null specifica on
prohibits the inser on of a null value for the Which of the following is used to delete the
a ribute. entries in the referenced table when the
The unique specifica on says that no two tuple is deleted in course table?
tuples in the rela on can be equal on all the a) Delete
listed a ributes. b) Delete cascade
c) Set null
4. d) All of the men oned
CREATE TABLE Manager(ID NUMERIC,Name VARC
Answer: b
HAR(20),budget NUMERIC,Details VARCHAR(30
)); Explana on: The delete “cascades” to the

www.studymaterialz.in 24
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

course rela on, deletes the tuple that refers email address, or phone number) before the
to the department that was deleted. record is accepted
c) Informa on on the customer must be
7. Domain constraints, func onal known before anything can be sold to that
dependency and referen al integrity are customer
special forms of _________ d) When entering an order quan ty, the user
a) Foreign key must input a number and not some text (i.e.,
b) Primary key 12 rather than ‘a dozen’)
c) Asser on
d) Referen al constraint Answer: c
Explana on: The informa on can be referred
Answer: c to and obtained.
Explana on: An asser on is a predicate
expressing a condi on we wish the database
to always sa sfy. 1. Dates must be specified in the format
a) mm/dd/yy
8. Which of the following is the right syntax b) yyyy/mm/dd
for the asser on? c) dd/mm/yy
a) Create asser on ‘asser on-name’ check d) yy/dd/mm
‘predicate’;
b) Create asser on check ‘predicate’ Answer: b
‘asser on-name’; Explana on: yyyy/mm/dd is the default
c) Create asser ons ‘predicates’; format in sql.
d) All of the men oned
2. A ________ on an a ribute of a rela on is
Answer: a a data structure that allows the database
Explana on: None. system to find those tuples in the rela on
that have a specified value for that a ribute
9. Data integrity constraints are used to: efficiently, without scanning through all the
a) Control who is allowed access to the data tuples of the rela on.
b) Ensure that duplicate records are not a) Index
entered into the table b) Reference
c) Improve the quality of data entered for a c) Asser on
specific property (i.e., table column) d) Timestamp
d) Prevent users from changing the values
stored in the table Answer: a
Explana on: Index is the reference to the
Answer: c tuples in a rela on.
Explana on: None.
3.
10. Which of the following can be addressed
by enforcing a referen al integrity Create index studentID_index on student(I
D);
constraint?
a) All phone numbers must include the area Here which one denotes the rela on for
code which index is created?
b) Certain fields are required (such as the a) StudentID_index

www.studymaterialz.in 25
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) ID drop or modify types that have been created


c) StudentID earlier.
d) Student
7.
Answer: d
Explana on: The statement creates an index CREATE DOMAIN YearlySalary NUMERIC(8,2)
CONSTRAINT salary VALUE test __________;
named studentID index on the a ribute ID of
the rela on student. In order to ensure that an instructor’s salary
domain allows only values greater than a
4. Which of the following is used to store specified value use:
movie and image files? a) Value>=30000.00
a) Clob
b) Not null;
b) Blob c) Check(value >= 29000.00);
c) Binary
d) Check(value)
d) Image
Answer: c
Answer: b
Explana on: Check(value ‘condi on’) is the
Explana on: SQL therefore provides large-
syntax.
object data types for character data (clob)
and binary data (blob). The le ers “lob” in 8. Which of the following closely resembles
these data types stand for “Large OBject”. Create view?
a) Create table . . .like
5. The user defined data type can be created b) Create table . . . as
using
c) With data
a) Create datatype
d) Create view as
b) Create data
c) Create definetype Answer: b
d) Create type Explana on: The ‘create table . . . as’
statement closely resembles the create view
Answer: d
statement and both are defined by using
Explana on: The create type clause can be
queries. The main difference is that the
used to define new types.Syntax : create type contents of the table are set when the table
Dollars as numeric(12,2) final; .
is created, whereas the contents of a view
6. Values of one type can be converted to always reflect the current query result.
another domain using which of the
9. In contemporary databases, the top level
following? of the hierarchy consists of ______ each of
a) Cast which can contain _____
b) Drop type a) Catalogs, schemas
c) Alter type b) Schemas, catalogs
d) Convert c) Environment, schemas
Answer: a d) Schemas, Environment
Explana on: Example of cast :cast
Answer: a
(department.budget to numeric(12,2)). SQL Explana on: None.
provides drop type and alter type clauses to

www.studymaterialz.in 26
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

10. Which of the following statements Answer: a


creates a new table temp instructor that has Explana on: The privilege list allows the
the same schema as an instructor. gran ng of several privileges in one
a) create table temp_instructor; command .
b) Create table temp_instructor like
instructor;
c) Create Table as temp_instructor;
d) Create table like temp_instructor; 3. Which of the following is used to provide
privilege to only a par cular a ribute?
Answer: b a) Grant select on employee to Amit
Explana on: None. b) Grant update(budget) on department to
Raj
c) Grant update(budget,salary,Rate) on
1. The database administrator who department to Raj
authorizes all the new users, modifies the d) Grant delete to Amit
database and takes grants privilege is
a) Super user Answer: b
b) Administrator Explana on: This grant statement gives user
c) Operator of opera ng system Raj update authoriza on on the budget
d) All of the men oned a ribute of the department rela on.

Answer: d 4. Which of the following statement is used


Explana on: The authoriza ons provided by to remove the privilege from the user Amir?
the administrator to the user is a privilege. a) Remove update on department from Amir
b) Revoke update on employee from Amir
2. Which of the following is a basic form of c) Delete select on department from Raj
grant statement? d) Grant update on employee from Amir
a)
Answer: b
GRANT 'privilege list'
Explana on: revoke on from ;
ON 'relation name or view name'
TO 'user/role list';
5. Which of the following is used to provide
b) delete authoriza on to instructor?
a)
GRANT 'privilege list'
ON 'user/role list' CREATE ROLE instructor ;
TO 'relation name or view name'; GRANT DELETE TO instructor;

c) b)
GRANT 'privilege list' CREATE ROLE instructor;
TO 'user/role list' GRANT SELECT ON takes
TO instructor;
d)
c)
GRANT 'privilege list'
ON 'relation name or view name' CREATE ROLE instructor;
ON 'user/role list'; GRANT DELETE ON takes

www.studymaterialz.in 27
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

TO instructor; u2 authoriza on is also revoked


b) If u1 revokes authoriza on from u2 then
d) All of the men oned u2 authoriza on is revoked
c) If DBA & u1 revokes authoriza on from u1
Answer: c
then u2 authoriza on is also revoked
Explana on: The role is first created and the
d) If u2 revokes authoriza on then u1
authoriza on is given on rela on takes to the
authoriza on is revoked
role.
Answer: c
6. Which of the following is true regarding
Explana on: A user has an authoriza on if
views?
and only if there is a path from the root of
a) The user who creates a view cannot be
the authoriza on graph down to the node
given update authoriza on on a view without
represen ng the user.
having update authoriza on on the rela ons
used to define the view 9. Which of the following is used to avoid
b) The user who creates a view cannot be cascading of authoriza ons from the user?
given update authoriza on on a view without a) Granted by current role
having update authoriza on on the rela ons b) Revoke select on department from Amit,
used to define the view Satoshi restrict;
c) If a user creates a view on which no c) Revoke grant op on for select on
authoriza on can be granted, the system will department from Amit;
allow the view crea on request d) Revoke select on department from Amit,
d) A user who creates a view receives all Satoshi cascade;
privileges on that view
Answer: b
Answer: c Explana on: The revoke statement may
Explana on: A user who creates a view does specify restrict in order to prevent cascading
not necessarily receive all privileges on that revoca on. The keyword cascade can be used
view. instead of restrict to indicate that revoca on
should cascade.
7. If we wish to grant a privilege and to allow
the recipient to pass the privilege on to other 10. The gran ng and revoking of roles by the
users, we append the __________ clause to user may cause some confusions when that
the appropriate grant command. user role is revoked. To overcome the above
a) With grant situa on
b) Grant user a) The privilege must be granted only by roles
c) Grant pass privelege b) The privilege is granted by roles and users
d) With grant op on c) The user role cannot be removed once
given
Answer: d
d) By restric ng the user access to the roles
Explana on: None.
Answer: a
8. In authoriza on graph, if DBA provides
Explana on: The current role associated with
authoriza on to u1 which inturn gives to u2
a session can be set by execu ng set role
which of the following is correct?
name. The specified role must have been
a) If DBA revokes authoriza on from u1 then

www.studymaterialz.in 28
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

granted to the user, else the set role c) User ID, Password, URL or machine name
statement fails. where server runs
d) Password, URL or machine name where
server runs, User ID
1. Which of the following is used to access
the database server at the me of execu ng Answer: b
the program and get the data from the server Explana on: The database must be opened
accordingly? first in order to perform any opera ons for
a) Embedded SQL which this get connec on method is used.
b) Dynamic SQL
c) SQL declara ons 4. Which of the following invokes func ons in
d) SQL data analysis sql?
a) Prepared Statements
Answer: b b) Connec on statement
Explana on: Embedded SQL, the SQL c) Callable statements
statements are iden fied at compile me d) All of the men oned
using a preprocessor. The preprocessor
submits the SQL statements to the database Answer: c
system for precompila on and op miza on; Explana on: JDBC provides a Callable
then it replaces the SQL statements in the Statement interface that allows invoca on of
applica on program with appropriate code SQL stored procedures and func ons.
and func on calls before invoking the
programming-language compiler. 5. Which of the following func on is used to
find the column count of the par cular
2. Which of the following header must be resultset?
included in java program to establish a) getMetaData()
database connec vity using JDBC ? b) Metadata()
a) Import java.sql.*; c) getColumn()
b) Import java.sql.odbc.jdbc.*; d) get Count()
c) Import java.jdbc.*;
d) Import java.sql.jdbc.*; Answer: a
Explana on: The interface ResultSet
Answer: a has a method, getMetaData(), that returns a
Explana on: The Java program must import ResultSetMetaData object that contains
java.sql.*, which contains the interface metadata about the result set.
defini ons for the func onality provided by ResultSetMetaData, in turn, has methods to
JDBC. find metadata informa on, such as the
number of columns in the result, the name of
3. DriverManager.getConnec on(_______ , a specified column, or the type of a specified
______ , ______) column.
What are the two parameters that are
included? 6. Which of the following is a following
a) URL or machine name where server runs, statement is a prepared statements?
Password, User ID a) Insert into department values(?,?,?)
b) URL or machine name where server runs, b) Insert into department values(x,x,x)
User ID, Password c) SQLSetConnectOp on(conn, SQL

www.studymaterialz.in 29
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

AUTOCOMMIT, 0) SET salary = salary + 100


WHERE CURRENT OF c;
d) SQLTransact(conn, SQL ROLLBACK)
d) EXEC SQL update END-SQL
Answer: a
Explana on:? is used as a placeholder whose
Answer: c
value can be provided later.
Explana on: The SQL can be terminated by ;
to terminate the sentence.
7. Which of the following is used as the
embedded SQL in COBOL?
10. Which of the following is used to access
a) EXEC SQL <embedded SQL statement >; large objects from a database ?
b) EXEC SQL <embedded SQL statement > a) setBlob()
END-EXEC
b) getBlob()
c) EXEC SQL <embedded SQL statement > c) getClob()
d) EXEC SQL <embedded SQL statement > d) all of the men oned
END EXEC;
Answer: d
Answer: b
Explana on: None.
Explana on: EXEC SQL <embedded SQL
statement >; is normally in C.
1.
8. Which of the following is used to
dis nguish the variables in SQL from the host Create function dept count(dept_name varc
language variables? har(20))
a) .
begin
b) –
c) : declare d count integer;
d) ,
select count(*) into d count
Answer: b from instructor
Explana on:
where instructor.dept_name= dept_name
EXEC SQL
DECLARE c cursor FOR return d count;
SELECT ID, name
FROM student end
WHERE tot cred > :credit amount;

. Find the error in the the above statement.


a) Return type missing
9. The update statement can be executed in b) Dept_name is mismatched
host language using c) Reference rela on is not men oned
a) EXEC SQL update c; d) All of the men oned
b) EXEC SQL update c into :si, :sn;
c) Answer: a
Explana on: Return integer should be given
EXEC SQL
UPDATE instructor a er create func on for this par cular
func on.

www.studymaterialz.in 30
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

2. For the func on created in Ques on 1, Create procedure dept_count proc(in dept
name varchar(20),
which of the following is a proper select
statement ? out d count integer)
a)
begin
SELECT dept name, budget
FROM instructor select count(*) into d count
WHERE dept COUNT() > 12;
from instructor
b)
where instructor.dept name= dept count pr
oc.dept name
SELECT dept name, budget
FROM instructor
end
WHERE dept COUNT(dept name) > 12;

c) Which of the following is used to call the


SELECT dept name, budget procedure given above ?
WHERE dept COUNT(dept name) > 12; a)

d) Declare d_count integer;

SELECT dept name, budget b)


FROM instructor
WHERE dept COUNT(budget) > 12; Declare d_count integer;

Answer: b call dept_count proc(’Physics’, d_coun


Explana on: The count of the dept_name t);
must be checked for the displaying from
c)
instructor rela on.
Declare d_count integer;

call dept_count proc(’Physics’);


3. Which of the following is used to input the
entry and give the result in a variable in a d)
procedure? Declare d_count;
a) Put and get
b) Get and put call dept_count proc(’Physics’, d_coun
c) Out and In t);
d) In and out
Answer: b
Answer: d Explana on: Here the ‘Physics’ is in variable
and d_count is out variable.
Explana on: Create procedure dept count
proc(in dept name varchar(20), out d count
integer). Here in and out refers to input and
result of procedure.
5. The format for compound statement is
a) Begin ……. end
4.
b) Begin atomic……. end
c) Begin ……. repeat

www.studymaterialz.in 31
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

d) Both Begin ……. end and Begin atomic……. then statement or compound statement
end
elsif boolean expression

Answer: d then statement or compound statement


Explana on: A compound statement is of the
form begin . . . end, and it may contain else statement or compound statement
mul ple SQL statements between the begin end if
and the end.A compound statement of the
form begin atomic . . . end ensures that all c)
the statements contained within it are
executed as a single transac on. If boolean expression

then statement or compound statement


6.
elif boolean expression
Repeat
then statement or compound statement
sequence of statements;
else statement or compound statement
__________________
end if
end repeat
d)
Fill in the correct op on :
a) While Condi on If boolean expression
b) Un l variable
c) Un l boolean expression then statement or compound statement
d) Un l 0 else

Answer: c statement or compound statement


Explana on: None.
else statement or compound statement
7. Which of the following is the correct end if
format for if statement?
a) Answer: a
Explana on: The condi onal statements
If boolean expression supported by SQL include if-then-else
then statement or compound statement statements by using this syntax. elif and elsif
are not allowed.
elseif boolean expression

then statement or compound statement

else statement or compound statement 8. A stored procedure in SQL is


a___________
end if a) Block of func ons
b) Group of Transact-SQL statements
b) compiled into a single execu on plan.
If boolean expression c) Group of dis nct SQL statements.
d) None of the men oned

www.studymaterialz.in 32
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: b generated when a par cular opera on takes


Explana on: If it an atomic statement then place.
the statements are in single transac on.
2. Triggers are supported in
9. Temporary stored procedures are stored in a) Delete
_________ database. b) Update
a) Master c) Views
b) Model d) All of the men oned
c) User specific
d) Tempdb Answer: c
Explana on: The triggers run a er an insert,
Answer: d update or delete on a table. They are not
Explana on: None. supported for views.

10. Declare out of classroom seats condi on 3. The CREATE TRIGGER statement is used to
create the trigger. THE _____ clause specifies
DECLARE exit handler FOR OUT OF classroom the table name on which the trigger is to be
seats
BEGIN a ached. The ______ specifies that this is an
SEQUENCE OF statements AFTER INSERT trigger.
END a) for insert, on
b) On, for insert
The above statements are used for c) For, insert
a) Calling procedures d) None of the men oned
b) Handling Excep on
c) Handling procedures Answer: b
d) All of the men oned Explana on: The triggers run a er an insert,
update or delete on a table. They are not
Answer: b supported for views.
Explana on: The SQL procedural language
also supports the signaling of excep on 4. What are the a er triggers?
condi ons, and declaring of handlers that a) Triggers generated a er a par cular
can handle the excep on, as in this code. opera on
b) These triggers run a er an insert, update
or delete on a table
1. A __________ is a special kind of a store c) These triggers run a er an insert, views,
procedure that executes in response to update or delete on a table
certain ac on on the table like inser on, d) All of the men oned
dele on or upda on of data.
a) Procedures Answer: b
b) Triggers Explana on: AFTER TRIGGERS can be
c) Func ons classified further into three types as: AFTER
d) None of the men oned INSERT Trigger, AFTER UPDATE Trigger, AFTER
DELETE Trigger.
Answer: b
Explana on: Triggers are automa cally 5. The variables in the triggers are declared
using

www.studymaterialz.in 33
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) – Answer: a
b) @ Explana on: Triggers can be manipulated.
c) /
d) /@ 10. Which prefixes are available to Oracle
triggers?
Answer: b a) : new only
Explana on: Example : declare @empid int; b) : old only
where empid is the variable. c) Both :new and : old
d) Neither :new nor : old
6. The default extension for an Oracle
SQL*Plus file is: Answer: c
a) .txt Explana on: None.
b) .pls
c) .ora
d) .sql 1. Any recursive view must be defined as the
union of two subqueries: a _______ query
Answer: d that is nonrecursive and a __________ query.
Explana on: Example :None. a) Base, recursive
b) Recursive, Base
7. Which of the following is NOT an Oracle- c) Base, Redundant
supported trigger? d) View, Base
a) BEFORE
b) DURING Answer: a
c) AFTER Explana on: First compute the base query
d) INSTEAD OF and add all the resultant tuples to the
recursively defined view rela on.
Answer: b
Explana on: Example: During trigger is not 2. Ranking of queries is done by which of the
possible in any database. following?
a) Group by
8. What are the different in triggers? b) Order by
a) Define, Create c) Having
b) Drop, Comment d) Both Group by and Order by
c) Insert, Update, Delete
d) All of the men oned Answer: b
Explana on: Order by clause arranges the
Answer: c values in ascending or descending order
Explana on: Triggers are not possible for where a default is ascending order.
create, drop.
3. In rank() func on if one value is shared by
9. Triggers ________ enabled or disabled two tuples then
a) Can be a) The rank order con nues as coun ng
b) Cannot be numbers
c) Ought to be b) The rank order con nues by leaving one
d) Always rank in the middle

www.studymaterialz.in 34
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) The user specifies the order b) Cum_rank


d) The order does not change c) Percent_rank
d) rank()
Answer: b
Explana on: Example. rank() over (order by Answer: c
(GPA) desc). Explana on: Percent rank of a tuple gives
the rank of the tuple as a frac on.
4. The __________ func on that does not
create gaps in the ordering. 7. Inorder to simplify the null value confusion
a) Intense_rank() in the rank func on we can specify
b) Con nue_rank() a) Not Null
c) Default_rank() b) Nulls last
d) Dense_rank() c) Nulls first
d) Either Nulls last or first
Answer: d
Explana on: For dense_rank() the tuples Answer: d
with the second highest value all get rank 2, Explana on: select ID, rank () over (order by
and tuples with the third highest value get GPA desc nulls last) as s rank from student
rank 3, and so on. grades;.

5. 8. Suppose we are given a view tot credits


(year, num credits) giving the total number of
SELECT ID, GPA credits taken by students in each year. The
FROM student grades
ORDER BY GPA query that computes averages over the 3
____________; preceding tuples in the specified sort order is
a)
Inorder to give only 10 rank on the whole we
should use SELECT YEAR, avg(num credits)
OVER (ORDER BY YEAR ROWS 3 preceding)
a) Limit 10
AS avg total credits
b) Upto 10 FROM tot credits;
c) Only 10
d) Max 10 b)

Answer: a SELECT YEAR, avg(num credits)


OVER (ORDER BY YEAR ROWS 3 unbounded prec
Explana on: However, the limit clause does eding)
not support par oning, so we cannot get AS avg total credits
the top n within each par on without FROM tot credits;
performing ranking; further, if more than one
student gets the same GPA, it is possible that c) All of the men oned
one is included in the top 10, while another is d) None of the men oned
excluded.
Answer: a
6. If there are n tuples in the par on and Explana on: Suppose that instead of going
the rank of the tuple is r, then its ________ is back a fixed number of tuples, we want the
defined as (r −1)/(n−1). window to consist of all prior years we use
a) N l() rows unbounded preceding.

www.studymaterialz.in 35
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

9. The func ons which construct histograms a ributes as measure a ributes, since they
and use buckets for ranking is measure some value, and can be aggregated
a) Rank() upon.Dimension a ribute define the
b) New l() dimensions on which measure a ributes, and
c) N l() summaries of measure a ributes, are
d) None of the men oned viewed.

Answer: c 3. The generaliza on of cross-tab which is


Explana on: For each tuple, n le(n) then represented visually is ____________ which
gives the number of the bucket in which it is is also called as data cube.
placed, with bucket numbers star ng with 1. a) Two dimensional cube
b) Mul dimensional cube
10. The command ________________ such c) N-dimensional cube
tables are available only within the d) Cuboid
transac on execu ng the query and are
dropped when the transac on finishes. Answer: a
a) Create table Explana on: Each cell in the cube is
b) Create temporary table iden fied for the values for the three
c) Create view dimensional a ributes.
d) Create label view
4. The process of viewing the cross-tab
Answer: b (Single dimensional) with a fixed value of one
Explana on: None. a ribute is
a) Slicing
b) Dicing
1. OLAP stands for c) Pivo ng
a) Online analy cal processing d) Both Slicing and Dicing
b) Online analysis processing
c) Online transac on processing Answer: a
d) Online aggregate processing Explana on: The slice opera on selects one
par cular dimension from a given cube and
Answer: a provides a new sub-cube. Dice selects two or
Explana on: OLAP is the manipula on of more dimensions from a given cube and
informa on to support decision making. provides a new sub-cube.
2. Data that can be modeled as dimension 5. The opera on of moving from finer-
a ributes and measure a ributes are called granularity data to a coarser granularity (by
_______ data. means of aggrega on) is called a ________
a) Mul dimensional a) Rollup
b) Singledimensional b) Drill down
c) Measured c) Dicing
d) Dimensional d) Pivo ng
Answer: a Answer: a
Explana on: Given a rela on used for data Explana on: The opposite opera on—that
analysis, we can iden fy some of its

www.studymaterialz.in 36
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

of moving fromcoarser-granularity data to b) 4


finer-granularity data—is called a drill down. c) 2
d) 1
6. In SQL the cross-tabs are created using
a) Slice Answer: b
b) Dice Explana on: { (item name, color, clothes
c) Pivot size), (item name, color), (item name), () }.
d) All of the men oned
10. Which one of the following is the right
Answer: a syntax for DECODE?
Explana on: Pivot (sum(quan ty) for color in a) DECODE (search, expression, result [,
(’dark’,’pastel’,’white’)). search, result]… [, default])
b) DECODE (expression, result [, search,
7. result]… [, default], search)
c) DECODE (search, result [, search, result]…
{ (item name, color, clothes size), (item
name, color), (item name, clothes size), [, default], expression)
(color, clothes size), (item name), (colo d) DECODE (expression, search, result [,
r), (clothes size), () } search, result]… [, default])

This can be achieved by using which of the Answer: d


following ? Explana on: None.
a) group by rollup
b) group by cubic
c) group by 1. Rela onal Algebra is a __________ query
d) none of the men oned language that takes two rela ons as input
and produces another rela on as an output
Answer: d of the query.
Explana on: ‘Group by cube’ is used . a) Rela onal
b) Structural
8. What do data warehouses support? c) Procedural
a) OLAP d) Fundamental
b) OLTP
c) OLAP and OLTP Answer: c
d) Opera onal databases Explana on: This language has fundamental
and other opera ons which are used on
Answer: a rela ons.
Explana on: None.
2. Which of the following is a fundamental
9. opera on in rela onal algebra?
SELECT item name, color, clothes SIZE, SU
a) Set intersec on
M(quantity) b) Natural join
FROM sales c) Assignment
GROUP BY rollup(item name, color, clothes d) None of the men oned
SIZE);
Answer: d
How many grouping is possible in this rollup?
Explana on: The fundamental opera ons are
a) 8

www.studymaterialz.in 37
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

select, project, union, set difference, Answer: d


Cartesian product, and rename. Explana on: Generaliza on Selec on takes
only one argument for opera on.
3. Which of the following is used to denote
the selec on opera on in rela onal algebra? 7. Which is a join condi on contains an
a) Pi (Greek) equality operator:
b) Sigma (Greek) a) Equijoins
c) Lambda (Greek) b) Cartesian
d) Omega (Greek) c) Natural
d) Le
Answer: b
Explana on: The select opera on selects Answer: a
tuples that sa sfy a given predicate. Explana on: None.

4. For select opera on the ________ appear 8. In precedence of set operators, the
in the subscript and the ___________ expression is evaluated from
argument appears in the paranthesis a er a) Le to le
the sigma. b) Le to right
a) Predicates, rela on c) Right to le
b) Rela on, Predicates d) From user specifica on
c) Opera on, Predicates
d) Rela on, Opera on Answer: b
Explana on: The expression is evaluated
Answer: a from le to right according to the
Explana on: None. precedence.

5. The ___________ opera on, denoted by −, 9. Which of the following is not outer join?
allows us to find tuples that are in one a) Le outer join
rela on but are not in another. b) Right outer join
a) Union c) Full outer join
b) Set-difference d) All of the men oned
c) Difference
d) Intersec on Answer: d
Explana on: The FULL OUTER JOIN keyword
Answer: b combines the result of both LEFT and RIGHT
Explana on: The expression r − s produces a joins.
rela on containing those tuples in r but not
in s. 10. The assignment operator is denoted by
a) ->
6. Which is a unary opera on: b) <-
a) Selec on opera on c) =
b) Primi ve opera on d) ==
c) Projec on opera on
d) Generalized selec on Answer: b
Explana on: The result of the expression to

www.studymaterialz.in 38
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

the right of the ← is assigned to the rela on d) Returns the building name of all the
variable on the le of the ←. departments

Answer: a
1. Find the ID, name, dept name, salary for Explana on: This query has two “there
instructors whose salary is greater than exists” clauses in our tuple-rela onal-calculus
$80,000 . expression, connected by and (∧).
a) {t | t ε instructor ∧ t[salary] > 80000}
b) Э t ∈ r (Q(t)) 4. Which of the following symbol is used in
c) {t | Э s ε instructor (t[ID] = s[ID]∧ s[salary] the place of except?
> 80000)} a) ^
d) None of the men oned b) V
c) ¬
Answer: a d) ~
Explana on: This expression is in tuple
rela onal format. Answer: c
Explana on: The query ¬P negates the value
2. A query in the tuple rela onal calculus is of P.
expressed as:
a) {t | P() | t} 5. “Find all students who have taken all
b) {P(t) | t } courses offered in the Biology department.”
c) {t | P(t)} The expressions that matches this sentence is
d) All of the men oned :
a) Э t ε r (Q(t))
Answer: c b) ∀ t ε r (Q(t))
Explana on: The tuple rela onal calculus, is c) ¬ t ε r (Q(t))
a nonprocedural query language. It describes d) ~ t ε r (Q(t))
the desired informa on without giving a
specific procedure for obtaining that Answer: b
informa on. Explana on: ∀ is used denote “for all” in
SQL.
3.
6. Which of the following is the comparison
{t | Э s ε instructor (t[name] = s[name] operator in tuple rela onal calculus
∧ Э u ε department (u[dept name] = s[dept
a) ⇒
name]
∧ u[building] = “Watson”))} b) =
c) ε
Which of the following best describes the d) All of the men oned
query?
a) Finds the names of all instructors whose Answer: b
department is in the Watson building Explana on: The comparison operators are
b) Finds the names of all department is in the (<, ≤, =, =, >, ≥).
Watson building
c) Finds the name of the dapartment whose 7. An expression in the domain rela onal
instructor and building is Watson calculus is of the form
a) {P(x1, x2, . . . , xn) | < x1, x2, . . . , xn > }

www.studymaterialz.in 39
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) {x1, x2, . . . , xn | < x1, x2, . . . , xn > } b) (P1(x)) Э x


c) { x1, x2, . . . , xn | x1, x2, . . . , xn} c) V x (P1(x))
d) {< x1, x2, . . . , xn > | P(x1, x2, . . . , xn)} d) Э x (P1(x))

Answer: d Answer: d
Explana on: Here x1, x2, . . . , xn represent Explana on:Э is used to denote “some”
domain variables. P represents a formula values in rela onal calculus.
composed of atoms, as was the case in the
tuple rela onal calculus. 10. A set of possible data values is called
a) A ribute
8. Find the names of all instructors in the b) Degree
Physics department together with the course c) Tuple
id of all courses they teach: d) Domain
a)
Answer: d
{< c > | Э s (< c, a, s, y, b, r, t >ε se Explana on: None.
ction

∧s = “Fall” ∧ y = “2009”

∨Эu (< c, a, s, y, b, r, t >ε section

∧s = “Spring” ∧ y = “2010” UNIT II DATABASE DESIGN


b) 1. An ________ is a set of en es of the
same type that share the same proper es, or
{< n, c > | Э i, a (< i, c, a, s, y > ε t
eaches a ributes.
a) En ty set
∧ Э d, s (< i, n, d, s > ε instructor ∧ d b) A ribute set
= “Physics”))} c) Rela on set
d) En ty model
c)

{< n > | Э i, d, s (< i, n, d, s > ε inst Answer: a


ructor ∧ s > 80000)} Explana on: An en ty is a “thing” or
“object” in the real world that is
d) dis nguishable from all other objects.
{< i, n, d, s > | < i, n, d, s > ε instru 2. En ty is a _________
ctor ∧ s > 80000}
a) Object of rela on
Answer: b b) Present working model
Explana on: None. c) Thing in real world
d) Model of rela on

Answer: c
9. In domain relaional calculus “there exist” Explana on: For example, each person in a
can be expressed as university is an en ty.
a) (P1(x))

www.studymaterialz.in 40
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

3. The descrip ve property possessed by Answer: d


each en ty set is _________ Explana on: The value for this type of
a) En ty a ribute can be derived from the values of
b) A ribute other related a ributes or en es.
c) Rela on
d) Model 7. Not applicable condi on can be
represented in rela on entry as
Answer: b a) NA
Explana on: Possible a ributes of the b) 0
instructor en ty set are ID, name, dept c) NULL
name, and salary. d) Blank Space

4. The func on that an en ty plays in a Answer: c


rela onship is called that en ty’s Explana on: NULL always represents that
_____________ the value is not present.
a) Par cipa on
b) Posi on 8. Which of the following can be a
c) Role mul valued a ribute?
d) Instance a) Phone_number
b) Name
Answer: c c) Date_of_birth
Explana on: A rela onship is an associa on d) All of the men oned
among several en es.
Answer: a
5. The a ribute name could be structured as Explana on: Name and Date_of_birth
an a ribute consis ng of first name, middle cannot hold more than 1 value.
ini al, and last name. This type of a ribute is
called 9. Which of the following is a single valued
a) Simple a ribute a ribute
b) Composite a ribute a) Register_number
c) Mul valued a ribute b) Address
d) Derived a ribute c) SUBJECT_TAKEN
d) Reference
Answer: b
Explana on: Composite a ributes can be Answer: a
divided into subparts (that is, other Explana on: None.
a ributes).
10. In a rela on between the en es the
6. The a ribute AGE is calculated from type and condi on of the rela on should be
DATE_OF_BIRTH. The a ribute AGE is specified. That is called as______a ribute.
a) Single valued a) Descip ve
b) Mul valued b) Derived
c) Composite c) Recursive
d) Derived d) Rela ve

www.studymaterialz.in 41
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a Answer: d
Explana on: Consider the en ty sets student Explana on: Here more than one en ty in
and sec on, which par cipate in a one set is related to one one en ty in other
rela onship set takes. We may wish to store set.
a descrip ve a ribute grade with the
rela onship to record the grade that a 4. Data integrity constraints are used to:
student got in the class. a) Control who is allowed access to the data
b) Ensure that duplicate records are not
The En ty-Rela onship Model entered into the table
c) Improve the quality of data entered for a
specific property
1. _____________ express the number of d) Prevent users from changing the values
en es to which another en ty can be stored in the table
associated via a rela onship set.
a) Mapping Cardinality Answer: c
b) Rela onal Cardinality Explana on: The data entered will be in a
c) Par cipa on Constraints par cular cell (i.e., table column).
d) None of the men oned
5. Establishing limits on allowable property
Answer: a values, and specifying a set of acceptable,
Explana on: Mapping cardinality is also predefined op ons that can be assigned to a
called as cardinality ra o. property are examples of:
a) A ributes
2. An en ty in A is associated with at most b) Data integrity constraints
one en ty in B, and an en ty in B is c) Method constraints
associated with at most one en ty in A.This is d) Referen al integrity constraints
called as
a) One-to-many Answer: b
b) One-to-one Explana on: Only par cular value sa sfying
c) Many-to-many the constraints are entered in the column.
d) Many-to-one
6. Which of the following can be addressed
Answer: b by enforcing a referen al integrity
Explana on: Here one en ty in one set is constraint?
related to one one en ty in other set. a) All phone numbers must include the area
code
3. An en ty in A is associated with at most b) Certain fields are required (such as the
one en ty in B. An en ty in B, however, can email address, or phone number) before the
be associated with any number (zero or record is accepted
more) of en es in A. c) Informa on on the customer must be
a) One-to-many known before anything can be sold to that
b) One-to-one customer
c) Many-to-many d) Then entering an order quan ty, the user
d) Many-to-one must input a number and not some text (i.e.,
12 rather than ‘a dozen’)

www.studymaterialz.in 42
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: c restrict entries in the rela on.


Explana on: None.

7. ______ is a special type of integrity 1. Which of the following gives a logical


constraint that relates two rela ons & structure of the database graphically?
maintains consistency across the rela ons. a) En ty-rela onship diagram
a) En ty Integrity Constraints b) En ty diagram
b) Referen al Integrity Constraints c) Database diagram
c) Domain Integrity Constraints d) Architectural representa on
d) Domain Constraints
Answer: a
Answer: b Explana on: E-R diagrams are simple and
Explana on: None. clear—quali es that may well account in
large part for the widespread use of the E-R
8. Which one of the following uniquely model.
iden fies the elements in the rela on?
a) Secondary Key 2. The en ty rela onship set is represented
b) Primary key in E-R diagram as
c) Foreign key a) Double diamonds
d) Composite key b) Undivided rectangles
c) Dashed lines
Answer: b d) Diamond
Explana on: Primary key checks for not null
and uniqueness constraint. Answer: d
Explana on: Dashed lines link a ributes of a
9. Drop Table cannot be used to drop a table rela onship set to the rela onship set.
referenced by a _________ constraint.
a) Local Key 3. The Rectangles divided into two parts
b) Primary Key represents
c) Composite Key a) En ty set
d) Foreign Key b) Rela onship set
c) A ributes of a rela onship set
Answer: d d) Primary key
Explana on: Foreign key is used when
primary key of one rela on is used in another Answer: a
rela on. Explana on: The first part of the rectangle,
contains the name of the en ty set. The
10. ____________ is preferred method for second part contains the names of all the
enforcing data integrity a ributes of the en ty set.
a) Constraints
b) Stored Procedure 4. Consider a directed line(->) from the
c) Triggers rela onship set advisor to both en ty sets
d) Cursors instructor and student. This indicates
_________ cardinality
Answer: a a) One to many
Explana on: Constraints are specified to b) One to one

www.studymaterialz.in 43
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Many to many iden fying en ty set is said to own the weak


d) Many to one en ty set that it iden fies. It is also called as
owner en ty set.
Answer: b
Explana on: This indicates that an instructor 8. Weak en ty set is represented as
may advise at most one student, and a a) Underline
student may have at most one advisor. b) Double line
c) Double diamond
5. We indicate roles in E-R diagrams by d) Double rectangle
labeling the lines that connect ___________
to __________ Answer: c
a) Diamond , diamond Explana on: An en ty set that has a primary
b) Rectangle, diamond key is termed a strong en ty set.
c) Rectangle, rectangle
d) Diamond, rectangle 9. If you were collec ng and storing
informa on about your music collec on, an
Answer: d album would be considered a(n) _____
Explana on: Diamond represents a a) Rela on
rela onship set and rectangle represents a b) En ty
en ty set. c) Instance
d) A ribute
6. An en ty set that does not have sufficient
a ributes to form a primary key is termed a Answer: b
__________ Explana on: An en ty set is a logical
a) Strong en ty set container for instances of an en ty type and
b) Variant set instances of any type derived from that en ty
c) Weak en ty set type.
d) Variable set
10. What term is used to refer to a specific
Answer: c record in your music database; for instance;
Explana on: An en ty set that has a primary informa on stored about a specific album?
key is termed a strong en ty set. a) Rela on
b) Instance
7. For a weak en ty set to be meaningful, it c) Table
must be associated with another en ty set, d) Column
called the
a) Iden fying set Answer: b
b) Owner set Explana on: The environment of database is
c) Neighbour set said to be an instance. A database instance or
d) Strong en ty set an ‘instance’ is made up of the background
processes needed by the database.
Answer: a
Explana on: Every weak en ty must be
associated with an iden fying en ty; that is, Consider the following rela onal schemas
the weak en ty set is said to be existence and answer the ques ons below
dependent on the iden fying en ty set. The

www.studymaterialz.in 44
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

The sec on rela on b) 1001


c) None
Course_id Sec_id Semester Year Building d) Error message appears
BIO-101 1 Spring 2010 Painter
CS-102 4 Summer 2009 Packyard Answer: d
Explana on: The value CS-101 matches the
EE-201 3 Fall 2010 Watson Course_id but not Id.
FIN-301 1 Spring 2011 Richard
4.
The teaches rela on
SELECT Id, Course_id, Building FROM SECTI
ON s AND teaches t WHERE t.year=2009;
Id Course_id Sec_id Semester Year
1001 CS-101 1 Fall 2009 Which of the following Id are displayed?
1002 EE-201 2 Spring 2010 a) 1003
1003 FIN-301 3 Fall 2009 b) 1001
c) Both 1003 and 1001
1004 BIO-101 1 Summer 2011
d) Error message appears
1. Which one of the following can be treated
Answer: c
as a primary key in teaches rela on?
Explana on: Two rows are select in the
a) Id
above query.
b) Semester
c) Sec_id 5. The query which selects the Course_id ‘CS-
d) Year 101’ from the sec on rela on is
a) Select Course_id from sec on where
Answer: a Building = ‘Richard’;
Explana on: Here Id is the only a ribute that
b) Select Course_id from sec on where Year
has to have a unique entry.
= ‘2009’;
c) Select Course_id from teaches where
2. The primary key in the sec on rela on is
Building = ‘Packyard’;
a) Course_id
d) Select Course_id from sec on where
b) Sec_id
Sec_id = ‘3’;
c) Both Course_id and Sec_id
d) All the a ributes Answer: b
Explana on: The year ‘2009’ should be
Answer: c
Explana on: Both the entries has unique selected from the sec on rela on.
entry.
6.
3. CREATE TABLE SECTION
(Course_id VARCHAR (8),
SELECT * FROM teaches WHERE Sec_id = 'CS- Sec_id VARCHAR (8),
101'; Semester VARCHAR (6),
YEAR NUMERIC (4,0),
Which of the following Id is selected for the Building NUMERIC (15),
following query? PRIMARY KEY (course id, sec id, semester,
YEAR),
a) 1003

www.studymaterialz.in 45
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

FOREIGN KEY (course id) REFERENCES course Answer: a


);
Explana on: There are two tuples with the
year is 2009.
Which of the following has an error in the
above create table for the rela on sec on
10. The rela on changes can be got back
a) Primary key (course id, sec id, semester, using ________ command
year) a) Flashback
b) Foreign key (course id) references course
b) Purge
c) Year numeric (4,0) c) Delete
d) Building numeric (15)
d) Getback
Answer: d Answer: a
Explana on: It should be replaced by Year Explana on: Purge deletes the table and
Building varchar (15).
delete cleans the table entry.
7. The rela on with primary key can be
created using 1. Let us consider phone_number ,which can
a) Create table instructor (Id, Name) take single or several values . Trea ng
b) Create table instructor (Id, Name, primary phone_numberas an _________ permits
key(name)) instructors to have several phone numbers
c) Create table instructor (Id, Name, primary (including zero) associated with them.
key (Id)) a) En ty
d) Create table instructor ( Id unique, Name ) b) A ribute
c) Rela on
Answer: c
d) Value
Explana on: The value Name cannot be a
primary key. Answer: a
Explana on: Trea ng a phone as an a ribute
8. How can the values in the rela on teaches
phone_number implies that instructors have
be deleted?
precisely one phone number each.
a) Drop table teaches;
b) Delete from teaches; 2. The total par cipa on by en es is
c) Purge table teaches; represented in E-R diagram as
d) Delete from teaches where Id =’Null’; a) Dashed line
b) Double line
Answer: b
c) Double rectangle
Explana on: Delete table cleans the entry
d) Circle
from the table.
Answer: b
9. In the above teaches rela on ” Select *
Explana on: It is used to represent the
from teaches where Year = ‘2010’” displays
rela on between several a ributes.
how many rows?
a) 2 3. Given the basic ER and rela onal models,
b) 4 which of the following is INCORRECT?
c) 5 a) An a ribute of an en ty can have more
d) 1 than one value

www.studymaterialz.in 46
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) An a ribute of an en ty can be composite two a ributes.


c) In a row of a rela onal table, an a ribute
can have more than one value 7. Which of the following is a low level
d) In a row of a rela onal table, an a ribute operator?
can have exactly one value or a NULL value a) Insert
b) Update
Answer: c c) Delete
Explana on: It is possible to have several d) Directory
values for a single a ribute provide it is a
mul -valued a ribute. Answer: d
Explana on: Directory is a low level to word
4. Which of the following indicates the on in file system.
maximum number of en es that can be
involved in a rela onship? 8. Key to represent rela onship between
a) Minimum cardinality tables is called
b) Maximum cardinality a) Primary key
c) ERD b) Secondary Key
d) Greater En ty Count c) Foreign Key
d) None of the men oned
Answer: b
Explana on: In SQL (Structured Query Answer: c
Language), the term cardinality refers to the Explana on: Primary key of one rela on
uniqueness of data values contained in a used as an a ribute in another rela on is
par cular column (a ribute) of a database called foreign key.
table.
9. A window into a por on of a database is
5. In E-R diagram generaliza on is a) Schema
represented by b) View
a) Ellipse c) Query
b) Dashed ellipse d) Data dic onary
c) Rectangle
d) Triangle Answer: b
Explana on: View is a logical por on of a
Answer: d database which is needed by some users.
Explana on: Ellipse represents a ributes,
rectangle represents en ty. 10. A primary key is combined with a foreign
key creates
6. What is a rela onship called when it is a) Parent-Child rela on ship between the
maintained between two en es? tables that connect them
a) Unary b) Many to many rela onship between the
b) Binary tables that connect them
c) Ternary c) Network model between the tables that
d) Quaternary connect them
d) None of the men oned
Answer: b
Explana on: Binary word usually represents

www.studymaterialz.in 47
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a Answer: c
Explana on: Using the two rela onships Explana on: The design process may also
mother and father provides us a record of a proceed in a bo om-up manner, in which
child’s mother, even if we are not aware of mul ple en ty sets are synthesized into a
the father’s iden ty; a null value would be higher-level en ty set on the basis of
required if the ternary rela onship parent is common features.
used. Using binary rela onship sets is
preferable in this case. 4. There are similari es between the
instructor en ty set and the secretary en ty
set in the sense that they have several
1. The en ty set person is classified as a ributes that are conceptually the same
student and employee. This process is called across the two en ty sets: namely, the
_________ iden fier, name, and salary a ributes. This
a) Generaliza on process is called
b) Specializa on a) Commonality
c) Inheritance b) Specializa on
d) Constraint generaliza on c) Generaliza on
d) Similarity
Answer: b
Explana on: The process of designa ng Answer: c
subgroupings within an en ty set is called Explana on: Generaliza on is used to
specializa on. emphasize the similari es among lower-level
en ty sets and to hide the differences.
2. Which rela onship is used to represent a
specializa on en ty? 5. If an en ty set is a lower-level en ty set in
a) ISA more than one ISA rela onship, then the
b) AIS en ty set has
c) ONIS a) Hierarchy
d) WHOIS b) Mul level inheritance
c) Single inheritance
Answer: a d) Mul ple inheritance
Explana on: In terms of an E-R diagram,
specializa on is depicted by a hollow arrow- Answer: d
head poin ng from the specialized en ty to Explana on: The a ributes of the higher-
the other en ty. level en ty sets are said to be inherited by
the lower-level en ty sets.
3. The refinement from an ini al en ty set
into successive levels of en ty subgroupings 6. A _____________ constraint requires that
represents a ________ design process in an en ty belong to no more than one lower-
which dis nc ons are made explicit. level en ty set.
a) Hierarchy a) Disjointness
b) Bo om-up b) Uniqueness
c) Top-down c) Special
d) Radical d) Rela onal

www.studymaterialz.in 48
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a Answer: a
Explana on: For example, student en ty can Explana on: The subclasses are combined to
sa sfy only one condi on for the student form the superclass.
type a ribute; an en ty can be either a
graduate student or an undergraduate 10. Which of the following is another name
student, but cannot be both. for a weak en ty?
a) Child
7. Consider the employee work-team b) Owner
example, and assume that certain employees c) Dominant
par cipate in more than one work team. A d) All of the men oned
given employee may therefore appear in
more than one of the team en ty sets that Answer: a
are lower level en ty sets of employee. Thus, Explana on: A parent may be called as a
the generaliza on is _____________ strong en ty.
a) Overlapping
b) Disjointness
c) Uniqueness SQL data defini on for part of the university
d) Rela onal database.

CREATE TABLE department


Answer: a (dept_name VARCHAR (20),
Explana on: In overlapping generaliza ons, building VARCHAR (15),
the same en ty may belong to more than budget NUMBER,
PRIMARY KEY (dept_name));
one lower-level en ty set within a single
generaliza on. CREATE TABLE course
(course_id VARCHAR (7),
8. The completeness constraint may be one title VARCHAR (50),
of the following: Total generaliza on or dept_name VARCHAR (20),
credits NUMERIC (2,0),
specializa on, Par al generaliza on or PRIMARY KEY (course_id),
specializa on. Which is the default? FOREIGN KEY (dept_name) __________ depart
a) Total ment);
b) Par al
CREATE TABLE instructor
c) Should be specified (ID VARCHAR (5),
d) Cannot be determined name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
Answer: b salary NUMERIC (8,2),
FOREIGN KEY (dept_name) _______ departmen
Explana on: Par al generaliza on or t);
specializa on – Some higher-level en es
may not belong to any lower-level en ty set. CREATE TABLE SECTION
(course_id VARCHAR (8),
9. Func onal dependencies are a sec_id VARCHAR (8),
semester VARCHAR (6),
generaliza on of YEAR NUMERIC (4,0),
a) Key dependencies building VARCHAR (15),
b) Rela on dependencies room_number VARCHAR (7),
time_slot id VARCHAR (4),
c) Database dependencies
PRIMARY KEY (course_id, sec_id, semester,
d) None of the men oned YEAR),
FOREIGN KEY (_______) ______ course);

www.studymaterialz.in 49
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: b
CREATE TABLE teaches
Explana on: By specifying not null the value
(ID VARCHAR (5),
course_id VARCHAR (8), cannot be le blank.
sec_id VARCHAR (8),
semester VARCHAR (6), 4. In the above DDL command the foreign key
YEAR NUMERIC (4,0), entries are got by using the keyword
PRIMARY KEY (ID, course_id, sec_id, semes
ter, YEAR), a) References
FOREIGN KEY (course_id, sec_id, semester, b) Key reference
YEAR) REFERENCES SECTION, c) Rela ng
FOREIGN KEY (ID) _______ instructor); d) None of the men oned
Answer ques ons based on the above Answer: a
commands Explana on: References (table_name) give
the prior table name for the entry.
1. Which is the main rela on which is used in
the university database which is referenced 5. Iden fy the error in the sec on rela on
by all other rela on of the university? a) No error
a) Teaches b) Year numeric (4,0)
b) Course c) Building varchar (15)
c) Department d) Sec_id varchar (8)
d) Sec on
Answer: a
Answer: c Explana on: The building and the sec_id
Explana on: Department is the only rela on have varchar values and year is of numeric
which forms the main part of the university type. So no such errors are found in the
database. rela on.
2. The department rela on has the an entry 6. The following entry is given in to the
budget whose type has to be replaced by instructor rela on .
a) Varchar (20)
b) Varchar2 (20) (100202,Drake,Biology,30000)
c) Numeric (12,2)
d) Numeric Iden fy the output of the query given
a) Row(s) inserted
Answer: c b) Error in ID of insert
Explana on: Department is the only rela on c) Error in Name of insert
which forms the main part of the university d) Error in Salary of the insert
database.
Answer: b
3. In the course rela on, the tle field should Explana on: The varchar(5) value cannot
throw an error in case of any missing tle. hold the entry 100202.
The command to be added in tle is
a) Unique 7. Which of the following can be used as a
b) Not null primary key entry of the instructor rela on.
c) 0 a) DEPT_NAME
d) Null b) NAME

www.studymaterialz.in 50
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) ID
This set of Database Ques ons & Answers
d) All of the men oned
focuses on “Querying database part-1 DML”
Answer: c
The instructor rela on
Explana on: The value ID can only be
primary key unlike dept_name which is used ID Name Dept_name Salary
as a foreign key. 10101 Hayley Comp.Sci. 65000
12121 Jackson Finance 90000
8. In the sec on rela on which of the
15151 Nathan Music 87000
following is used as a foreign key?
a) Course_id 22222 April Biology 73000
b) Course_id,sec_id 34345 Crick Comp.Sci. 100000
c) Room_number
d) Course_id,sec_id,room_number The course rela on
Course_id Title Dept_name Credits
Answer: a
CS-101 Robo cs Comp.Sci. 5
Explana on: Course_id is the only field
which is present in the course rela on. BIO-244 Gene cs Biology 4
Physical
PHY-333 Physics 3
9. In order to include an a ribute Name to Principles
the teaches rela on which of the following Music Video
command is used? MUS-562 Music 2
Produc on
a) Alter table teaches include Name;
Investment
b) Alter table teaches add Name; FIN-101 Finance 3
Banking
c) Alter table teaches add Name varchar;
d) Alter table teaches add Name varchar(20);
Answer the ques ons based on the above
rela ons
Answer: d
Explana on: The form of the alter table
1. Which of the following command is used
command is
to display the departments of the instructor
alter table r add AD;
rela on?
where r is the name of an exis ng rela on, A
a) Select * from instructor where Dept_name
is the name of the a ribute to be added, and = Finance;
D is the type of the added a ribute.
b) Select * from instructor ;
10. To replace the rela on sec on with some c) Select dept_name from instructor;
d) Select dept_name for instructor where
other rela on the ini al step to be carried
Name=Jackson;
out is
a) Delete sec on;
Answer: c
b) Drop sec on;
Explana on: Only one field is necessary for
c) Delete from sec on; the query and where clause is not needed for
d) Replace sec on new_table ;
the selec on.
Answer: b 2. How can we select the elements which
Explana on: Droping the table drops all the have common Dept_name in both the
references to that table.
rela on ?

www.studymaterialz.in 51
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Select * from instructor i , course c where has to be performed on the instructor


i.Dept_name=c.Dept_name; rela on ?
b) Select Dept name from instructor ,Course ; a) Delete Dept_name=Music in instructor;
c) Select * from instructor i , course c ; b) Delete from instructor where
d) Select Dept_name from instructor where Dept_name=Music;
Dept_name = NULL; c) Remove Dept_name= Music
d) All of the men oned
Answer: a
Explana on: Here only the common Answer: b
elements are displayed . Explana on: Delete from table_name where
condi on .
3. Select dis nct Dept_name from instructor ;
How many row(s) are displayed ? 6.
a) 4
b) 3 SELECT DISTINCT T.name
FROM instructor AS T, instructor AS S
c) 5 WHERE T.salary > S.salary AND S.dept name
d) Error = ’Comp.Sci.’;

Answer: a What will be displayed as the value of name


Explana on: Dis nct keyword eliminates the for the above query?
the common Dept_name . a) Hayley
b) Jackson
4. Suppose the Authority want to include a c) Hayley and Crick
new instructor for the tle Neuroscience d) Crick
what command should be inserted ?
a) Insert into instructor Answer: d
values(12111,Emma,NeuroScience,200000); Explana on: Only the greatest salary in
b) Insert into course Comp.Sci dept is selected for the query.
values(12111,Introduc on,NeuroScience,2);
c) 7.

Insert into instructor values(12111,Emma, SELECT Name


Biology,200000); FROM instructor
WHERE salary > SOME (SELECT salary FROM i
Insert into course values(BIO-112,Intr nstructor WHERE dept_name = 'Comp.Sci.');
oduction to Neuro Science,NeuroScience,
2); How many rows are selected ?
a) 3
d) Insert into course b) 4
values(12111,Emma,NeuroScience,200000); c) 2
d) 1
Answer: c
Explana on: The values have to be inserted Answer: d
into both the rela ons to be intact . Explana on: This displays the names of
instructors with salary greater than that of
5. If a person all the people in Music
some (at least one) instructor in the Biology
department gets fired which of the following department .

www.studymaterialz.in 52
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

8. How will you select the Names whose first Answer: a


le er is E ? Explana on: Max is used to find the highest
a) element and Min is used to find the lowest
element.
SELECT Name
FROM instructor
WHERE Name LIKE ’A%;
1. A domain is ______ if elements of the
b) domain are considered to be indivisible units.
a) Atomic
SELECT Name b) Subatomic
FROM course c) Substructure
WHERE Name LIKE ’A%;
d) Subset
c)
Answer: a
SELECT Dept_name Explana on: A set of names is an example of
FROM instructor a nonatomic value.
WHERE Name LIKE ’A%;
2. Iden fy the composite a ributes
d) a) Salary
SELECT Name
b) Credits
FROM instructor c) Sec on_id
WHERE Dept_name LIKE ’A%; d) None of the men oned
Answer: a Answer: d
Explana on: % is used to indicate that some Explana on: Composite a ributes, such as
characters may appear . an a ribute address with component
a ributes street, city, state, and zip have
nonatomic domains.
9. Which func on is used to find the count of 3. Consider the rela on given below and ind
dis nct departments? the maximum normal form applicable to
a) Dist them
b) Dis nct
c) Count i. R(A, B) WITH productions { A --> B }
d) Count,Dist ii. R(A, B) WITH productions { B --> A }
iii. R(A, B) WITH productions {A —> B, B
--> A }
Answer: a iv. R(A, B, C) WITH productions {A -->B,
Explana on: Count (dis nct ID) is the correct B --> A, AB --> C }
usage.
a) i, ii and iii are in 3NF and iv is in BCNF
10. Which func on is used to iden fy the b) i and ii are in BCNF and iii and iv are in 3NF
tle with Least scope? c) All are in 3NF
a) Min(Credits) d) All are in BCNF
b) Max(Credits)
c) Min( tle) Answer: d
d) Min(Salary) Explana on: One of the more desirable

www.studymaterialz.in 53
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

normal forms that we can obtain is Boyce– 7. If an a ribute of a composite key is


Codd normal form (BCNF). It eliminates all dependent on an a ribute of the other
redundancy that can be discovered based on composite key, a normaliza on called _____
func onal dependencies. is needed.
a) DKNF
4. Which one is based on mul -valued b) BCNF
dependency: c) Fourth
a) First d) Third
b) Second
c) Third Answer: b
d) Fourth Explana on: BCNF eliminates all redundancy
that can be discovered based on func onal
Answer: d dependencies.
Explana on: One of the more desirable
normal forms that we can obtain is Boyce– 8. The term for informa on that describes
Codd normal form (BCNF). It eliminates all what type of data is available in a database
redundancy that can be discovered based on is:
func onal dependencies. a) Data dic onary
b) data repository
5. If a rela on is in BCNF, then it is also in c) Index data
a) 1 NF d) Metadata
b) 2 NF
c) 3 NF Answer: d
d) All of the men oned Explana on: Meta data is generally data
about a data.
Answer: d
Explana on: Third normal form (3NF) relaxes 9. A data type that creates unique numbers
this constraint slightly by allowing certain for key columns in Microso Access is:
nontrivial func onaldependencieswhose le a) Autonumber
side is not a superkey. b) Boolean
c) Sequen al key
6. If every non-key a ribute is func onally d) Sequen al number
dependent primary key, then the rela on will
be in Answer: a
a) First normal form Explana on: This can be taken as a primary
b) Second normal form key.
c) Third form
d) Fourth normal form 10. A dependency exist between two
columns when
Answer: b a) Together they cons tute a composite key
Explana on: Third normal form (3NF) relaxes for the table
this constraint slightly by allowing certain b) Knowing the value in one column
nontrivial func onaldependencieswhose le determines the value stored in another
side is not a superkey. column
c) The table is in 3NF
d) Together they cons tute a foreign key

www.studymaterialz.in 54
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a Answer: a
Explana on: Given a set F of func onal Explana on: The rela on in second normal
dependencies on a schema, we can prove form is also in first normal form and no
that certain other func onal dependencies par al dependencies on any column in
also hold on the schema. primary key.

4. Which-one o he following statements


about normal forms is FALSE?
a) BCNF is stricter than 3 NF
b) Lossless, dependency -preserving
UNIT III TRANSACTIONS decomposi on into 3 NF is always possible
c) Loss less, dependency – preserving
1. In the __________ normal form, a decomposi on into BCNF is always possible
composite a ribute is converted to individual d) Any rela on with two a ributes is BCNF
a ributes.
a) First Answer: c
b) Second Explana on: We say that the decomposi on
c) Third is a lossless decomposi on if there is no loss
d) Fourth of informa on by replacing r (R) with two
rela on schemas r1(R1) andr2(R2).
Answer: a
Explana on: The first normal form is used to 5. Func onal Dependencies are the types of
eliminate the duplicate informa on. constraints that are based on______
a) Key
2. A table on the many side of a one to many b) Key revisited
or many to many rela onship must: c) Superset key
a) Be in Second Normal Form (2NF) d) None of the men oned
b) Be in Third Normal Form (3NF)
c) Have a single a ribute key Answer: a
d) Have a composite key Explana on: Key is the basic element needed
for the constraints.
Answer: d
Explana on: The rela on in second normal 6. Which is a bo om-up approach to
form is also in first normal form and no database design that design by examining the
par al dependencies on any column in rela onship between a ributes:
primary key. a) Func onal dependency
b) Database modeling
3. Tables in second normal form (2NF): c) Normaliza on
a) Eliminate all hidden dependencies d) Decomposi on
b) Eliminate the possibility of a inser on
anomalies Answer: c
c) Have a composite key Explana on: Normalisa on is the process of
d) Have all non key fields depend on the removing redundancy and unwanted data.
whole primary key
7. Which forms simplifies and ensures that
there are minimal data aggregates and

www.studymaterialz.in 55
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

repe ve groups: b) 2 NF and hence also in 1 NF


a) 1NF c) 3NF and hence also in 2NF and 1NF
b) 2NF d) BCNF and hence also in 3NF, 2NF and 1NF
c) 3NF
d) All of the men oned Answer: b
Explana on: The rela on in second normal
Answer: c form is also in first normal form and no
Explana on: The first normal form is used to par al dependencies on any column in
eliminate the duplicate informa on. primary key.

8. Which forms has a rela on that possesses


data about an individual en ty: 1. We can use the following three rules to
a) 2NF find logically implied func onal
b) 3NF dependencies. This collec on of rules is
c) 4NF called
d) 5NF a) Axioms
b) Armstrong’s axioms
Answer: c c) Armstrong
Explana on: A Table is in 4NF if and only if, d) Closure
for every one of its non-trivial mul valued
dependencies X \twoheadrightarrow Y, X is a Answer: b
superkey—that is, X is either a candidate key Explana on: By applying these rules
or a superset thereof. repeatedly, we can find all of F+, given F.

9. Which forms are based on the concept of 2. Which of the following is not Armstrong’s
func onal dependency: Axiom?
a) 1NF a) Reflexivity rule
b) 2NF b) Transi vity rule
c) 3NF c) Pseudotransi vity rule
d) 4NF d) Augmenta on rule

Answer: c Answer: c
Explana on: The table is in 3NF if every non- Explana on: It is possible to use Armstrong’s
prime a ribute of R is non-transi vely axioms to prove that Pseudotransi vity rule
dependent (i.e. directly dependent) on every is sound.
superkey of R.
3. The rela on
10. employee(ID,name,street,Credit,street,city,sala
is decomposed into
Empdt1(empcode, name, street, city, stat
e, pincode). employee1 (ID, name)
employee2 (name, street, city, salary)
For any pincode, there is only one city and
state. Also, for given street, city and state, This type of decomposi on is called
there is just one pincode. In normaliza on a) Lossless decomposi on
terms, empdt1 is a rela on in b) Lossless-join decomposi on
a) 1 NF only

www.studymaterialz.in 56
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) All of the men oned c) 10


d) None of the men oned d) 12

Answer: d Answer: c
Explana on: Lossy-join decomposi on is the Explana on: A superkey is a combina on of
decomposi on used here . columns that uniquely iden fies any row
within a rela onal database management
4. Inst_dept (ID, name, salary, dept name, system (RDBMS) table.
building, budget) is decomposed into
7. Suppose we wish to find the ID’s of the
instructor (ID, name, dept name, salary) employees that are managed by people who
department (dept name, building, budget)
are managed by the employee with ID 123.
This comes under Here are two possible queries:
a) Lossy-join decomposi on
I.SELECT ee.empID
b) Lossy decomposi on FROM Emps ee, Emps ff
c) Lossless-join decomposi on WHERE ee.mgrID = ff.empID AND ff.mgrID
d) Both Lossy and Lossy-join decomposi on = 123;
II.SELECT empID
FROM Emps
Answer: d WHERE mgrID IN
Explana on: Lossy-join decomposi on is the (SELECT empID FROM Emps WHERE mgrID = 1
decomposi on used here . 23);

5. There are two func onal dependencies Which, if any, of the two queries above will
with the same set of a ributes on the le correctly (in SQL2) get the desired set of
side of the arrow: employee ID’s?
A->BC a) Both I and II
A->B b) I only
This can be combined as c) II only
a) A->BC d) Neither I nor I
b) A->B
c) B->C Answer: a
d) None of the men oned Explana on: The query can be sa sfied by
any of the two op ons.
Answer: a
Explana on: This can be computed as the 8. Suppose rela on R(A,B) currently has
canonical cover. tuples {(1,2), (1,3), (3,4)} and rela on S(B,C)
currently has {(2,5), (4,6), (7,8)}. Then the
6. Consider a rela on R(A,B,C,D,E) with the number of tuples in the result of the SQL
following func onal dependencies: query:

ABC -> DE and <i>SELECT *


FROM R NATURAL OUTER JOIN S; </i>
D -> AB IS:

The number of superkeys of R is: a) 2


a) 2 b) 4
b) 7

www.studymaterialz.in 57
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) 6 Answer: c
d) None of the men oned Explana on: Here the keys are not formed
by B and C.
Answer: a
Explana on: The SQL NATURAL JOIN is a type
of EQUI JOIN and is structured in such a way 1. A rela on is in ____________ if an
that, columns with same name of associate a ribute of a composite key is dependent on
tables will appear once only. an a ribute of other composite key.
a) 2NF
9. Suppose now that R(A,B) and S(A,B) are b) 3NF
two rela ons with r and s tuples, respec vely c) BCNF
(again, not necessarily dis nct). If m is the d) 1NF
number of (not necessarily dis nct) tuples in
the result of the SQL query: Answer: b
Explana on: A rela on is in 3 NF if an
R intersect S; a ribute of a composite key is dependent on
an a ribute of other composite key. (If an
Then which of the following is the most
a ribute of a composite key is dependent on
restric ve, correct condi on on the value of
an a ribute of other composite key then the
m?
rela on is not in BCNF, hence it has to be
a) m = min(r,s)
decomposed.).
b) 0 <= m <= r + s
c) min(r,s) <= m <= max(r,s) 2. What are the desirable proper es of a
d) 0 <= m <= min(r,s) decomposi on
a) Par on constraint
Answer: d
b) Dependency preserva on
Explana on: The value of m must lie
c) Redundancy
between the min value of r and s and 0.
d) Security
10. Suppose rela on R(A,B,C,D,E) has the
Answer: b
following func onal dependencies:
Explana on: Lossless join and dependency
A -> B preserving are the two goals of the
decomposi on.
B -> C
3. R (A,B,C,D) is a rela on. Which of the
BC -> A
following does not have a lossless join
A -> D dependency preserving BCNF
decomposi on?
E -> A a) A->B, B->CD
D -> E b) A->B, B->C, C->D
c) AB->C, C->AD
Which of the following is not a key? d) A->BCD
a) A
b) E Answer: d
c) B, C Explana on: This rela on gives a rela on
d) D without any loss in the values.

www.studymaterialz.in 58
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

4. c) Unique
d) Both Null and Unique
Class (course id, title, dept name, credi
ts, sec id, semester, YEAR, building, roo
m NUMBER, capacity, TIME slot id)
Answer: d
The SET OF functional dependencies that w Explana on: Primary key contains both
e require TO hold ON class are: unique and not null constraints.
course id->title, dept name, credits
building, room number->capacity 7. Which normal form is considered
course id, sec id, semester, year->buildi
ng, room NUMBER, TIME slot id adequate for normal rela onal database
A candidate KEY FOR this schema IS {cours design?
e id, sec id, semester, YEAR} a) 2NF
b) 5NF
Consider the above condi ons. Which of the c) 4NF
following rela on holds? d) 3NF
a) Course id-> tle, dept name, credits
b) Title-> dept name, credits Answer: d
c) Dept name-> credits Explana on: A rela onal database table is
d) Cannot be determined o en described as “normalized” if it is in the
Third Normal Form because most of the 3NF
Answer: a tables are free of inser on, update, and
Explana on: Here course id is not a dele on anomalies.
superkey. Thus, class is not in BCNF.
8. Rela on R with an associated set of
5. The algorithm that takes a set of func onal dependencies, F, is decomposed
dependencies and adds one schema at a into BCNF. The redundancy (arising out of
me, instead of decomposing the ini al func onal dependencies) in the resul ng set
schema repeatedly is of rela ons is
a) BCNF algorithm a) Zero
b) 2NF algorithm b) More than zero but less than that of an
c) 3NF synthesis algorithm equivalent 3NF decomposi on
d) 1NF algorithm c) Propor onal to the size of F+
d) Indeterminate
Answer: c
Explana on: The result is not uniquely Answer: b
defined, since a set of func onal Explana on: Redundancy in BCNF is low
dependencies can have more than one when compared to 3NF. For more details on
canonical cover, and, further, in some cases, BCNF.
the result of the algorithm depends on the
order in which it considers the dependencies 9. A table has fields F1, F2, F3, F4, and F5,
in Fc. with the following func onal dependencies:

6. The func onal dependency can be tested F1->F3


easily on the materialized view, using the F2->F4
(F1,F2)->F5
constraints ____________.
a) Primary key in terms of normaliza on, this table is in
b) Null a) 1NF

www.studymaterialz.in 59
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) 2NF Answer: a
c) 3NF Explana on: Fourth normal form is more
d) None of the men oned restric ve than BCNF.

Answer: a 2. Which of the following is a tuple-


Explana on: Since the primary key is not genera ng dependencies?
given we have to derive the primary key of a) Func onal dependency
the table. Using the closure set of a ributes b) Equality-genera ng dependencies
we get the primary key as (F1, F2). From c) Mul valued dependencies
func onal dependencies, “F1->F3, F2->F4”, d) Non-func onal dependency
we can see that there is par al func onal
dependency therefore it is not in 1NF. Hence Answer: c
the table is in 1NF. Explana on: Mul valued dependencies, do
not rule out the existence of certain tuples.
10. Let R(A,B,C,D,E,P,G) be a rela onal Instead, they require that other tuples of a
schema in which the following FDs are known certain form be present in the rela on.
to hold:
3. The main task carried out in the
AB->CD __________ is to remove repea ng
a ributes to separate tables.
DE->P
a) First Normal Form
C->E b) Second Normal Form
c) Third Normal Form
P->C
d) Fourth Normal Form
B->G
Answer: a
The rela on schema R is Explana on: Mul valued dependencies, do
a) in BCNF not rule out the existence of certain tuples.
b) in 3NF, but not in BCNF Instead, they require that other tuples of a
c) in 2NF, but not in 3NF certain form be present in the rela on.
d) not in 2NF
4. Which of the normal form is based on
Answer: d mul valued dependencies?
Explana on: From the closure set of a) First
a ributes we can see that the key for the b) Second
rela on is AB. The FD B->G is a par al c) Third
dependency, hence it is not in 2NF. d) Fourth

Answer: d
1. The normal form which sa sfies Explana on: Mul valued dependencies, do
mul valued dependencies and which is in not rule out the existence of certain tuples.
BCNF is Instead, they require that other tuples of a
a) 4 NF certain form be present in the rela on.
b) 3 NF
c) 2 NF 5. Which forms has a rela on that possesses
d) All of the men oned data about an individual en ty?

www.studymaterialz.in 60
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) 2NF 8. In which of the following, a separate


b) 3NF schema is created consis ng of that a ribute
c) 4NF and the primary key of the en ty set.
d) 5NF a) A many-to-many rela onship set
b) A mul valued a ribute of an en ty set
Answer: c c) A one-to-many rela onship set
Explana on: A Table is in 4NF if and only if, d) None of the men oned
for every one of its non-trivial mul valued
dependencies X \twoheadrightarrow Y, X is a Answer: b
superkey—that is, X is either a candidate key Explana on: If a mul valued dependency
or a superset thereof. holds and is not implied by the
corresponding func onal dependency, it
6. If a mul valued dependency holds and is usually arises from this source.
not implied by the corresponding func onal
dependency, it usually arises from one of the 9. Fi h Normal form is concerned with
following sources. a) Func onal dependency
a) A many-to-many rela onship set b) Mul valued dependency
b) A mul valued a ribute of an en ty set c) Join dependency
c) A one-to-many rela onship set d) Domain-key
d) Both A many-to-many rela onship set and
A mul valued a ribute of an en ty set Answer: c
Explana on: If a mul valued dependency
Answer: d holds and is not implied by the
Explana on: For a many-to-many corresponding func onal dependency, it
rela onship set each related en ty set has its usually arises from this source.
own schema and there is an addi onal
schema for the rela onship set. For a 10. In 2NF
mul valued a ribute, a separate schema is a) No func onal dependencies (FDs) exist
created consis ng of that a ribute and the b) No mul valued dependencies (MVDs) exist
primary key of the en ty set. c) No par al FDs exist
d) No par al MVDs exist
7. Which of the following has each related
en ty set has its own schema and there is an Answer: c
addi onal schema for the rela onship set? Explana on: If a mul valued dependency
a) A many-to-many rela onship set holds and is not implied by the
b) A mul valued a ribute of an en ty set corresponding func onal dependency, it
c) A one-to-many rela onship set usually arises from this source.
d) None of the men oned

Answer: a 1. _____________ can help us detect poor E-


Explana on: If a mul valued dependency R design.
holds and is not implied by the a) Database Design Process
corresponding func onal dependency, it b) E-R Design Process
usually arises from this source. c) Rela onal scheme
d) Func onal dependencies

www.studymaterialz.in 61
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: d Answer: b
Explana on: For eg.,Suppose an instructor Explana on: If a mul valued dependency
en ty set had a ributes dept name and dept holds and is not implied by the
address, and there is a func onal corresponding func onal dependency, it
dependency dept name -> dept address. usually arises from this source.

2. If a mul valued dependency holds and is 5. Suppose the user finds the usage of room
not implied by the corresponding func onal number and phone number in a rela onal
dependency, it usually arises from one of the schema there is confusion.This is reduced by
following sources. a) Unique-role assump on
a) A many-to-many rela onship set b) Unique-key assignment
b) A mul valued a ribute of an en ty set c) Role intergral assignment
c) A one-to-many rela onship set d) None of the men oned
d) Both A many-to-many rela onship set and
A mul valued a ribute of an en ty set Answer: a
Explana on: A desirable feature of a
Answer: d database design is the unique-role
Explana on: For a many-to-many assump on, which means that each a ribute
rela onship set each related en ty set has its name has a unique meaning in the database.
own schema and there is an addi onal
schema for the rela onship set. For a 6. What is the best way to represent the
mul valued a ribute, a separate schema is a ributes in a large database?
created consis ng of that a ribute and the a) Rela onal-and
primary key of the en ty set. b) Concatena on
c) Dot representa on
3. Which of the following has each related d) All of the men oned
en ty set has its own schema and there is an
addi onal schema for the rela onship set. Answer: b
a) A many-to-many rela onship set Explana on: Example inst sec and student
b) A mul valued a ribute of an en ty set sec.
c) A one-to-many rela onship set
d) All of the men oned 7. Designers use which of the following to
tune the performance of systems to support
Answer: a me-cri cal opera ons?
Explana on: If a mul valued dependency a) Denormaliza on
holds and is not implied by the b) Redundant op miza on
corresponding func onal dependency, it c) Op miza on
usually arises from this source. d) Realiza on

4. In which of the following, a separate Answer: a


schema is created consis ng of that a ribute Explana on: The process of taking a
and the primary key of the en ty set. normalized schema and making it
a) A many-to-many rela onship set nonnormalized is called denormaliza on.
b) A mul valued a ribute of an en ty set
c) A one-to-many rela onship set 8. In the schema (dept name, size) we have
d) All of the men oned rela ons total inst 2007, total inst 2008.

www.studymaterialz.in 62
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Which dependency have lead to this rela on b) Snapshot


? c) Both Cross-tabs and Snapshot
a) Dept name, year->size d) All of the men oned
b) Year->size
c) Dept name->size Answer: a
d) Size->year Explana on: SQL includes features to
convert data from a normal rela onal
Answer: a representa on to a crosstab.
Explana on: The process of taking a
normalized schema and making it
nonnormalized is called denormaliza on. 1. An approach to website design with the
emphasis on conver ng visitors to outcomes
9. Rela on dept year(dept name, total inst required by the owner is referred to as:
2007, total inst 2008, total inst 2009). Here a) Web usability
the only func onal dependencies are from b) Persuasion
dept name to the other a ributes. This c) Web accessibility
rela on is in d) None of the men oned
a) Fourth NF
b) BCNF Answer: b
c) Third NF Explana on: In compu ng, graphical user
d) Second NF interface is a type of user interface that
allows users to interact with electronic
Answer: b devices.
Explana on: BCNF has only one normal
form. 2. A method of modelling and describing user
tasks for an interac ve applica on is referred
10. Thus a _______ of course data gives the to as:
values of all a ributes, such as tle and a) Customer journey
department, of all courses at a par cular b) Primary persona
point in me. c) Use case
a) Instance d) Web design persona
b) Snapshot
c) Both Instance and Snapshot Answer: c
d) All of the men oned Explana on: The ac ons in GUI are usually
performed through direct manipula on of
Answer: b the graphical elements.
Explana on: We use the term snapshot of
data to mean the value of the data at a 3. Informa on architecture influences:
par cular point in me. a) Answer choice
b) Site structure
11. Representa ons such as the in the dept c) Labeling
year rela on, with one column for each value d) Naviga on design
of an a ribute, are called _______ they are
widely used in spreadsheets and reports and Answer: b
in data analysis tools. Explana on: The ac ons in GUI are usually
a) Cross-tabs

www.studymaterialz.in 63
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

performed through direct manipula on of 7. Storyboards are intended to:


the graphical elements. a) Indicate the structure of a site during site
design and as a user feature
4. Also known as schema cs, a way of b) Prototype of the screen layout showing
illustra ng the layout of an individual naviga on and main design elements
webpage is a: c) Integrate consistently available
a) Wireframe components on the webpage (e.g.
b) Sitemap naviga on, search boxes)
c) Card sor ng d) Prototype typical customer journeys or
d) Blueprint click streams through a website

Answer: a Answer: d
Explana on: An applica on programming Explana on: An applica on programming
interface specifies how some so ware interface specifies how some so ware
components should interact with each other. components should interact with each other.

5. A graphical or text depic on of the 8. Which of the following occupies boot


rela onship between different groups of record of hard and floppy disks and ac vated
content on a website is referred to as a: during computer startup?
a) Wireframe a) Worm
b) Blueprint b) Boot sector virus
c) Sitemap c) Macro virus
d) Card sor ng d) Virus

Answer: c Answer: b
Explana on: An applica on programming Explana on: A blueprint is a reproduc on of
interface specifies how some so ware a technical drawing, documen ng an
components should interact with each other. architecture or an engineering design, using a
contact print process.
6. Blueprints are intended to:
a) Prototype of the screen layout showing 9. A graphical or text depic on of the
naviga on and main design elements rela onship between different groups of
b) Show the grouping of pages and user content on a website is a:
journeys a) Page template
c) Indicate the structure of a site during site b) Wireframe
design and as a user feature c) Site map
d) Prototype typical customer journeys or d) Cascading style sheet (CSS)
clickstreams through a website
Answer: c
Answer: c Explana on: In compu ng, graphical user
Explana on: A blueprint is a reproduc on of interface is a type of user interface that
a technical drawing, documen ng an allows users to interact with electronic
architecture or an engineering design, using a devices.
contact print process.
10. Which of the following is a descrip on of
informa on organiza on schemes?

www.studymaterialz.in 64
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Minimising the number of clicks needed to Answer: d


access relevant content Explana on: Argument is always placed a er
b) Providing an overall design to a site ? symbol.
consistent with the posi oning of the
products and services 3. HTTP defines two ways in which values
c) The menu op ons chosen to group and entered by a user at the browser can be sent
categorize informa on to the Web server. The _____ method
d) Providing specific content and services encodes the values as part of the URL.
appropriate to different audience members a) Post
b) Get
Answer: c c) Read
Explana on: In compu ng, graphical user d) Argument
interface is a type of user interface that
allows users to interact with electronic Answer: b
devices. Explana on: For example, if the Google
search page used a form with an input
parameter
named q with the get method, and the user
typed in the string “silberschatz” and
submi ed the form, the browser would
UNIT IV IMPLEMENTATION request the following URL from the Web
TECHNIQUES server: h p://www.google.com/search?
q=silberschatz.
1. Which of the following is a valid uniform
resource locator? 4. A __________ is a program running on the
a) h p://www.acm.org/sigmod server machine, which accepts requests from
b) www.google.com a Web browser and sends back results in the
c) www.ann.in form of HTML documents.
d) h p:/www.acm.org/sigmod/ a) HTML
b) HTTP
Answer: a c) Web Server
Explana on: A uniform resource locator d) Web browser
(URL) is a globally unique name for each
document that can be accessed on the Web. Answer: c
Explana on: The browser and Web server
2. h p://www.google.com/search? communicate via HTTP. Web servers provide
q=silberschatz powerful features, beyond the simple
In the above URL which one is the argument transfer of documents.
which is used for processing of the URL?
a) google 5. The applica on program typically
b) google.com communicates with a database server,
c) search through ___________ or other protocols, in
d) q=silberschatz order to get or store data.
a) JDBC
b) ODBC

www.studymaterialz.in 65
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) All of the men oned c) .doc


d) None of the men oned d) Both .html & .htm

Answer: c Answer: d
Explana on: The common gateway interface Explana on: .doc is used only for the word
(CGI) standard defines how the Web server document format.
communicates with applica on programs.
10. How many levels of headings are in html:
6. This extra informa on is usually a) 2
maintained in the form of a _________ at the b) 7
client. c) 6
a) Cookie d) 4
b) History
c) Remainder Answer: c
d) None of the men oned Explana on: The heading levels are
h1,h2,h3,h4,h5,h6.
Answer: a
Explana on: A cookie is simply a small piece
of text containing iden fying informa on and 1. The Java __________ specifica on defines
with an associated name. an applica on programming interface for
communica on between the Web server and
7. Which of the following is not true about the applica on program.
HTML ? a) Servlet
a) <meta>…</meta> b) Server
b) <meta…./> c) Program
c) <metadata>…</metadata> d) Randomize
d) <metadata name=”” />
Answer: a
Answer: b Explana on: Servlets are commonly used to
Explana on: Meta data is the data about generate dynamic responses to HTTP
data which is included in the meta data tag. requests.

8. Html code contains: 2. The doGet() method in the example


a) Tags extracts values of the parameter’s type and
b) A ributes number by using __________
c) Elements a) request.getParameter()
d) All of the men oned b) request.setParameter()
c) responce.getParameter()
Answer: d d) responce.getA ribute()
Explana on: <> are tags,size is a a ribute.
Answer: a
9. Html document must always be saved Explana on: These methods uses these
with: values to run a query against a database.
a) .html
b) .htm 3. How many JDBC driver types does Sun
define?

www.studymaterialz.in 66
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) One Answer: b
b) Two Explana on: Servlets are commonly used to
c) Three generate dynamic responses to HTTP
d) Four requests.

Answer: d 7. Which JDBC driver Type(s) is(are) the JDBC-


Explana on: ODBC bridge?
JBDB.DriverManager.getConnec on() is used a) Type 1
to get the connec on to the database. b) Type 2
c) Type 3
4. Which JDBC driver Type(s) can be used in d) Type 4
either applet or servlet code?
a) Both Type 1 and Type 2 Answer: a
b) Both Type 1 and Type 3 Explana on: In a Type 1 driver, a JDBC bridge
c) Both Type 3 and Type 4 is used to access ODBC drivers installed on
d) Type 4 only each client machine.

Answer: c 8. What programming language(s) or


Explana on: In a Type 3 driver, a three- er scrip ng language(s) does Java Server Pages
approach is used to accessing databases. The (JSP) support?
JDBC clients use standard network sockets to a) VBScript only
communicate with an middleware b) Jscript only
applica on server. In a Type 4 driver, a pure c) Java only
Java-based driver that communicates directly d) All of the men oned
with vendor’s database through socket
connec on. Answer: c
Explana on: JSP primarily uses Java for
5. What MySQL property is used to create a certain codes.
surrogate key in MySQL?
a) UNIQUE 9. What is bytecode?
b) SEQUENCE a) Machine-specific code
c) AUTO_INCREMENT b) Java code
d) None of the men oned c) Machine-independent code
d) None of the men oned
Answer: c
Explana on: A surrogate key in a database is Answer: c
a unique iden fier for either an en ty in the Explana on: Java bytecode is the form of
modeled world or an object in the database. instruc ons that the Java virtual machine
executes. Each bytecode opcode is one byte
6. A JSP is transformed into a(n): in length, although some require parameters,
a) Java applet resul ng in some mul -byte instruc ons.
b) Java servlet
c) Either 1 or 2 above 10. Where is metadata stored in MySQL?
d) Neither 1 nor 2 above a) In the MySQL database metadata
b) In the MySQL database metasql

www.studymaterialz.in 67
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) In the MySQL database mysql 4. Which layer deals which deals with user
d) None of the men oned interac on is called _____________ layer.
a) Business logic
Answer: c b) Presenta on
Explana on: Metadata contains data about c) User interac on
other data which is given in the <meta>… d) Data access
</meta> tags.
Answer: b
Explana on: The single applica on may have
1. Which of the following is true for Seeheim several different versions of this layer,
model? corresponding to dis nct kinds of interfaces
a) Presenta on is abstracted from dialogue such as Web browsers, and user interfaces of
and Applica on mobile phones, which have much smaller
b) Presenta on and Dialogue is abstracted screens.
from Applica on
c) Presenta on and Applica on is abstracted 5. The _____________ layer, which provides
from Dialogue a high-level view of data and ac ons on data.
d) None of the men oned a) Business logic
b) Presenta on
Answer: a c) User interac on
Explana on: Presenta on is abstracted from d) Data access
dialogue and applica on.
Answer: a
2. Which of the unit opera on is used in Explana on: The single applica on may have
Model view controller? several different versions of this layer,
a) Is a Decomposi on corresponding to dis nct kinds of interfaces
b) Part Whole Decomposi on such as Web browsers, and user interfaces of
c) All of the men oned mobile phones, which have much smaller
d) None of the men oned screens.
Answer: b 6. The ______________ layer, which provides
Explana on: Part whole decomposi on is the interface between the business-logic
applied to MVC. layer and the underlying database.
a) Business logic
3. Memory address refers to the successive b) Presenta on
memory words and the machine is called as c) User interac on
_______________ d) Data access
a) word addressable
b) byte addressable Answer: d
c) bit addressable Explana on: Many applica ons use an
d) Terra byte addressable object-oriented language to code the
business-logic layer, and use an object-
Answer: a oriented model of data, while the underlying
Explana on: Part whole decomposi on is database is a rela onal database.
applied to MVC.

www.studymaterialz.in 68
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

7. The _____________ system is widely used founded in Seeheim model are- Replacing the
for mapping from Java objects to rela ons. presenta on toolkit and Replacing the
a) Hibernate applica on toolkit.
b) Object oriented
c) Objec ve
d) None of the men oned 1. Which schema object instructs Oracle to
connect to a remotely access an object of a
Answer: a database?
Explana on: In Hibernate, the mapping from a) Sequence
each Java class to one or more rela ons is b) Remote link
specified in a mapping file. c) Database link
d) Data link
8. Which among the following are the
func ons that any system with a user Answer: d
interface must provide? Explana on: A database link (DBlink) is a
a) Presenta on defini on of how to establish a connec on
b) Dialogue from one Oracle database to another.
c) All of the men oned
d) None of the men oned 2. DML changes are
a) Insert
Answer: a b) Update
Explana on: Presenta on and Applica on c) Create
are the func ons that any system with a user d) Both Insert and Update
interface must provide.
Answer: d
9. Which of the following is the main task Explana on: Create is a DDL opera on.
accomplished by the user?
a) Compose a document 3. Which of the following object types below
b) Create a spread sheet cannot be replicated?
c) Send mail a) Data
d) All of the men oned b) Trigger
c) View
Answer: d d) Sequence
Explana on: All of the men oned are the
main task accomplished by the user. Answer: d
Explana on: Sequence is a series of items
10. What are the portability concerns which is like a unique index.
founded in Seeheim model?
a) Replacing the presenta on toolkit 4. How to force a log switch?
b) Replacing the applica on toolkit a) By using ALTER SYSTEM LOG
c) Replacing the dialogue toolkit b) By using ALTER SYSTEM SWITCH LOGFILE
d) Replacing the presenta on & applica on c) By using ALTER SYSTEM SWITCH LOGS
toolkit d) By using ALTER SYS LOGFILES

Answer: d Answer: b
Explana on: The portability concerns Explana on: ALTER SYSTEM ARCHIVE LOG

www.studymaterialz.in 69
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

CURRENT is the best prac ce for produc on b) Performs recovery when a user process
backup scripts with RMAN. . fails
c) Writes redo log entries to disk
5. In the following query, which expression is d) None of the men oned
evaluated first?
Answer: a
SELECT id_number, (quantity - 100 / 0.15 Explana on: SMON (System MONitor) is an
- 35 * 20) FROM inventory
Oracle background process created when you
a) 100 / 0.15 start a database instance.
b) quan ty – 100
9. Which of the following queries are legal?
c) 35*20
a) SELECT deptno, count(deptno) FROM emp
d) 0.15-35
GROUP BY ename;
Answer: a b) SELECT deptno, count(deptno), job FROM
Explana on: According to the precedence of emp GROUP BY deptno;
expression as in BODMAS the expression c) SELECT deptno, avg(sal) FROM emp;
evaluated. d) SELECT deptno, avg(sal) FROM emp
GROUP BY deptno;
6. The ORDER BY clause can only be used in
a) SELECT queries Answer: d
b) INSERT queries Explana on: For aggregate func ons group
c) GROUP BY queries by clause is necessary.
d) HAVING queries
10. Which of the following queries displays
Answer: a the sum of all employee salaries for those
Explana on: SELECT employees not making commission, for each
column_name,column_name job, including only those sums greater than
FROM table_name 2500?
ORDER BY column_name,column_name a) select job, sum(sal) from emp where
ASC|DESC;. sum(sal) > 2500 and comm is null;
b) select job, sum(sal) from emp where
7. Which of the following rule below are comm is null group by job having sum(sal) >
categories of an index? 2500;
a) Column and Func onal c) select job, sum(sal) from emp where
b) Mul ple Column and func onal sum(sal) > 2500 and comm is null group by
c) Column, Mul ple Column and func onal job;
d) None of the men oned d) select job, sum(sal) from emp group by job
having sum(sal) > 2500 and comm is not null;
Answer: a
Explana on: The CREATE INDEX statement is Answer: b
used to create indexes in tables. Explana on: For aggregate func ons group
by clause is necessary.
8. What is the purpose of SMON background
process?
a) Performs crash recovery when a failed 1. The indirect change of the values of a
instance starts up again variable in one module by another module is

www.studymaterialz.in 70
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

called c) Inser ng
a) Internal change d) Traversal
b) Inter-module change
c) Side effect Answer: d
d) Side-module update Explana on: There are several types of
traversals.
Answer: c
Explana on: The module of the search tree 6. Finding the loca on of the element with a
and the flow is directed by its values. given value is:
a) Traversal
2. Which of the following data structure is b) Search
not linear data structure? c) Sort
a) Arrays d) None of the men oned
b) Linked lists
c) Arrays & Linked lists Answer: b
d) None of the men oned Explana on: Search is performed by
traversing through the tree.
Answer: d
Explana on: Both array and linked lists are in 7. Arrays are best data structures
data structure concepts. a) For rela vely permanent collec ons of
data
3. Which of the following data structure is b) For the size of the structure and the data
linear data structure? in the structure are constantly changing
a) Trees c) All of the men oned
b) Graphs d) None of the men oned
c) Arrays
d) None of the men oned Answer: a
Explana on: The operator tree has a tree like
Answer: c format where the evalua on starts from root
Explana on: Tree and graphs are not linear. of the tree.

4. Which of the following criterion is NOT 8. Linked lists are best suited
wri en using the proper syntax? a) For rela vely permanent collec ons of
a) “Haris” data
b) <500 b) For the size of the structure and the data
c) NO VALUE in the structure are constantly changing
d) Between #1/1/2000# and #12/31/2000# c) All of the men oned
d) None of the men oned
Answer: c
Explana on: NO VALUE cannot be specified. Answer: b
Explana on: A linked list is a data structure
5. The opera on of processing each element consis ng of a group of nodes which
in the list is known as together represent a sequence.
a) Sor ng
b) Merging 9. Each array declara on need not give,
implicitly or explicitly, the informa on about

www.studymaterialz.in 71
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) The name of array b) Cross-site request forgery


b) The data type of array c) Cross-site scrip ng
c) The first data from the set to be stored d) Cross-site scoring scrip ng
d) The index set of the array
Answer: c
Answer: c Explana on: In such an a ack, a malicious
Explana on: The operator tree has a tree like user enters code wri en in a client-side
format where the evalua on starts from root scrip ng language such as JavaScript or Flash
of the tree. instead of entering a valid name or comment.

10. The elements of an array are stored 3. _________ is an a ack which forces an
successively in memory cells because end user to execute unwanted ac ons on a
a) By this way computer can keep track only web applica on in which he/she is currently
the address of the first element and the authen cated.
addresses of other elements can be a) Two-factor authen ca on
calculated b) Cross-site request forgery
b) The architecture of computer memory c) Cross-site scrip ng
does not allow arrays to store other than d) Cross-site scoring scrip ng
serially
c) All of the men oned Answer: b
d) None of the men oned Explana on: Cross-site request forgery, also
known as a one-click a ack or session riding
Answer: a and abbreviated as CSRF or XSRF.
Explana on: Memory is always allo ed in
order. 4. Many applica ons use
_________________ where two independent
factors are used to iden fy a user.
1. In _________________ a acks, the a) Two-factor authen ca on
a acker manages to get an applica on to b) Cross-site request forgery
execute an SQL query created by the a acker. c) Cross-site scrip ng
a) SQL injec on d) Cross-site scoring scrip ng
b) SQL
c) Direct Answer: a
d) Applica on Explana on: The two factors should not
share a common vulnerability.
Answer: a
Explana on: Applica on security has to deal 5. Even with two-factor authen ca on, users
with several security threats and issues may s ll be vulnerable
beyond those handled by SQL authoriza on. to_____________a acks.
a) Radiant
2. A Web site that allows users to enter text, b) Cross a ack
such as a comment or a name, and then c) scrip ng
stores it and later display it to other users, is d) Man-in-the-middle
poten ally vulnerable to a kind of a ack
called a ___________________ a ack. Answer: d
a) Two-factor authen ca on Explana on: In such a acks, a user

www.studymaterialz.in 72
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a emp ng to connect to the applica on is c) Security Asser on Markup Language


diverted to a fake Web site, which accepts (SAML)
the password from the user, and uses it d) Virtual Private Database (VPD)
immediately to authen cate to the original
applica on. Answer: a
Explana on: The user’s password and other
6. A single ______________ further allows authen ca on factors are never revealed to
the user to be authen cated once, and the applica on, and the user need not
mul ple applica ons can then verify the register explicitly with the applica on.
user’s iden ty through an authen ca on
service without requiring reauthen ca on. 9. _______________ allows a system
a) OpenID administrator to associate a func on with a
b) Sign-on system rela on; the func on returns a predicate that
c) Security Asser on Markup Language must be added to any query that uses the
(SAML) rela on.
d) Virtual Private Database (VPD) a) OpenID
b) Single-site system
Answer: b c) Security Asser on Markup Language
Explana on: Once the user logged in at one (SAML)
site, he does not have to enter his user name d) Virtual Private Database (VPD)
and password at other sites that use the
same single sign-on service. Answer: d
Explana on: Some database systems provide
7. The ___________________ is a standard mechanisms for fine-grained authoriza on.
for exchanging authen ca on and
authoriza on informa on between different 10. VPD provides authoriza on at the level of
security domains, to provide cross- specific tuples, or rows, of a rela on, and is
organiza on single sign-on. therefore said to be a _____________
a) OpenID mechanism.
b) Sign-on system a) Row-level authoriza on
c) Security Asser on Markup Language b) Column-level authen ca on
(SAML) c) Row-type authen ca on
d) Virtual Private Database (VPD) d) Authoriza on security

Answer: c Answer: a
Explana on: The user’s password and other Explana on: Oracle Virtual Private Database
authen ca on factors are never revealed to (VPD) allows a system administrator to
the applica on, and the user need not associate a func on with a rela on.
register explicitly with the applica on.

8. The __________ standard is an alterna ve 1. ___________ is widely used today for


for single sign-on across organiza ons, and protec ng data in transit in a variety of
has seen increasing acceptance in recent applica ons such as data transfer on the
years. Internet, and on cellular phone networks.
a) OpenID a) Encryp on
b) Single-site system b) Data mining

www.studymaterialz.in 73
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Internet Security there are two different keys, the public key
d) Architectural security and the private key, used to encrypt and
decrypt the data.
Answer: a
Explana on: Encryp on is also used to carry 5. Encryp on of small values, such as
out other tasks, such as authen ca on. iden fiers or names, is made complicated by
the possibility of __________
2. In a database where the encryp on is a) Dic onary a acks
applied the data is cannot be handled by the b) Database a acks
unauthorised user without c) Minor a acks
a) Encryp on key d) Random a acks
b) Decryp on key
c) Primary key Answer: a
d) Authorised key Explana on: This happens when par cularly
if the encryp on key is publicly available.
Answer: b
Explana on: Even if the message is 6. Which one of the following uses a 128bit
intercepted by an enemy, the enemy, not round key to encrypt the data using XOR and
knowing the key, will not be able to decrypt use it in reverse to decrypt it?
and understand the message. a) Round key algorithm
b) Public key algorithm
3. Which of the following is not a property of c) Advanced Encryp on Standard
good encryp on technique? d) Asymmetric key algorithm
a) Rela vely simple for authorized users to
encrypt and decrypt data Answer: c
b) Decryp on key is extremely difficult for an Explana on: The standard is based on the
intruder to determine Rijndael algorithm.
c) Encryp on depends on a parameter of the
algorithm called the encryp on key 7. Which of the following requires no
d) None of the men oned password travel across the internet?
a) Readable system
Answer: d b) Manipula on system
Explana on: Here a, b and c are the c) Challenge–response system
proper es have to be present in a good d) Response system
design of an encryp on technique.
Answer: c
4. In which of the following encryp on key is Explana on: The database system sends a
used to encrypt and decrypt the data? challenge string to the user. The user
a) Public key encrypts the challenge string using a secret
b) Private key password as encryp on key and then returns
c) Symmetric key the result. The database system can verify
d) Asymmetric key the authen city of the user by decryp ng the
string with the same secret password and
Answer: c checking the result with the original
Explana on: In public-key (also known as challenge string.
asymmetric-key) encryp on techniques,

www.studymaterialz.in 74
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

8. Assymmetric Encryp on: Why can a 10. Which is the principle of the encryp on
message encrypted with the Public Key only using a key?
be decrypted with the receiver’s appropriate a) The key indicates which func on is used
Private Key? for encryp on. Thereby it is more difficult to
a) Not true, the message can also be decrypt an intercepted message as the
decrypted with the Public Key func on is unknown
b) A so called “one way func on with back b) The key contains the secret func on for
door” is applied for the encryp on encryp on including parameters. Only a
c) The Public Key contains a special func on password can ac vate the key
which is used to encrypt the message and c) All func ons are public, only the key is
which can only be reversed by the secret. It contains the parameters used for
appropriate Private Key the encryp on resp. decryp on
d) The encrypted message contains the d) The key prevents the user of having to
func on for decryp on which iden fies the reinstall the so ware at each change in
Private Key technology or in the func ons for encryp on

Answer: b Answer: b
Explana on: An one-way func on is a Explana on: The encoding of a message is
func on which a computer can calculate calculated by an algorithm. If always the
quickly, but whose reversal would last same algorithm would be used, it would be
months or years. An one-way func on with easy to crack intercepted messages.
back door can be reversed with the help of a However, it isn’t possible to invent a new
couple of addi onal informa on (the back algorithm whenever the old one was cracked,
door), but scarcely without this informa on. therefore the possibility to parameterize
The informa on for the back door is algorithms is needed and this is the
contained in the private Key. assignment of the key.

9. Which is the largest disadvantage of


symmetric Encryp on? 1. Which of the following is a physical storage
a) More complex and therefore more me- media?
consuming calcula ons a) Tape Storage
b) Problem of the secure transmission of the b) Op cal Storage
Secret Key c) Flash memory
c) Less secure encryp on func on d) All of the men oned
d) Isn’t used any more
Answer: d
Answer: b Explana on: The storage media are classified
Explana on: As there is only one key in the by the speed with which data can be
symmetrical encryp on, this must be known accessed, by the cost per unit of data to buy
by both sender and recipient and this key is the medium, and by the medium’s reliability.
sufficient to decrypt the secret message.
Therefore it must be exchanged between 2. The _________ is the fastest and most
sender and receiver in such a manner that an costly form of storage, which is rela vely
unauthorized person can in no case take small; its use is managed by the computer
possession of it. system hardware.
a) Cache

www.studymaterialz.in 75
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Disk 6. Which is the cheapest memory device in


c) Main memory terms of costs/ bit?
d) Flash memory a) Semiconductor memory
b) Magne c disks
Answer: a c) Compact disks
Explana on: Cache storage is easy to access d) Magne c tapes
because it is closer to the processor.
Answer: c
3. Which of the following stores several Explana on: Compact disk is used for easy
gigabytes of data but usually lost when storage at lower cost.
power failure?
a) Flash memory 7. The primary medium for the long-term
b) Disk online storage of data is the __________
c) Main memory where the en re database is stored on
d) Secondary memory magne c disk.
a) Semiconductor memory
Answer: c b) Magne c disks
Explana on: The contents of main memory c) Compact disks
are usually lost if a power failure or system d) Magne c tapes
crash occurs.
Answer: b
4. The flash memory storage used are Explana on: The system must move the data
a) NOR Flash from disk to main memory so that they can
b) OR Flash be accessed.
c) AND Flash
d) All of the men oned 8. Op cal disk _______ systems contain a few
drives and numerous disks that can be
Answer: a loaded into one of the drives automa cally
Explana on: NAND flash has a much higher (by a robot arm) on demand.
storage capacity for a given cost, and is a) Tape Storage
widely used for data storage in devices such b) Jukebox
as cameras, music players, and cell phones. c) Flash memory
d) All of the men oned
5. __________ is increasingly being used in
server systems to improve performance by Answer: b
caching frequently used data, since it Explana on: The most popular form of
provides faster access than disk, with larger op cal disks are CD and DVD.
storage capacity than main memory.
a) Flash memory 9. There are “record-once” versions of the
b) Disk compact disk and digital video disk, which
c) Main memory can be wri en only once; such disks are also
d) Secondary memory called __________ disks.
a) Write-once, read-many (WORM)
Answer: a b) CD-R
Explana on: Flash memory is of two types – c) DVD-W
NAND and NOR. d) CD-ROM

www.studymaterialz.in 76
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a 3. The disk pla ers mounted on a spindle and


Explana on: There are also “mul ple-write” the heads mounted on a disk arm are
versions of compact disk (called CD-RW) and together known as ___________
digital video disk (DVD-RW, DVD+RW, and a) Read-disk assemblies
DVD-RAM), which can be wri en mul ple b) Head–disk assemblies
mes. c) Head-write assemblies
d) Read-read assemblies
10. Tape storage is referred to as __________
storage. Answer: b
a) Direct-access Explana on: Each side of a pla er of a disk
b) Random-access has a read–write head that moves across the
c) Sequen al-access pla er to access different tracks.
d) All of the men oned
4. The disk controller uses ________ at each
Answer: c sector to ensure that the data is not
Explana on: Tape storage is used primarily corrupted on data retrieval.
for backup and archival data. a) Checksum
b) Unit drive
c) Read disk
1. In magne c disk ________ stores d) Readsum
informa on on a sector magne cally as
reversals of the direc on of magne za on of Answer: a
the magne c material. Explana on: A disk controller interfaces
a) Read–write head between the computer system and the actual
b) Read-assemble head hardware of the disk drive.
c) Head–disk assemblies
d) Disk arm 5. _________ is the me from when a read
or write request is issued to when data
Answer: d transfer begins.
Explana on: Each side of a pla er of a disk a) Access me
has a read–write head that moves across the b) Average seek me
pla er to access different tracks. c) Seek me
d) Rota onal latency me
2. A __________ is the smallest unit of
informa on that can be read from or wri en Answer: a
to the disk. Explana on: To access (that is, to read or
a) Track write) data on a given sector of a disk, the
b) Spindle arm first must move so that it is posi oned
c) Sector over the correct track, and then must wait for
d) Pla er the sector to appear under it as the disk
rotates.
Answer: c
Explana on: The disk surface is logically 6. The me for reposi oning the arm is called
divided into tracks, which are subdivided into the ________ and it increases with the
sectors. distance that the arm must move.
a) Access me

www.studymaterialz.in 77
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Average seek me Answer: b


c) Seek me Explana on: The size of an erase block (o en
d) Rota onal latency me referred to as just “block” in flash literature)
is usually significantly larger than the block
Answer: c size of the storage system.
Explana on: Typical seek mes range from 2
to 30 milliseconds, depending on how far the 10. Hybrid disk drives are hard-disk systems
track is from the ini al arm posi on. that combine magne c storage with a
smaller amount of flash memory, which is
7. _________ is around one-half of the used as a cache for frequently accessed data.
maximum seek me. a) Hybrid drivers
a) Access me b) Disk drivers
b) Average seek me c) Hybrid disk drivers
c) Seek me d) All of the men oned
d) Rota onal latency me
Answer: b
Answer: b Explana on: Frequently accessed data that
Explana on: Average seek mes currently are rarely updated are ideal for caching in
range between 4 and 10 milliseconds, flash memory.
depending on the disk model.

8. Once the head has reached the desired 1. Which level of RAID refers to disk mirroring
track, the me spent wai ng for the sector to with block striping?
be accessed to appear under the head is a) RAID level 1
called the _______________ b) RAID level 2
a) Access me c) RAID level 0
b) Average seek me d) RAID level 3
c) Seek me
d) Rota onal latency me Answer: a
Explana on: RAID level 1 refers to disk
Answer: d mirroring with block striping.
Explana on: Rota onal speeds of disks today
range from 5400 rota ons per minute (90 2. Op cal disk technology uses
rota ons per second) up to 15,000 rota ons a) Helical scanning
per minute (250 rota ons per second), or, b) DAT
equivalently, 4 milliseconds to 11.1 c) A laser beam
milliseconds per rota on. d) RAID

9. In Flash memory, the erase opera on can Answer: d


be performed on a number of pages, called Explana on: Redundant Array of Inexpensive
an _______ at once, and takes about 1 to 2 Disks.
milliseconds.
a) Delete block 3. With mul ple disks, we can improve the
b) Erase block transfer rate as well by ___________ data
c) Flash block across mul ple disks.
d) Read block a) Striping

www.studymaterialz.in 78
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Dividing 7. ______________ par ons data and parity


c) Mirroring among all N+1 disks, instead of storing data
d) Dividing in N-disks and parity in one disk.
a) Block interleaved parity
Answer: a b) Block interleaved distributed parity
Explana on: Data striping consists of c) Bit parity
spli ng the bits of each byte across mul ple d) Bit interleaved parity
disks; such striping is called bitlevel striping.
Answer: b
4. Which one of the following is a Stripping Explana on: In level 5, all disks can
technique? par cipate in sa sfying read requests, unlike
a) Byte level stripping RAID level 4, where the parity disk cannot
b) Raid level stripping par cipate, so level 5 increases the total
c) Disk level stripping number of requests that can be met in a
d) Block level stripping given amount of me.
Answer: d 8. Hardware RAID implementa ons permit
Explana on: Block-level striping stripes _________ that is, faulty disks can be
blocks across mul ple disks. It treats the removed and replaced by new ones without
array of disks as a single large disk, and it turning power off.
gives blocks logical numbers. a) Scrapping
b) Swapping
5. The RAID level which mirroring is done c) Hot swapping
along with stripping is d) None of the men oned
a) RAID 1+0
b) RAID 0 Answer: c
c) RAID 2 Explana on: Hot
d) Both RAID 1+0 and RAID 0 swapping reduces the mean me to repair
since replacement of a disk does not have to
Answer: d wait un l a me when the system can be
Explana on: Mirroring without striping can shut down.
also be used with arrays of disks, to give the
appearance of a single large, reliable disk. 9. ___________ is popular for applica ons
such as storage of log files in a database
6. Where performance and reliability are system since it offers the best write
both important, RAID level ____ is used. performance.
a) 0 a) RAID level 1
b) 1 b) RAID level 2
c) 2 c) RAID level 0
d) 0+1 d) RAID level 3
Answer: d Answer: a
Explana on: Mirroring without striping can Explana on: RAID level 1 refers to disk
also be used with arrays of disks, to give the mirroring with block striping.
appearance of a single large, reliable disk.

www.studymaterialz.in 79
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

10. ______________ which increases the 3. A typical tape drive is ________ a typical
number of I/O opera ons needed to write a disk drive.
single logical block, pays a significant me a) more expensive than
penalty in terms of write performance. b) cheaper than
a) RAID level 1 c) of the same cost as
b) RAID level 2 d) none of the men oned
c) RAID level 5
d) RAID level 3 Answer: a
Explana on: Ter ary storage involves a
Answer: a robo c mechanism which will mount (insert)
Explana on: In level 5, all disks can and dismount removable mass storage media
par cipate in sa sfying read requests, unlike into a storage device according to the
RAID level 4, where the parity disk cannot system’s demands; this data is o en copied
par cipate, so level 5 increases the total to secondary storage before use.
number of requests that can be met in a
given amount of me. 4. During recovery from a failure
a) each pair of physical block is examined
b) specified pair of physical block is examined
1. Ter ary storage is built with : c) first pair of physical block is examined
a) a lot of money d) none of the men oned
b) unremovable media
c) removable media Answer: a
d) secondary storage Explana on: Ter ary storage involves a
robo c mechanism which will mount (insert)
Answer: c and dismount removable mass storage media
Explana on: Ter ary storage involves a into a storage device according to the
robo c mechanism which will mount (insert) system’s demands; this data is o en copied
and dismount removable mass storage media to secondary storage before use.
into a storage device according to the
system’s demands; this data is o en copied 5. A magneto-op c disk is :
to secondary storage before use. a) primary storage
b) secondary storage
2. Opera ng system is responsible for c) ter ary storage
a) disk ini aliza on d) none of the men oned
b) boo ng from disk
c) bad-bock recovery Answer: c
d) all of the men oned Explana on: Ter ary storage involves a
robo c mechanism which will mount (insert)
Answer: d and dismount removable mass storage media
Explana on: Ter ary storage involves a into a storage device according to the
robo c mechanism which will mount (insert) system’s demands; this data is o en copied
and dismount removable mass storage media to secondary storage before use.
into a storage device according to the
system’s demands; this data is o en copied 6. Which of the following are the process of
to secondary storage before use. selec ng the data storage and data access
characteris cs of the database?

www.studymaterialz.in 80
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Logical database design a) magne c disks


b) Physical database design b) magne c tapes
c) Tes ng and performance tuning c) ram
d) Evalua on and selec ng d) none of the men oned

Answer: b Answer: c
Explana on: Physical database design is the Explana on: Ter ary storage involves a
process of selec ng the data storage and robo c mechanism which will mount (insert)
data access characteris cs of the database. and dismount removable mass storage media
into a storage device according to the
7. The replacement of a bad block generally system’s demands; this data is o en copied
is not totally automa c because to secondary storage before use.
a) data in bad block cannot be replaced
b) data in bad block is usually lost
c) bad block does not contain any data 1. Which level of RAID refers to disk mirroring
d) none of the men oned with block striping?
a) RAID level 1
Answer: b b) RAID level 2
Explana on: Physical database design is the c) RAID level 0
process of selec ng the data storage and d) RAID level 3
data access characteris cs of the database.
Answer: a
8. Which of the following is the oldest Explana on: RAID (redundant array of
database model? independent disks) is a way of storing the
a) Rela onal same data in different places (thus,
b) Hierarchical redundantly) on mul ple hard disks.
c) Physical
d) Network 2. A unit of storage that can store one or
more records in a hash file organiza on is
Answer: d denoted as
Explana on: Network model has data stored a) Buckets
in a hierarchical network flow. b) Disk pages
c) Blocks
9. The surface area of a tape is ________ the d) Nodes
surface area of a disk.
a) much lesser than Answer: a
b) much larger than Explana on: A unit of storage that can store
c) equal to one or more records in a hash file
d) none of the men oned organiza on is denoted as buckets.

Answer: b 3. The file organiza on which allows us to


Explana on: Network model has data stored read records that would sa sfy the join
in a hierarchical network flow. condi on by using one block read is
a) Heap file organiza on
10. Which one of the following is not a b) Sequen al file organiza on
secondary storage?

www.studymaterialz.in 81
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Clustering file organiza on 7. A top-to-bo om rela onship among the


d) Hash file organiza on items in a database is established by a
a) Hierarchical schema
Answer: c b) Network schema
Explana on: All systems in the cluster share c) Rela onal schema
a common file structure via NFS, but not all d) All of the men oned
disks are mounted on all other systems.
Answer: a
4. What are the correct features of a Explana on: A hierarchical database model
distributed database? is a data model in which the data is organized
a) Is always connected to the internet into a tree-like structure. The structure
b) Always requires more than three machines allows represen ng informa on using
c) Users see the data in one global schema. parent/child rela onships.
d) Have to specify the physical loca on of the
data when an update is done 8. Choose the RDBMS which supports full
fledged client server applica on
Answer: c development
Explana on: Users see the data in one global a) dBase V
schema. b) Oracle 7.1
c) FoxPro 2.1
5. Each tablespace in an Oracle database d) Ingress
consists of one or more files called
a) Files Answer: b
b) name space Explana on: RDBMS is Rela onal Database
c) datafiles Management System.
d) PFILE
9. One approach to standardiza on storing of
Answer: c data?
Explana on: A data file is a computer file a) MIS
which stores data to use by a computer b) Structured programming
applica on or system. c) CODASYL specifica on
d) None of the men oned
6. The management informa on system
(MIS) structure with one main computer Answer: c
system is called a Explana on: CODASYL is an acronym for
a) Hierarchical MIS structure “Conference on Data Systems Languages”.
b) Distributed MIS structure
c) Centralized MIS structure 10. The highest level in the hierarchy of data
d) Decentralized MIS structure organiza on is called
a) Data bank
Answer: c b) Data base
Explana on: Structure of MIS may be c) Data file
understood by looking at the physical d) Data record
components of the informa on system in an
organiza on. Answer: b
Explana on: Database is a collec on of all

www.studymaterialz.in 82
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

tables which contains the data in form of c) High speed, large capacity disk
fields. d) Mouse

Answer: c
1. If a piece of data is stored in two places in Explana on: All the data are stored in form
the database, then of memory in the disk.
a) Storage space is wasted
b) Changing the data in one spot will cause 5. Which of the following is not true of the
data inconsistency tradi onal approach to informa on
c) In can be more easily accessed processing
d) Storage space is wasted & Changing the a) There is common sharing of data among
data in one spot will cause data inconsistency the various applica ons
b) It is file oriented
Answer: d c) Programs are dependent on the file
Explana on: The database is always d) It is inflexible
consistent and so there is no duplica on.
Answer: a
2. An audit trail ___________ Explana on: All the data are stored in form
a) Is used to make backup copies of memory in the disk.
b) Is the recorded history of opera ons
performed on a file 6. Which of these is not a feature of
c) Can be used to restore lost informa on Hierarchical model?
d) None of the men oned a) Organizes the data in tree-like structure
b) Parent node can have any number of child
Answer: b nodes
Explana on: This is more useful for all c) Root node does not have any parent
recovery ac ons. d) Child node can have any number of parent
nodes
3. Large collec on of files are called
____________ Answer: d
a) Fields Explana on: The data are traversed using
b) Records several algorithms.
c) Database
d) Sectors 7. Which of these data models is an
extension of the rela onal data model?
Answer: c a) Object-oriented data model
Explana on: The operator tree has a tree like b) Object-rela onal data model
format where the evalua on starts from root c) Semi structured data model
of the tree . d) None of the men oned

4. Which of the following hardware Answer: b


component is the most important to the Explana on: All the data are stored in form
opera on of a database management of memory in the disk.
system?
a) High resolu on video display 8. The informa on about data in a database
b) Printer is called _______

www.studymaterialz.in 83
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Metadata has a read–write head that moves across the


b) Hyper data pla er to access different tracks.
c) Tera data
d) None of the men oned 2. Rela onal schemas and other metadata
about rela ons are stored in a structure
Answer: a called the ____________
Explana on: Metadata is informa on about a) Metadata
a data. b) Catalog
c) Log
9. A data dic onary is a special file that d) Data Dic onary
contains?
a) The names of all fields in all files Answer: d
b) The data types of all fields in all files Explana on: Data dic onary is also called as
c) The widths of all fields in all files system catalog.
d) All of the men oned
3. ___________ is the collec on of memory
Answer: d structures and Oracle background processes
Explana on: The data dic onary is that operates against an Oracle database.
structured in tables and views, just like other a) Database
database data. b) Instance
c) Tablespace
10. The DBMS acts as an interface between d) Segment
what two components of an enterprise-class
database system? Answer: b
a) Database applica on and the database Explana on: Instance is a snapshot of
b) Data and the database database at any point of me.
c) The user and the database applica on
d) Database applica on and SQL 4. A ________ is a logical grouping of
database objects, usually to facilitate
Answer: a security, performance, or the availability of
Explana on: Database applica on is the database objects such as tables and indexes.
interface with the user to access the a) Tablespace
database. b) Segments
c) Extents
d) Blocks
1. A rela onal database system needs to
maintain data about the rela ons, such as Answer: a
the schema of the rela ons. This is called Explana on: A tablespace is a storage
a) Metadata loca on where the actual data underlying
b) Catalog database objects can be kept.
c) Log
d) Dic onary 5. A tablespace is further broken down into
________
Answer: a a) Tablespace
Explana on: Each side of a pla er of a disk b) Segments

www.studymaterialz.in 84
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Extents a) Instance
d) Blocks b) Segment
c) Database
Answer: b d) Dic onary
Explana on: Segment names are used in
create table and create index commands to Answer: c
place tables or indexes on specific database Explana on: Data dic onary is also called as
devices. system catalog.

6. __________ is a con guous group of 10. An Oracle object type has two parts the
blocks allocated for use as part of a table, _________ and__________
index, and so forth. a) Instance and body
a) Tablespace b) Segment and blocks
b) Segment c) Specifica on and body
c) Extent d) Body and segment
d) Block
Answer: c
Answer: c Explana on: Segment names are used in
Explana on: An extent is a set of con guous create table and create index commands to
blocks allocated in a database. place tables or indexes on specific database
devices. An extent is a set of con guous
7. ________ is the smallest unit of alloca on blocks allocated in a database.
in an Oracle database.
a) Database
b) Instance 1. The _______ is that part of main memory
c) Tablespace available for storage of copies of disk blocks.
d) Database Block a) Buffer
b) Catalog
Answer: d c) Storage
Explana on: Data block is a form of database d) Secondary storage
space alloca on.
Answer: a
8. An Oracle __________ is a set of tables Explana on: There is always a copy kept on
and views that are used as a read-only disk of every block, but the copy on disk may
reference about the database. be a version of the block older than the
a) Database dic onary version in the buffer.
b) Dic onary table
c) Data dic onary 2. A major goal of the database system is to
d) Dic onary minimize the number of block transfers
between the disk and memory. This is
Answer: c achieved by
Explana on: Data dic onary is also called as a) Buffer
system catalog. b) Catalog
c) Storage
9. A data dic onary is created when a d) Secondary storage
__________ created.

www.studymaterialz.in 85
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a 6. There are situa ons in which it is


Explana on: There is always a copy kept on necessary to write back the block to disk,
disk of every block, but the copy on disk may even though the buffer space that it occupies
be a version of the block older than the is not needed. This write is called the
version in the buffer. a) Pinned block strategy
b) Forced output block
3. The subsystem responsible for the c) Buffer replacement strategy
alloca on of buffer space is called the d) All of the men oned
___________
a) Buffer Answer: b
b) Buffer manager Explana on: The main-memory contents and
c) Storage thus buffer contents are lost in a crash,
d) Secondary storage whereas data on disk usually survive a crash.

Answer: b 7. The frequently used buffer replacement


Explana on: Programs in a database system strategy is
make requests (that is, calls) on the buffer a) Most recently used
manager when they need a block from disk. b) Least recently used
c) Longest block
4. In the buffer where there is no space for d) All of the men oned
another block, the block can be inserted
using Answer: b
a) Pinned block strategy Explana on: If a block must be replaced, the
b) Forced output block least recently referenced block is replaced.
c) Buffer replacement strategy
d) All of the men oned 8. In case the buffer manager do not write
the blocks properly then the buffer manager
Answer: c uses
Explana on: Most opera ng systems use a a) Replacement strategy
least recently used (LRU) scheme, in which b) Forced strategy
the block that was referenced least recently c) Crash recovery system
is wri en back to disk and is removed from d) Both Replacement and Forced strategy
the buffer.
Answer: c
5. A block that is not allowed to be wri en Explana on: The crash-recovery subsystem
back to disk is said to be ______________ imposes stringent constraints on block
a) Pinned replacement.
b) Forced
c) Buffer 9. The technique where the blocks which
d) All of the men oned have been used are replaced is called
a) Replacement strategy
Answer: a b) Forced strategy
Explana on: Although many opera ng c) Crash recovery system
systems do not support pinned blocks, such a d) Most recently used
feature is essen al for a database system
that is resilient to crashes.

www.studymaterialz.in 86
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: d 3. An ____________ consists of a search-key


Explana on: The op mal strategy for block value and pointers to one or more records
replacement is the most recently used (MRU) with that value as their search-key value.
strategy. a) Index entry
b) Index hash
10. ___________________ frees the space c) Index cluster
occupied by a block as soon as the final tuple d) Index map
of that block has been processed.
a) Replacement strategy Answer: a
b) Forced strategy Explana on: The pointer to a record consists
c) Toss immediate strategy of the iden fier of a disk block and an offset
d) Most recently used within the disk block to iden fy the record
within the block.
Answer: c
Explana on: The op mal strategy for block 4. In a _______ clustering index, the index
replacement is the most recently used (MRU) record contains the search-key value and a
strategy. pointer to the first data record with that
search-key value and the rest of the records
will be in the sequen al pointers.
1. In ordered indices the file containing the a) Dense
records is sequen ally ordered, a b) Sparse
___________ is an index whose search key c) Straight
also defines the sequen al order of the file. d) Con nuous
a) Clustered index
b) Structured index Answer: a
c) Unstructured index Explana on: In a dense nonclustering index,
d) Nonclustered index the index must store a list of pointers to all
records with the same search-key value.
Answer: a
Explana on: Clustering index are also called 5. In a __________ index, an index entry
primary indices; the term primary index may appears for only some of the search-key
appear to denote an index on a primary key, values.
but such indices can in fact be built on any a) Dense
search key. b) Sparse
c) Straight
2. Indices whose search key specifies an d) Con nuous
order different from the sequen al order of
the file are called ___________ indices. Answer: a
a) Nonclustered Explana on: Sparse indices can be used only
b) Secondary if the rela on is stored in sorted order of the
c) All of the men oned search key, that is if the index is a clustering
d) None of the men oned index.

Answer: c 6. Incase the indices values are larger, index


Explana on: Nonclustering index is also is created for these values of the index. This
called secondary indices. is called

www.studymaterialz.in 87
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Pointed index 10. While inser ng the record into the index,
b) Sequen al index if the search-key value does not appear in the
c) Mul level index index.
d) Mul ple index a) The system adds a pointer to the new
record in the index entry
Answer: c b) The system places the record being
Explana on: Indices with two or more levels inserted a er the other records with the
are called mul level indices. same search-key values
c) The system inserts an index entry with the
7. A search key containing more than one search-key value in the index at the
a ribute is referred to as a _________ search appropriate posi on
key. d) None of the men oned
a) Simple
b) Composite Answer: c
c) Compound Explana on: If the index entry stores
d) Secondary pointers to all records with the same search
key value, the system adds a pointer to the
Answer: b new record in the index entry.
Explana on: The structure of the index is the
same as that of any other index, the only
difference being that the search key is not a 1. If h is any hashing func on and is used to
single a ribute, but rather is a list of hash n keys in to a table of size m, where
a ributes. n<=m, the expected number of collisions
involving a par cular key x is :
8. In B+ tree the node which points to a) Less than 1
another node is called b) Less than n
a) Leaf node c) Less than m
b) External node d) Less than n/2
c) Final node
d) Internal node Answer: a
Explana on: Hashing is also a method of
Answer: d sor ng key values in a database table in an
Explana on: Nonleaf nodes are also referred efficient manner.
to as internal nodes.
2. A technique for direct search is
9. Inser on of a large number of entries at a a) Binary Search
me into an index is referred to as b) Linear Search
__________ of the index. c) Tree Search
a) Loading d) Hashing
b) Bulk inser on
c) Bulk loading Answer: d
d) Increase inser on Explana on: Hashing is one way to enable
security during the process of message
Answer: c transmission when the message is intended
Explana on: Bulk loading is used to improve for a par cular recipient only.
efficiency and scalability.

www.studymaterialz.in 88
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

3. The searching technique that takes O (1) probing is


me to find a data is a) 0.1
a) Linear Search b) 0.6
b) Binary Search c) 0.2
c) Hashing d) 0.5
d) Tree Search
Answer: b
Answer: c Explana on: Hashing is used to index and
Explana on: A formula generates the hash, retrieve items in a database because it is
which helps to protect the security of the easier to find the item using the shortened
transmission from unauthorized users. hashed key than using the original value.

4. The goal of hashing is to produce a search 7. Key value pairs is usually seen in
that takes a) Hash tables
a) O(1) me b) Heaps
b) O(n2 ) me c) Both Hash tables and Heaps
c) O(log n ) me d) Skip list
d) O(n log n ) me
Answer: a
Answer: a Explana on: Hashing is used to index and
Explana on: Time complexity is given by the retrieve items in a database because it is
big oh nota on. easier to find the item using the shortened
hashed key than using the original value.
5. Consider a hash table of size seven, with
star ng index zero, and a hash func on (3x + 8. What is the best defini on of a collision in
4)mod7. Assuming the hash table is ini ally a hash table?
empty, which of the following is the contents a) Two entries are iden cal except for their
of the table when the sequence 1, 3, 8, 10 is keys
inserted into the table using closed hashing? b) Two entries with different data have the
Note that ‘_’ denotes an empty loca on in exact same key
the table. c) Two entries with different keys have the
a) 8, _, _, _, _, _, 10 same exact hash value
b) 1, 8, 10, _, _, _, 3 d) Two entries with the exact same key have
c) 1, _, _, _, _, _,3 different hash values
d) 1, 10, 8, _, _, _, 3
Answer: a
Answer: b Explana on: This level is the root of the tree.
Explana on: A formula generates the hash,
which helps to protect the security of the 9. Which of the following scenarios leads to
transmission from unauthorized users. linear running me for a random search hit in
a linear-probing hash table?
6. A hash table can store a maximum of 10 a) All keys hash to same index
records, currently there are records in b) All keys hash to different indices
loca on 1, 3,4,7,8,9,10. The probability of a c) All keys hash to an even-numbered index
new record going into loca on 2, with hash d) All keys hash to different even-numbered
func ons resolving collisions by linear indices

www.studymaterialz.in 89
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a data)
Explana on: If all keys hash to the same b) Limited flexibility in accessing data
loca on then the i-th inserted key would c) Overhead associated with maintaining
need i lookups to be found. The probability of indexes
looking up i-th key is 1/n (since it’s random). d) The performance of the database is poor
If you know some probability it’s trivial to
show that such lookups have linear me. Answer: b
Explana on: In this, the data items are
10. Breadth First Search is used in placed in a tree like hierarchical structure.
a) Binary trees
b) Stacks 4. The property (or set of proper es) that
c) Graphs uniquely defines each row in a table is called
d) All of the men oned the:
a) Iden fier
Answer: c b) Index
Explana on: Hashing is used to index and c) Primary key
retrieve items in a database because it is d) Symmetric key
easier to find the item using the shortened
hashed key than using the original value. Answer: c
Explana on: Primary is used to uniquely
iden fy the tuples.
1. A(n) _________ can be used to preserve
the integrity of a document or a message. 5. The separa on of the data defini on from
a) Message digest the program is known as:
b) Message summary a) Data dic onary
c) Encrypted message b) Data independence
d) None of the men oned c) Data integrity
d) Referen al integrity
Answer: c
Explana on: Encryp on algorithms are used Answer: b
to keep the contents safe. Explana on: Data dic onary is the place
where the meaning of the data are
2. A hash func on must meet ________ organized.
criteria.
a) Two 6. In the client / server model, the database:
b) Three a) Is downloaded to the client upon request
c) Four b) Is shared by both the client and server
d) None of the men oned c) Resides on the client side
d) Resides on the server side
Answer: b
Explana on: Only if the criteria is fulfilled the Answer: d
values are hashed. Explana on: The server has all the database
informa on and the client access it.
3. What is the main limita on of Hierarchical
Databases? 7. The tradi onal storage of data that is
a) Limited capacity (unable to hold much organized by customer, stored in separate

www.studymaterialz.in 90
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

folders in filing cabinets is an example of Answer: c


what type of ‘database’ system? Explana on: The is binary n-array associa on
a) Hierarchical meaning more than two classes are involved
b) Network in the rela onship.
c) Object oriented
d) Rela onal
1. Bitmap indices are a specialized type of
Answer: a index designed for easy querying on
Explana on: Hierarchy is based on Parent- ___________
Child Rela onship. Parent-Child Rela onship a) Bit values
Type is basically 1:N rela onship. b) Binary digits
c) Mul ple keys
8. The database design that consists of d) Single keys
mul ple tables that are linked together
through matching data stored in each table is Answer: c
called Explana on: Each bitmap index is built on a
a) Hierarchical database single key.
b) Network database
c) Object oriented database 2. A _______ on the a ribute A of rela on r
d) Rela onal database consists of one bitmap for each value that A
can take.
Answer: d a) Bitmap index
Explana on: A rela onal database is a b) Bitmap
collec on of data items organized as a set of c) Index
formally described tables from which data d) Array
can be accessed or reassembled.
Answer: a
9. The associa on role defines: Explana on: A bitmap is simply an array of
a) How tables are related in the database bits.
b) The rela onship between the class
diagram and the tables in the database 3.
c) The tables that each a ribute is contained
SELECT *
d) Which a ribute is the table’s primary key FROM r
WHERE gender = ’f’ AND income level = ’L
Answer: a 2’;
Explana on: The tables are always related in
the database to form consistency. In this selec on, we fetch the bitmaps for
gender value f and the bitmap for income
10. The purpose of an N-Ary associa on is: level value L2, and perform an ________ of
a) To capture a parent-child rela onship the two bitmaps.
b) To deal with one to many rela onships a) Union
c) To deal with rela onships that involve b) Addi on
more than two tables c) Combina on
d) To represent an inheritance rela onship d) Intersec on

www.studymaterialz.in 91
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: d records with that value for the indexed


Explana on: We compute a new bitmap a ribute.
where bit i has value 1 if the ith bit of the a) Leaf
two bitmaps are both 1, and has a value 0 b) Node
otherwise. c) Root
d) Link
4. To iden fy the deleted records we use the
______________ Answer: a
a) Existence bitmap Explana on: Bitmaps are combined and
b) Current bitmap stored in a B+ tree.
c) Final bitmap
d) Deleted bitmap 8. A tablespace is further broken down into
________
Answer: a a) Tablespace
Explana on: The bitmaps which are deleted b) Segments
are denoted by 0. c) Extents
d) Blocks
5. Bitmaps can be used as a compressed
storage mechanism at the leaf nodes of Answer: b
________ for those values that occur very Explana on: Segment names are used in
frequently. create table and create index commands to
a) B-trees place tables or indexes on specific database
b) B+-trees devices.
c) Bit trees
d) Both B-trees and B+-trees 9. In ordered indices the file containing the
records is sequen ally ordered, a
Answer: b ___________ is an index whose search key
Explana on: Bitmaps are combined and also defines the sequen al order of the file.
stored in a B+ tree. a) Clustered index
b) Structured index
6. Bitmaps can be combined with regular B+- c) Unstructured index
tree indices for rela ons where a few d) Nonclustered index
a ribute values are extremely common, and
other values also occur, but much less Answer: a
frequently. Explana on: Clustering index are also called
a) Bitmap, B-tree primary indices; the term primary index may
b) Bitmap, B+tree appear to denote an index on a primary key,
c) B-tree, Bitmap but such indices can in fact be built on any
d) B+tree, Bitmap search key.

Answer: b 10. Indices whose search key specifies an


Explana on: Bitmaps are combined and order different from the sequen al order of
stored in a B+ tree. the file are called ___________ indices.
a) Nonclustered
7. In a B+-tree index ______ for each value, b) Secondary
we would normally maintain a list of all

www.studymaterialz.in 92
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) All of the men oned a pointer to the data row that contains the
d) None of the men oned key value.

Answer: c 4. Which one is true about clustered index?


Explana on: Nonclustering index are also a) Clustered index is not associated with
called secondary indices. table
b) Clustered index is built by default on
unique key columns
1. What is the purpose of the index in sql c) Clustered index is not built on unique key
server? columns
a) To enhance the query performance d) None of the men oned
b) To provide an index to a record
c) To perform fast searches Answer: b
d) All of the men oned Explana on: Nonclustered indexes have a
structure separate from the data rows. A
Answer: d nonclustered index contains the nonclustered
Explana on: A database index is a data index key values and each key value entry has
structure that improves the speed of data a pointer to the data row that contains the
retrieval opera ons on a database table at key value.
the cost of addi onal writes.
5. What is true about indexes?
2. How many types of indexes are there in sql a) Indexes enhance the performance even if
server? the table is updated frequently
a) 1 b) It makes harder for sql server engines to
b) 2 work to work on index which have large keys
c) 3 c) It doesn’t make harder for sql server
d) 4 engines to work to work on index which have
large keys
Answer: b d) None of the men oned
Explana on: They are clustered index and
non clustered index. Answer: b
Explana on: Indexes tend to improve the
3. How non clustered index point to the performance.
data?
a) It never points to anything 6. Does index take space in the disk?
b) It points to a data row a) It stores memory as and when required
c) It is used for poin ng data rows containing b) Yes, Indexes are stored on disk
key values c) Indexes are never stored on disk
d) None of the men oned d) Indexes take no space
Answer: c Answer: b
Explana on: Nonclustered indexes have a Explana on: Indexes take memory slots
structure separate from the data rows. A which are located on the disk.
nonclustered index contains the nonclustered
index key values and each key value entry has 7. What are composite indexes?
a) Are those which are composed by

www.studymaterialz.in 93
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

database for its internal use Answer: c


b) A composite index is a combina on of Explana on: A covered query is a query
index on 2 or more columns where all the columns in the query’s result
c) Composite index can never be created set are pulled from non-clustered indexes.
d) None of the men oned

Answer: b 1. A collec on of data designed to be used by


Explana on: A composite index is an index different people is called a/an
on two or more columns of a table. a) Organiza on
b) Database
8. If an index is _________________ the c) Rela onship
metadata and sta s cs con nue to exists d) Schema
a) Disabling
b) Dropping Answer: b
c) Altering Explana on: Database is a collec on of
d) Both Disabling and Dropping related tables.

Answer: a 2. Which of the following is the oldest


Explana on: A database index is a data database model?
structure that improves the speed of data a) Rela onal
retrieval opera ons on a database table at b) Deduc ve
the cost of addi onal writes. c) Physical
d) Network
9. In _______________ index instead of
storing all the columns for a record together, Answer: d
each column is stored separately with all Explana on: The network model is a
other rows in an index. database model conceived as a flexible way
a) Clustered of represen ng objects and their
b) Column store rela onships.
c) Non clustered
d) Row store 3. Which of the following schemas does
define a view or views of the database for
Answer: b par cular users?
Explana on: A database index is a data a) Internal schema
structure that improves the speed of data b) Conceptual schema
retrieval opera ons on a database table at c) Physical schema
the cost of addi onal writes. d) External schema

10. A _________________ index is the one Answer: d


which sa sfies all the columns requested in Explana on: An externally-defined schema
the query without performing further lookup can provide access to tables that are
into the clustered index. managed on any PostgreSQL, Microso SQL
a) Clustered Server, SAS, Oracle, or MySQL database.
b) Non Clustered
c) Covering 4. Which of the following is an a ribute that
d) B-Tree can uniquely iden fy a row in a table?

www.studymaterialz.in 94
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Secondary key 8. A table can be logically connected to


b) Candidate key another table by defining a
c) Foreign key a) Super key
d) Alternate key b) Candidate key
c) Primary key
Answer: b d) Unique key
Explana on: A Candidate Key can be any
column or a combina on of columns that can Answer: c
qualify as unique key in database. Explana on: A superkey is a combina on of
a ributes that can be uniquely used to
5. Which of the following are the process of iden fy a database record.
selec ng the data storage and data access
characteris cs of the database? 9. If the state of the database no longer
a) Logical database design reflects a real state of the world that the
b) Physical database design database is supposed to capture, then such a
c) Tes ng and performance tuning state is called
d) Evalua on and selec ng a) Consistent state
b) Parallel state
Answer: b c) Durable state
Explana on: The physical design of the d) Inconsistent state
database op mizes performance while
ensuring data integrity by avoiding Answer: d
unnecessary data redundancies. Explana on: SQL data consistency is that
whenever a transac on is performed, it sees
6. Which of the following terms does refer to a consistent database.
the correctness and completeness of the
data in a database? 10. Ensuring isola on property is the
a) Data security responsibility of the
b) Data constraint a) Recovery-management component of the
c) Data independence DBMS
d) Data integrity b) Concurrency-control component of the
DBMS
Answer: d c) Transac on-management component of
Explana on: ACID property is sa sfied by the DBMS
transac on in database. d) Buffer management component in DBMS

7. The rela onship between DEPARTMENT Answer: b


and EMPLOYEE is a Explana on: Concurrency control ensures
a) One-to-one rela onship that correct results for concurrent opera ons
b) One-to-many rela onship are generated while ge ng those results as
c) Many-to-many rela onship quickly as possible.
d) Many-to-one rela onship

Answer: b 1. In query processing, the ___________ is


Explana on: One en ty department is the lowest-level operator to access data.
related to several employees. a) Index Search

www.studymaterialz.in 95
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Linear search guide in the choice of the index to use in


c) File scan processing the query.
d) Access paths
5. Which algorithm uses equality comparison
Answer: c on a key a ribute with a primary index to
Explana on: File scans are search algorithms retrieve a single record that sa sfies the
that locate and retrieve records that fulfill a corresponding equality condi on.
selec on condi on. a) A2
b) A4
2. In a ____________ the system scans each c) A5
file block and tests all records to see whether d) A6
they sa sfy the selec on condi on.
a) Index Search Answer: a
b) Linear search Explana on: A2 – primary index, equality on
c) File scan key.
d) Access paths
6. The strategy can retrieve a single record if
Answer: b the equality condi on is on a key; mul ple
Explana on: An ini al seek is required to records may be retrieved if the indexing field
access the first block of the file. is not a key is
a) A2
3. Index structures are referred to as b) A4
__________ since they provide a path c) A5
through which data can be located and d) A6
accessed.
a) Index Search Answer: b
b) Linear search Explana on: A4 – Secondary index, equality.
c) File scan
d) Access paths 7. The algorithm that uses a secondary
ordered index to guide retrieval for
Answer: d comparison condi ons involving <,≤,≥, or > is
Explana on: A primary index is an index that a) A2
allows the records of a file to be read in an b) A4
order that corresponds to the physical order c) A5
in the file. d) A6

4. Search algorithms that use an index are Answer: d


referred to as Explana on: A6 – Secondary index,
a) Index Search comparison.
b) Linear search
c) File scan 8. The ___ algorithm scans each index for
d) Access paths pointers to tuples that sa sfy an individual
condi on.
Answer: a a) A2
Explana on: Selec on predicates are used to b) A4

www.studymaterialz.in 96
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) A9 space complexity only the algorithm for


d) A6 sor ng will be chosen.

Answer: c 2. The me factor when determining the


Explana on: A9 – Conjunc ve selec on by efficiency of an algorithm is measured by
an intersec on of iden fiers. a) Coun ng microseconds
b) Coun ng the number of key opera ons
9. If access paths are available on all the c) Coun ng the number of statements
condi ons of a disjunc ve selec on, each d) Coun ng the kilobytes of algorithm
index is scanned for pointers to tuples that
sa sfy the individual condi on. This is Answer: b
sa sfied by Explana on: The opera ons taking place
a) A10 with the me and space is counted.
b) A7
c) A9 3. The space factor when determining the
d) A6 efficiency of an algorithm is measured by
a) Coun ng the maximum memory needed
Answer: a by the algorithm
Explana on: A10 – Disjunc ve selec on by b) Coun ng the minimum memory needed
union of iden fiers. by the algorithm
c) Coun ng the average memory needed by
10. Conjunc ve selec on using one index. the algorithm
This is d) Coun ng the maximum disk space needed
a) A10 by the algorithm
b) A7
c) A9 Answer: a
d) A6 Explana on: Time complexity maintains the
maximum me needed.
Answer: b
Explana on: To reduce the cost of A7 we 4. Which of the following case does not exist
choose a i and one of algorithms A1 through in complexity theory
A6 for which the combina on results in the a) Best case
least cost for i (r ). The cost of algorithm A7 is b) Worst case
given by the cost of the chosen algorithm. c) Average case
d) Null case

1. Two main measures for the efficiency of an Answer: d


algorithm are Explana on: Null case cannot be counted as
a) Processor and memory the factor for complexity.
b) Complexity and capacity
c) Time and space 5. The Worst case occur in linear search
d) Data and space algorithm when
a) Item is somewhere in the middle of the
Answer: c array
Explana on: Depending on the me and b) Item is not in the array at all
c) Item is the last element in the array

www.studymaterialz.in 97
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

d) Item is the last element in the array or is in the algorithm which can be reduced by
not there at all choosing the other algorithms.

Answer: d 9. The complexity of Binary search algorithm


Explana on: Algorithmic complexity is is
concerned about how fast or slow par cular a) O(n)
algorithm performs. b) O(log )
c) O(n2)
6. The Average case occur in linear search d) O(n log n)
algorithm
a) When Item is somewhere in the middle of Answer: b
the array Explana on: This shows that it has a
b) When Item is not in the array at all standard complexity in addressing.
c) When Item is the last element in the array
d) When Item is the last element in the array 10. The complexity of Bubble sort algorithm
or is not there at all is
a) O(n)
Answer: a b) O(log n)
Explana on: Algorithmic complexity is c) O(n2)
concerned about how fast or slow par cular d) O(n log n)
algorithm performs.
Answer: c
7. The complexity of the average case of an Explana on: Bubble sort, is a simple sor ng
algorithm is algorithm that works by repeatedly stepping
a) Much more complicated to analyze than through the list to be sorted, comparing each
that of worst case pair of adjacent items and swapping them if
b) Much more simpler to analyze than that of they are in the wrong order.
worst case
c) Some mes more complicated and some
other mes simpler than that of worst case 1. A_____ is a query that retrieves rows from
d) None of the men oned more than one table or view:
a) Start
Answer: a b) End
Explana on: Algorithmic complexity is c) Join
concerned about how fast or slow par cular d) All of the men oned
algorithm performs.
Answer: c
8. The complexity of a linear search algorithm Explana on: An SQL join clause combines
is records from two or more tables in a
a) O(n) database. It creates a set that can be saved as
b) O(log n) a table or used as it is. A JOIN is a means for
c) O(n2) combining fields from two tables by using
d) O(n log n) values common to each.

Answer: a 2. A condi on is referred to as __________


Explana on: It refers to n values complexity a) Join in SQL

www.studymaterialz.in 98
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Join condi on 6. Which product is returned in a join query


c) Join in SQL & Condi on have no join condi on:
d) None of the men oned a) Equijoins
b) Cartesian
Answer: b c) Both Equijoins and Cartesian
Explana on: An SQL join clause combines d) None of the men oned
records from two or more tables in a
database. It creates a set that can be saved as Answer: b
a table or used as it is. A JOIN is a means for Explana on: A Cartesian coordinate system
combining fields from two tables by using is a coordinate system that specifies each
values common to each. point uniquely in a plane by a pair of
numerical coordinates.
3. Which oracle is the join condi on is
specified using the WHERE clause: 7. Which is a join condi on contains an
a) Oracle 9i equality operator:
b) Oracle 8i a) Equijoins
c) Pre-oracle 9i b) Cartesian
d) Pre-oracle 8i c) Both Equijoins and Cartesian
d) None of the men oned
Answer: c
Explana on: Oracle 9i is a version of the Answer: a
Oracle Database. The i stands for “Internet” Explana on: An equi-join is a specific type of
to indicate that 9i is “Internet ready”. comparator-based join, that uses only
equality comparisons in the join-predicate.
4. How many join types in join condi on:
a) 2 8. Which join refers to join records from the
b) 3 write table that have no matching key in the
c) 4 le table are include in the result set:
d) 5 a) Le outer join
b) Right outer join
Answer: d c) Full outer join
Explana on: INNER JOIN, LEFT JOIN, RIGHT d) Half outer join
JOIN, FULL JOIN, EQUIJOIN.
Answer: b
5. Which are the join types in join condi on: Explana on: A right outer join will return all
a) Cross join the rows that an inner join returns plus one
b) Natural join row for each of the other rows in the second
c) Join with USING clause table that did not have a match in the first
d) All of the men oned table. It is the same as a le outer join with
the tables specified in the opposite order.
Answer: d
Explana on: INNER JOIN, LEFT JOIN, RIGHT 9. Which opera on are allowed in a join
JOIN, FULL JOIN, EQUIJOIN are the types of view:
joins. a) UPDATE
b) INSERT

www.studymaterialz.in 99
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) DELETE Answer: a
d) All of the men oned Explana on: The cost of a materialized
evalua on is not simply the sum of the costs
Answer: d of the opera ons involved.
Explana on: The DELETE statement is used
to delete rows in a table. The UPDATE 3. ______________ allows the algorithm to
statement is used to update exis ng records execute more quickly by performing CPU
in a table. The INSERT INTO statement is used ac vity in parallel with I/O ac vity.
to insert new records in a table. a) Buffering
b) Double buffering
10. Which view that contains more than one c) Mul ple buffering
table in the top-level FROM clause of the d) Double reading
SELECT statement:
a) Join view Answer: a
b) Datable join view Explana on: Double buffering using two
c) Updatable join view buffers, with one con nuing execu on of the
d) All of the men oned algorithm while the other is being wri en
out.
Answer: c
Explana on: The DELETE statement is used 4. Pipelines can be executed in
to delete rows in a table. The UPDATE a) 4
statement is used to update exis ng records b) 3
in a table. The INSERT INTO statement is used c) 2
to insert new records in a table. d) 5

Answer: c
1. Pictorial representa on of an expression is Explana on: Demand driven and producer
called driven pipelines are the two ways.
a) Expression tree
b) Operator tree 5. In a _________ the system makes
c) Expression flow repeated requests for tuples from the
d) Expression chart opera on at the top of the pipeline.
a) Demand-driven pipeline
Answer: b b) Producer-driven pipeline
Explana on: The operator tree has a tree like c) Demand pipeline
format where the evalua on starts from root d) All of the men oned
of the tree.
Answer: a
2. The results of each intermediate opera on Explana on: Each me that an opera on
are created and then are used for evalua on receives a request for tuples, it computes the
of the next-level opera ons. This is called next tuple (or tuples) to be returned, and
a) Materialized evalua on then returns that tuple.
b) Expression evalua on
c) Tree evalua on 6. In a _____________ opera ons do not
d) Tree materializa on wait for requests to produce tuples, but
instead generate the tuples eagerly.

www.studymaterialz.in 100
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Demand-driven pipeline c) Slowly, Eagerly


b) Producer-driven pipeline d) Eagerly, Slowly
c) Demand pipeline
d) All of the men oned Answer: b
Explana on: Producer-driven pipelining is
Answer: b very useful in parallel processing systems.
Explana on: Each opera on in a producer-
driven pipeline is modeled as a separate 10. When two inputs that we desire to
process or thread within the system that pipeline into the join are not already sorted it
takes a stream of tuples from its pipelined is the _____________ technique.
inputs and generates a stream of tuples for a) Hash join
its output. b) Buffer join
c) double-pipelined hash join
7. Each opera on in a demand-driven d) double-pipelined join
pipeline can be implemented as an ____ that
provides the following func ons: open(), Answer: d
next(), and close(). Explana on: When hash indices are used on
a) Demand tuples, the resultant algorithm is called the
b) Pipeline double-pipelined hash-join technique.
c) Iterator
d) All of the men oned
1. Consider the following rela onal schemes
Answer: c for a library database:
Explana on: A er a call to open(), each call
Book (Title, Author, Catalog_no, Publishe
to next() returns the next output tuple of the r, YEAR, Price)
opera on. Collection (Title, Author, Catalog_no)
WITH the following functional dependencie
8. The iterator maintains the __________ of s:
I. Title Author -> Catalog_no
its execu on in between calls so that II. Catalog_no -> Title Author Publisher
successive next() requests receive successive YEAR
result tuples. III. Publisher Title YEAR -> Price
a) State
b) Transi on Assume {Author, Title} is the key for both
c) Rate schemes. Which of the following statements
d) Block is true?
a) Both Book and Collec on are in BCNF
Answer: a b) Both Book and Collec on are in 3NF only
Explana on: The func on close() tells an c) Book is in 2NF and Collec on is in 3NF
iterator that no more tuples are required. d) Both Book and Collec on are in 2NF only

9. Tuples are generated ___________ in Answer: c


producer-driven pipelining, they are Explana on: The rela on Collec on is in
generated ________ on demand, in demand- BCNF: Its given that {Author, Title} is the key
driven pipelining. and there is only one func onal dependency
a) Lazily, Eagerly (FD) applicable to the rela on Collec on {i.e.
b) Eagerly, Lazily Title Author –> Catalog_no}.

www.studymaterialz.in 101
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

2. Let R(A,B,C,D,E,P,G) be a rela onal schema is the ACID property which guarantees that
in which the following FDs are known to transac ons that have commi ed will survive
hold: permanently.

AB->CD 5. Which u li es can we use to export data


DE->P
C->E
from sql server to a text file?
P->C a) DTS export wizard
B->G b) BCP
c) ISQL
The rela on schema R is d) DTS export wizard and BCP
a) in BCNF
b) in 3NF, but not in BCNF Answer: d
c) in 2NF, but not in 3NF Explana on: The bcp u lity bulk copies data
d) not in 2NF between an instance of Microso SQL Server
and a data file in a user-specified format.
Answer: d
Explana on: From the closure set of 6. You have a column that will only contain
a ributes we can see that the key for the values from 0 to 256. What is the most
rela on is AB. The FD B->G is a par al economical data type to use for the column?
dependency, hence it is not in 2NF. a) TINYINT
b) SMALLINT
3. Which of the following is/are false for RAW c) INT
mode of FOR XML? d) DECIMAL(1)
a) XMLSCHEMA op on does not returns an
in-line XSD schema Answer: b
b) BINARY BASE32 returns the binary data in Explana on: The bcp u lity bulk copies data
base32-encoded format between an instance of Microso SQL Server
c) Each row in the query result is transformed and a data file in a user-specified format.
into an XML element
d) None of the men oned 7. Problems occurs if we don’t implement a
proper locking strategy
Answer: b a) Dirty reads
Explana on: XML was designed to transport b) Phantom reads
and store data. c) Lost updates
d) Unrepeatable reads
4. ___________ refers to the ability of the
system to recover commi ed transac on Answer: b
updates if either the system or the storage Explana on: Phantom reads occur when an
media fails. insert or delete ac on is performed against a
a) Isola on row that belongs to a range of rows being
b) Atomicity read by a transac on.
c) Consistency
d) Durability 8. Which of the following fixed database roles
can add or remove user IDs?
Answer: d a) db_accessadmin
Explana on: In database systems, durability b) db_securityadmin

www.studymaterialz.in 102
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) db_setupadmin c) Check the performance of a stored


d) db_sysadmin procedure
d) None of the men oned
Answer: a
Explana on: The db_accessadmin role Answer: c
manages security, but handles access to the Explana on: Stored procedures are like
database, as the name implies. func ons which do not return values.

9. By default sql server has ___________ 3. Which global variables can be used to
isola on level determine if a transac on is s ll open?
a) READ COMMITTED a) @@NESTLEVEL
b) READ UNCOMMITTED b) @@FETCH_STATUS
c) SERIALIZABLE c) @@TRANCOUNT
d) REPEATABLE READ d) @@CONNECTIONS

Answer: a Answer: c
Explana on: READ UNCOMMITTED is the Explana on: PRINT @@TRANCOUNT — The
most op mis c concurrency isola on op on BEGIN TRAN statement will increment the —
available in SQL Server. transac on count by 1.

10. Which of the following pair of regular 4. Which statement is used to define a
expression are not equivalent? cursor?
a) 1(01)* and (10)*1 a) OPEN
b) x(xx)* and (xx)*x b) FETCH
c) (ab)* and a*b* c) DECLARE CURSOR
d) x+ and x*x+ d) @@FETCH_STATUS

Answer: c Answer: c
Explana on: (ab)*=(a*b*)*. Explana on: A database cursor is a control
structure that enables traversal over the
records in a database.
1. Which feature converts row data to a
column for be er analy cal view? 5. What is the default “SORT” order for a
a) Views SQL?
b) Join a) Ascending
c) Pivot b) Descending
d) Trigger c) As specified by the user
d) None of the men oned
Answer: c
Explana on: Pivot table is very powerful and Answer: a
very easy to use. Explana on: Default is ascending order.

2. Which of the following statements is/are 6. Capabili es of RAISERROR


not true for SQL profiler? a) It can be logged in the error log
a) Enables you to monitor events b) It can print a message to the applica on
b) Check if rows are being inserted properly c) It can assign an error number, state and

www.studymaterialz.in 103
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

severity Answer: d
d) All of the men oned Explana on: Open Database Connec vity
(ODBC) is Microso ’s strategic interface for
Answer: d accessing data in a heterogeneous
Explana on: A rela onal database table is environment of rela onal.
o en described as “normalized” if it is in the
Third Normal Form because most of the 3NF 10. Cursor that reflects the changes made to
tables are free of inser on, update, and the database table even a er the result set is
dele on anomalies. returned
a) Sta c
7. How inser ng data through stored b) Dynamic
procedure do reduces network traffic and c) FORWARD_ONLY
increase database performance? d) Keyset
a) Stored procedure can accept parameter
b) Permission check is not required Answer: b
c) The execu on plan is stored in the cache Explana on: A database cursor is a control
a er it was executed the first me structure that enables traversal over the
d) None of the men oned records in a database.

Answer: c
Explana on: A rela onal database table is 1. Which normal form is considered
o en described as “normalized” if it is in the adequate for normal rela onal database
Third Normal Form because most of the 3NF design?
tables are free of inser on, update, and a) 2NF
dele on anomalies. b) 5NF
c) 4NF
8. Stored procedures are safe from SQL d) 3NF
injec on a acks
a) True Answer: d
b) False Explana on: A rela onal database table is
c) Depends on the result o en described as “normalized” if it is in the
d) Always safe Third Normal Form because most of the 3NF
tables are free of inser on, update, and
Answer: a dele on anomalies.
Explana on: Injec on a ack is not possible
in SP. 2. Consider a schema R(A, B, C, D) and
func onal dependencies A -> B and C -> D.
9. Which of the following connec on type Then the decomposi on of R into R1 (A, B)
supports applica on role permissions and and R2(C, D) is
password encryp on? a) dependency preserving and lossless join
a) OLE DB b) lossless join but not dependency
b) DBLib preserving
c) ODBC c) dependency preserving but not lossless
d) OLE DB and ODBC join
d) not dependency preserving and not
lossless join

www.studymaterialz.in 104
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: d Answer: a
Explana on: While decomposing a rela onal Explana on: Since the primary key is not
table we must verify the following proper es: given we have to derive the primary key of
i) Dependency Preserving Property the table. Using the closure set of a ributes
ii) Lossless-Join Property. we get the primary key as (F1,F2). From
func onal dependencies, “F1->F3, F2->F4”,
3. Rela on R with an associated set of we can see that there is par al func onal
func onal dependencies, F, is decomposed dependency therefore it is not in 1NF. Hence
into BCNF. The redundancy (arising out of the table is in 1NF.
func onal dependencies) in the resul ng set
of rela ons is 6. Which of the following is TRUE?
a) Zero a) Every rela on in 2NF is also in BCNF
b) More than zero but less than that of an b) A rela on R is in 3NF if every non-prime
equivalent 3NF decomposi on a ribute of R is fully func onally dependent
c) Propor onal to the size of F+ on every key of R
d) Indeterminate c) Every rela on in BCNF is also in 3NF
d) No rela on can be in both BCNF and 3NF
Answer: b
Explana on: Redundancy in BCNF is low Answer: c
when compared to 3NF. Explana on: A rela onal database table is
o en described as “normalized” if it is in the
4. Which one of the following statements Third Normal Form because most of the 3NF
about normal forms is FALSE? tables are free of inser on, update, and
a) BCNF is stricter than 3NF dele on anomalies.
b) Lossless, dependency-preserving
decomposi on into 3NF is always possible 7. Consider the following func onal
c) Lossless, dependency-preserving dependencies in a database.
decomposi on into BCNF is always possible
d) Any rela on with two a ributes is in BCNF Date_of_Birth->Age Age->Eli
gibility
Name->Roll_number Roll_num
Answer: c ber->Name
Explana on: Achieving Lossless and Course_number->Course_name Course_n
dependency-preserving decomposi on umber->Instructor
(Roll_number, Course_number)->Grade
property into BCNF is difficult.
The rela on (Roll_number, Name,
5. A table has fields F1, F2, F3, F4, and F5,
Date_of_birth, Age) is
with the following func onal dependencies:
a) In second normal form but not in third
F1->F3 normal form
F2->F4 b) In third normal form but not in BCNF
(F1,F2)->F5 c) In BCNF
d) None of the men oned
in terms of normaliza on, this table is in
a) 1NF Answer: d
b) 2NF Explana on: For the given rela on only
c) 3NF some of the above FDs are applicable. The
d) None of the men oned

www.studymaterialz.in 105
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

applicable FDs are given below: Answer: b


Date_of_Birth->Age Explana on: Empcode is unique, therefore it
Name->Roll_number is the primary key. Since the primary key
Roll_number->Name consists of a single a ribute there will be no
Finding the closure set of a ributes we get par al dependency, hence the rela on is in
the candidate keys: 2NF.
(Roll_number,Date_of_Birth), and From the ques on we get the FDs as below:
(Name,Date_of_Birth) . pincode -> city, state
On selec ng any one of the candidate key we street,city,state -> pincode
can see that the FD Date_of_Birth->Age is a From the FDs we can see that there are
par al dependency. Hence the rela on is in transi ve dependencies, hence the table is
1NF. not in 3NF.

8. The rela on schema Student_Performance 10. Which one of the following statements is
(name, courseNo, rollNo, grade) has the FALSE?
following FDs: a) Any rela on with two a ributes is in BCNF
b) A rela on in which every key has only one
name,courseNo->grade a ribute is in 2NF
rollNo,courseNo->grade
name->rollNo c) A prime a ribute can be transi vely
rollNo->name dependent on a key in a 3 NF rela on
d) A prime a ribute can be transi vely
The highest normal form of this rela on dependent on a key in a BCNF rela on
scheme is
a) 2NF Answer: d
b) 3NF Explana on: A table is in 3NF if and only if,
c) BCNF for each of its func onal dependencies X ->
d) 4NF A, at least one of the following condi ons
holds:
Answer: b * X contains A (that is, X -> A is trivial
Explana on: A super key is a combina on of func onal dependency), or
prime a ributes and one or more non-prime * X is a superkey, or
key a ribute(s). It also uniquely iden fies a * A should be prime a ribute.
record in a table. Primary key can be defined
as super key with minimal a ributes.
1. _______________ is a procedural
9. The rela on EMPDT1 is defined with extension of Oracle – SQL that offers
a ributes empcode(unique), name, street, language constructs similar to those in
city, state, and pincode. For any pincode, impera ve programming languages.
there is only one city and state. Also, for any a) SQL
given street, city and state, there is just one b) PL/SQL
pincode. In normaliza on terms EMPDT1 is a c) Advanced SQL
rela on in d) PQL
a) 1NF only
b) 2NF and hence also in 1NF Answer: b
c) 3NF and hence also in 2NF and 1NF Explana on: PL/SQL is an impera ve 3GL
d) BCNF and hence also in 3NF, 2NF and 1NF

www.studymaterialz.in 106
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

that was designed specifically for the b) Literals


seamless processing of SQL commands. c) Delimiters
d) Iden fiers
2. ___________ combines the data
manipula ng power of SQL with the data Answer: d
processing power of Procedural languages. Explana on: The database object name is
a) PL/SQL referred to as its iden fier.
b) SQL
c) Advanced SQL 6. A ___________________ is an explicit
d) PQL numeric, character, string or Boolean value
not represented by an iden fier.
Answer: a a) Comments
Explana on: PL/SQL is an impera ve 3GL b) Literals
that was designed specifically for the c) Delimiters
seamless processing of SQL commands. d) Iden fiers

3. _______________ has made PL/SQL code Answer: b


run faster without requiring any addi onal Explana on: The terms literal and constant
work on the part of the programmer. value are synonymous and refer to a fixed
a) SQL Server data value.
b) My SQL
c) Oracle 7. If no header is specified, the block is said
d) SQL Lite to be an _______________ PL/SQL block.
a) Strong
Answer: c b) Weak
Explana on: An Oracle database is a c) Empty
collec on of data treated as a unit. The d) Anonymous
purpose of a database is to store and retrieve
related informa on. Answer: d
Explana on: The terms literal and constant
4. A line of PL/SQL text contains groups of value are synonymous and refer to a fixed
characters known as data value.
a) Lexical Units
b) Literals 8. _________________ is a sequence of zero
c) Textual Units or more characters enclosed by single
d) Iden fiers quotes.
a) Integers literal
Answer: a b) String literal
Explana on: Lexical items can be generally c) String units
understood to convey a single meaning, d) String label
much as a lexeme, but are not limited to
single words. Answer: b
Explana on: The terms literal and constant
5. We use ______________ name PL/SQL value are synonymous and refer to a fixed
program objects and units. data value.
a) Lexical Units

www.studymaterialz.in 107
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

9. In _______________ the management of a) Begin transac on and end transac on


the password for the account can be handled b) Start transac on and stop transac on
outside of oracle such as opera ng system. c) Get transac on and post transac on
a) Database Authen ca on d) Read transac on and write transac on
b) Opera ng System Authen ca on
c) Internal Authen ca on Answer: a
d) External Authen ca on Explana on: The transac on consists of all
opera ons executed between the begin
Answer: b transac on and end transac on.
Explana on: Database management involves
the monitoring, administra on, and 3. Iden fy the characteris cs of transac ons
maintenance of the databases and database a) Atomicity
groups in your enterprise. b) Durability
c) Isola on
10. In ________________ of Oracle, the d) All of the men oned
database administrator creates a user
account in the database for each user who Answer: d
needs access. Explana on: Because of the above three
a) Database Authen ca on proper es, transac ons are an ideal way of
b) Opera ng System Authen ca on structuring interac on with a database.
c) Internal Authen ca on
d) External Authen ca on 4. Which of the following has “all-or-none”
property?
Answer: a a) Atomicity
Explana on: Database management involves b) Durability
the monitoring, administra on, and c) Isola on
maintenance of the databases and database d) All of the men oned
groups in your enterprise.
Answer: a
Explana on: Either all opera ons of the
1. Consider money is transferred from transac on are reflected properly in the
(1)account-A to account-B and (2) account-B database, or none are.
to account-A. Which of the following form a
transac on? 5. The database system must take special
a) Only 1 ac ons to ensure that transac ons operate
b) Only 2 properly without interference from
c) Both 1 and 2 individually concurrently execu ng database statements.
d) Either 1 or 2 This property is referred to as
a) Atomicity
Answer: c b) Durability
Explana on: The term transac on refers to a c) Isola on
collec on of opera ons that form a single d) All of the men oned
logical unit of work.
Answer: c
2. A transac on is delimited by statements Explana on: Even though mul ple
(or func on calls) of the form __________ transac ons may execute concurrently, the

www.studymaterialz.in 108
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

system guarantees that, for every pair of 9. The Oracle RDBMS uses the ____
transac ons Ti and Tj, it appears to Ti that statement to declare a new transac on start
either Tj finished execu on before Ti started and its proper es.
or Tj started execu on a er Ti finished. a) BEGIN
b) SET TRANSACTION
6. The property of a transac on that persists c) BEGIN TRANSACTION
all the crashes is d) COMMIT
a) Atomicity
b) Durability Answer: b
c) Isola on Explana on: Commit is used to store all the
d) All of the men oned transac ons.

Answer: b 10. ____ means that the data used during the
Explana on: A er a transac on completes execu on of a transac on cannot be used by
successfully, the changes it has made to the a second transac on un l the first one is
database persist, even if there are system completed.
failures. a) Consistency
b) Atomicity
7. __________ states that only valid data will c) Durability
be wri en to the database. d) Isola on
a) Consistency
b) Atomicity Answer: d
c) Durability Explana on: Even though mul ple
d) Isola on transac ons may execute concurrently, the
system guarantees that, for every pair of
Answer: a transac ons Ti and Tj, it appears to Ti that
Explana on: If for some reason, a either Tj finished execu on before Ti started
transac on is executed that violates the or Tj started execu on a er Ti finished.
database’s consistency rules, the en re
transac on will be rolled back and the
database will be restored to a state 1. In SQL, which command is used to issue
consistent with those rules. mul ple CREATE TABLE, CREATE VIEW and
GRANT statements in a single transac on?
8. Transac on processing is associated with a) CREATE PACKAGE
everything below except b) CREATE SCHEMA
a) Producing detail summary or excep on c) CREATE CLUSTER
reports d) All of the men oned
b) Recording a business ac vity
c) Confirming an ac on or triggering a Answer: b
response Explana on: A database schema of a
d) Maintaining a data database system is its structure described in
a formal language supported by the database
Answer: c management system and refers to the
Explana on: Collec ons of opera ons that organiza on of data as a blueprint of how a
form a single logical unit of work are called database is constructed.
transac ons.

www.studymaterialz.in 109
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

2. In SQL, the CREATE TABLESPACE is used c) Insert, Update, Delete


a) To create a place in the database for d) Select, Commit
storage of scheme objects, rollback
segments, and naming the data files to Answer: c
comprise the tablespace Explana on: A database trigger is a
b) To create a database trigger procedural code that is automa cally
c) To add/rename data files, to change executed in response to certain events on a
storage par cular table or view in a database.
d) All of the men oned
6. Which is the subset of SQL commands
Answer: a used to manipulate Oracle Database
Explana on: Triggers are used to ini alize Structures, including tables?
the ac ons for an ac vity. a) Data Defini on Language
b) Data Manipula on Language
3. Which character func on can be used to c) Data Described Language
return a specified por on of a character d) Data Retrieval Language
string?
a) INSTR Answer: a
b) SUBSTRING Explana on: DDL are used to define schema
c) SUBSTR and table characters.
d) POS
7. The SQL statement SELECT
Answer: c SUBSTR(‘123456789’, INSTR(‘abcabcabc’,’b’),
Explana on: SUBSTR are used to match the 4) FROM EMP; prints
par cular characters in a string. a) 6789
b) 2345
4. Which of the following is TRUE for the c) 1234
System Variable $date$? d) 456789
a) Can be assigned to a global variable
b) Can be assigned to any field only during Answer: b
design me Explana on: SUBSTR are used to match the
c) Can be assigned to any variable or field par cular characters in a string.
during run me
d) Can be assigned to a local variable 8. Which of the following SQL command can
be used to modify exis ng data in a database
Answer: b table?
Explana on: A database schema of a a) MODIFY
database system is its structure described in b) UPDATE
a formal language supported by the database c) CHANGE
management system and refers to the d) NEW
organiza on of data as a blueprint of how a
database is constructed. Answer: b
Explana on: Syntax : UPDATE table_name
5. What are the different events in Triggers? SET column1=value1,column2=value2,…
a) Define, Create WHERE some_column=some_value; .
b) Drop, Comment

www.studymaterialz.in 110
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

9. When SQL statements are embedded 2. Storage devices like ter ary storage,
inside 3GL, we call such a program as magne c disk comes under
a) Nested query a) Vola le storage
b) Nested programming b) Non-vola le storage
c) Dis nct query c) Stable storage
d) Embedded SQL d) Dynamic storage

Answer: d Answer: b
Explana on: SQL-99 is the most recent Explana on: Informa on residing in
version of standard SQL prescribed by the nonvola le storage survives system crashes.
ANSI.
3. For a transac on to be durable, its changes
10. _______________ provides op on for need to be wri en to ________ storage.
entering SQL queries as execu on me, a) Vola le storage
rather than at the development stage. b) Non-vola le storage
a) PL/SQL c) Stable storage
b) SQL*Plus d) Dynamic storage
c) SQL
d) Dynamic SQL Answer: c
Explana on: Similarly, for a transac on to be
Answer: d atomic, log records need to be wri en to
Explana on: Dynamic SQL enables you to stable storage before any changes are made
write programs that reference SQL to the database on disk.
statements whose full text is not known un l
run me. 4. The unit of storage that can store one are
more records in a hash file organiza on are
a) Buckets
b) Disk pages
c) Blocks
d) Nodes
UNIT V ADVANCED TOPICS
Answer: a
1. The storage structure which do not survive Explana on: Buckets are used to store one
system crashes are ______ or more records in a hash file organiza on.
a) Vola le storage
b) Non-vola le storage 5. A ______ file system is so ware that
c) Stable storage enables mul ple computers to share file
d) Dynamic storage storage while maintaining consistent space
alloca on and file content.
Answer: a a) Storage
Explana on: Vola le storage, is a computer b) Ter ary
memory that requires power to maintain the c) Secondary
stored informa on, in other words it needs d) Cluster
power to reach the computer memory.
Answer: d
Explana on: With a cluster file system, the

www.studymaterialz.in 111
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

failure of a computer in the cluster does not in a hierarchical network flow.


make the file system unavailable.
10. The process of saving informa on onto
6. A file produced by a spreadsheet secondary storage devices is referred to as
a) is generally stored on disk in an ASCII text a) Backing up
format b) Restoring
b) can be used as is by the DBMS c) Wri ng
c) all of the men oned d) Reading
d) none of the men oned
Answer: c
Answer: a Explana on: The informa on is wri en into
Explana on: ASCII text format uses the the secondary storage device.
standard text file for the changing the value.

7. SDL means _____________ 1. A transac on may not always complete its


a) Storage Discrete Language execu on successfully. Such a transac on is
b) Storage Defini on Language termed
c) Storage Defini on Localisa on a) Aborted
d) Storage Discrete Localisa on b) Terminated
c) Closed
Answer: b d) All of the men oned
Explana on: It specifies internal schema and
also mapping between two schemas. Answer: a
Explana on: If we are to ensure the
8. Which of the following are the process of atomicity property, an aborted transac on
selec ng the data storage and data access must have no effect on the state of the
characteris cs of the database? database.
a) Logical database design
b) Physical database design 2. If an transac on is performed in a
c) Tes ng and performance tuning database and commi ed, the changes are
d) Evalua on and selec ng taken to the previous state of transac on by
a) Flashback
Answer: b b) Rollback
Explana on: Physical database design is the c) Both Flashback and Rollback
process of selec ng the data storage and d) Cannot be done
data access characteris cs of the database.
Answer: d
9. Which of the following is the oldest Explana on: Once commi ed the changes
database model? cannot be rolled back.
a) Rela onal
b) Hierarchical 3. Each modifica on done in database
c) Physical transac on are first recorded into the
d) Network a) Harddrive
b) Log
Answer: d c) Disk
Explana on: Network model has data stored d) Datamart

www.studymaterialz.in 112
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: b c) Atomic state


Explana on: A er commit is issued the data d) Inconsistent state
are stored in a database and stored in drive.
Answer: d
4. When the transac on finishes the final Explana on: If the state of the database no
statement the transac on enters into longer reflects a real state of the world that
a) Ac ve state the database is supposed to capture, then
b) Commi ed state such a state is called in a consistent state.
c) Par ally commi ed state
d) Abort state 8. _______ means that data used during the
execu on of a transac on cannot be used by
Answer: c a second transac on un l the first one is
Explana on: The commit statement has to completed.
be issued to enter into commi ed state. a) Serializability
b) Atomicity
5. The name of the transac on file shall be c) Isola on
provided by the operator and the file that d) Time stamping
contains the edited transac ons ready for
execu on shall be called Answer: c
a) Batch. Exe Explana on: Isola on means that data used
b) Trans. Exe during the execu on of a transac on can’t be
c) Opt. Exe used by a second transac on un l the first
d) Edit.Exe one is completed.

Answer: c 9. DBMS periodically suspends all processing


Explana on: Transac ons has to be managed and synchronizes its files and journals
by the executable files. through the use of
a) Checkpoint facility
6. Which of the following is an atomic b) Backup facility
sequence of database ac ons? c) Recovery manager
a) Transac on d) Database change log
b) Concurrency
c) Rela ons Answer: a
d) All of the men oned Explana on: DBMS periodically suspends all
processing and synchronizes its files and
Answer: a journals though the use of Check point
Explana on: Transac on is a collec on of facility.
opera ons that provides single logical
func on in database. 10. Which of the following is not a state in
transac on?
7. If the state of the database no longer a) Ac ve
reflects a real state of the world that the b) Terminated
database is supposed to capture, then such a c) Aborted
state is called d) Par ally commi ed
a) Consistent state
b) Parallel state

www.studymaterialz.in 113
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: b b) Delete database_name


Explana on: The transac on states are c) drop database database_name
abort, ac ve, commi ed, par ally d) drop database_name
commi ed, Failed.
Answer: c
Explana on: This will delete the database
1. _______________ joins are SQL server with its structure.
default
a) Outer 5. ____________ is a combina on of two of
b) Inner more a ributes used as a primary key
c) Equi a) Composite Key
d) None of the Men oned b) Alternate Key
c) Candidate Key
Answer: b d) Foreign Key
Explana on: Inner query joins only the rows
that are matching. Answer: a
Explana on: Primary keys together form the
2. The ________________ is essen ally used composite key.
to search for pa erns in target string.
a) Like Predicate 6. Which of the following is not the func on
b) Null Predicate of client?
c) In Predicate a) Compile queries
d) Out Predicate b) Query op miza on
c) Receive queries
Answer: a d) Result forma ng and presenta on
Explana on: Like matches the pa ern with
the query. Answer: b
Explana on: Query op miza on is used to
3. Which of the following is/are the Database improve quality.
server func ons?
i) Data management 7. ____________ is a special type of stored
ii) Transac on management procedure that is automa cally invoked
iii) Compile queries whenever the data in the table is modified.
iv) Query op miza on a) Procedure
a) i, ii, and iv only b) Trigger
b) i, ii and iii only c) Curser
c) ii, iii and iv only d) None of the Men oned
d) All i, ii, iii, and iv
Answer: b
Answer: a Explana on: Triggers are used to ini ate an
Explana on: All these are func ons of the ac on to take place.
database.
8. ______________ requires that data should
4. To delete a database ___________ be made available to only authorized users.
command is used a) Data integrity
a) Delete database database_name b) Privacy

www.studymaterialz.in 114
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Security 2. Which is primarily the result of a thorough


d) None of the Men oned understanding of informa on about an
enterprise:
Answer: c a) Data
Explana on: Some algorithms may be used b) Database
for the security. c) Database design
d) Data modeling
9. Some of the u li es of DBMS are
_____________ Answer: d
i) Loading ii) Backup iii) File organiza on iv) Explana on: Data modelling designs the data
Process Organiza on in a secured manner.
a) i, ii, and iv only
b) i, ii and iii only 3. McFadden has defined normaliza on in his
c) ii, iii and iv only which book___________
d) All i, ii, iii, and iv a) Database modern management
b) Management database of modern
Answer: b c) Modern database management
Explana on: Processing is not the a u lity in d) Database management
dbms.
Answer: c
10. ____________ allows individual row Explana on: SQL-99 is the most recent
opera on to be performed on a given result version of standard SQL prescribed by the
set or on the generated by a selected by a ANSI.
selected statement.
a) Procedure 4. The database design prevents some data
b) Trigger from being represented due to _______
c) Curser a) Dele on anomalies
d) None of the Men oned b) Inser on anomalies
c) Update anomaly
Answer: c d) None of the men oned
Explana on: Triggers are used to ini ate an
ac on to take place. Answer: b
Explana on: Inser on anomaly is due to
confusion in data dele on or inser on.
1. Which s essen al a business problem not a
data problem: 5. How many types of inser on anomalies:
a) Data a) 1
b) Database b) 2
c) Database design c) 3
d) All of the men oned d) 4

Answer: c Answer: b
Explana on: SQL-99 is the most recent Explana on: Inser on anomaly is due to
version of standard SQL prescribed by the confusion in data dele on or inser on.
ANSI.

www.studymaterialz.in 115
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

6. Who developed the normaliza on process: 10. Which formal method that locates and
a) E.F. codd analyses rela on schemas on the basis of
b) F.F. codd their primary, candidate keys, and the FD’s
c) E.E. codd that are present among the a ributes of
d) None of the men oned these schemas:
a) Func onal dependency
Answer: a b) Database modeling
Explana on: Normaliza on helps in c) Normaliza on
improving the quality of the data. d) Decomposi on

7. E.F.Codd developed the normaliza on Answer: c


process in the which early: Explana on: Normaliza on helps in
a) 1969 improving the quality of the data.
b) 1970
c) 1971
d) 1972 1. Which is refers to a stalemate situa on
due to which no further progress is possible
Answer: b as computer await response of each other:
Explana on: Normaliza on helps in a) Concurrency
improving the quality of the data. b) Deadlock
c) Backup
8. Which is a bo om-up approach to d) Recovery
database design that design by examining the
rela onship between a ributes: Answer: b
a) Func onal dependency Explana on: Deadlock will stop further
b) Database modeling processing.
c) Normaliza on
d) Decomposi on 2. Which is a duplicate copy of a file program
that is stored on a different storage media
Answer: c than the original loca on:
Explana on: Normaliza on helps in a) Concurrency
improving the quality of the data. b) Deadlock
c) Backup
9. Which is the process of breaking a rela on d) Recovery
into mul ple rela ons:
a) Func onal dependency Answer: c
b) Database modeling Explana on: Backup is required to take all
c) Normaliza on the data.
d) Decomposi on
3. Which is the duplica on of computer
Answer: d opera ons and rou ne backups to combat
Explana on: SQL-99 is the most recent any unforeseen problems:
version of standard SQL prescribed by the a) Concurrency
ANSI. b) Deadlock
c) Backup
d) Recovery

www.studymaterialz.in 116
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: d Answer: b
Explana on: Recovery means to take the Explana on: Backup is required to take all
backup data while there is a crash. the data.

4. Op miza on that is basically related to the 8. How many types of recovery control
rewriter module is termed as__________ techniques:
a) Seman c query op miza on a) 2
b) Global query op miza on b) 3
c) All of the Men oned c) 4
d) None of the Men oned d) 5

Answer: a Answer: a
Explana on: SQL-99 is the most recent Explana on: Recovery means to take the
version of standard SQL prescribed by the backup data while there is a crash.
ANSI.
9. Which are types of recovery control
5. Op miza on basically related to the techniques:
Rewrite module is termed as_______ a) Deferred update
a) Seman c query op miza on b) Immediate update
b) Global query op miza on c) All of the Men oned
c) All of the Men oned d) None of the Men oned
d) None of the Men oned
Answer: c
Answer: a Explana on: Recovery means to take the
Explana on: SQL-99 is the most recent backup data while there is a crash.
version of standard SQL prescribed by the
ANSI. 10. Which server can join the indexes when
only mul ple indexes combined can cover
6. Database security helps organiza ons to the query:
protect data from _____ a) SQL
a) Internal users b) DBMS
b) External users c) RDBMS
c) Non-external users d) All of the men oned
d) Non internal users
Answer: a
Answer: b Explana on: Indexing reduces the difficulty
Explana on: External users are the people in searching the data.
who do not involve in the processing of the
database.
1. In concurrency control policy the lock is
7. Copying files to secondary or specific obtained on
devices is known as ______ a) En re database
a) Retrieve b) A par cular transac on alone
b) Backup c) All the new elements
c) Recovery d) All of the men oned
d) Deadlock

www.studymaterialz.in 117
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a CREATE VIEW empvu


AS
Explana on: It is to avoid deadlock. SELECT * FROM empdept;

2. A concurrency-control policy such as this d)


one leads to ______ performance since it
forces transac ons to wait for preceding CREATE INDEX
transac ons to finish before they can start. empdet_idx
ON empdet(empno);
a) Good
b) Average Answer: c
c) Poor Explana on: View is the temporary space
d) Unstable created for the database.
Answer: c
Explana on: It provides a poor degree of
concurrency. 5. In which scenario would you use the
ROLLUP operator for expression or columns
3. __________ are used to ensure that
within a GROUP BY clause?
transac ons access each data item in order
a) To find the groups forming the subtotal in
of the transac ons’ ____ if their accesses
a row
conflict.
b) To create group-wise grand totals for the
a) Zone
groups specified within a GROUP BY clause
b) Relay
c) To create a grouping for expressions or
c) Line
columns specified within a GROUP BY clause
d) Timestamps
in one direc on, from right to le for
calcula ng the subtotals
Answer: d
d) To create a grouping for expressions or
Explana on: When this is not possible,
columns specified within a GROUP BY clause
offending transac ons are aborted and
in all possible direc ons, which is cross-
restarted with a new mestamp.
tabular report for calcula ng the subtotals
4. EMPDET is an external table containing the
Answer: c
columns EMPNO and ENAME. Which
command would work in rela on to the Explana on: View is the temporary space
EMPDET table? created for the database.
a) 6.
UPDATE empdet
SET ename = 'Amit' Name Null? Type
WHERE empno = 1234;
Cust_id Not null Number(2)
b) Cust_Name Varchar2(15)

DELETE FROM empdet Evaluate the following SQL statements


WHERE ename LIKE 'J%'; executed in the given order:
c) ALTER TABLE cust
ADD CONSTRAINT cust_id_pk PRIMARY KEY(cus
t_id) DEFERRABLE INITIALLY DEFERRED; INSE

www.studymaterialz.in 118
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

RT d) A set of one or more sequen al queries in


INTO cust VALUES (1,'RAJ'); --row 1
INSERT INTO cust VALUES (1,'SAM'); --row
which generally the result of the inner query
2 is used as the search value in the outer query
COMMIT;
SET CONSTRAINT cust_id_pk IMMEDIATE; Answer: d
INSERT INTO cust VALUES (1,'LATA'); --row Explana on: This will replicate the table as in
3
INSERT INTO cust VALUES (2,'KING'); --row the select statement.
4
COMMIT; 9. Evaluate the following SQL statements in
the given order:
Which rows would be made permanent in
the CUST table? DROP TABLE dept;
CREATE TABLE dept
a) row 4 only (deptno NUMBER(3) PRIMARY KEY,
b) rows 2 and 4 deptname VARCHAR2(10));
c) rows 3 and 4 DROP TABLE dept;
d) rows 1 and 4 FLASHBACK TABLE dept TO BEFORE DROP;

Answer: c Which statement is true regarding the above


Explana on: View is the temporary space FLASHBACK opera on?
created for the database. a) It recovers only the first DEPT table
b) It recovers only the second DEPT table
7. Which statement is true regarding external c) It does not recover any of the tables
tables? because FLASHBACK is not possible in this
a) The default REJECT LIMIT for external case
tables is UNLIMITED d) It recovers both the tables but the names
b) The data and metadata for an external would be changed to the ones assigned in
table are stored outside the database the RECYCLEBIN
c) ORACLE_LOADER and ORACLE_DATAPUMP
have exactly the same func onality when Answer: b
used with an external table Explana on: This will replicate the table as in
d) The CREATE TABLE AS SELECT statement the select statement.
can be used to unload data into regular table
10.
in the database from an external table
CREATE TABLE digits
Answer: d (id NUMBER(2),
Explana on: This will replicate the table as in description VARCHAR2(15));
the select statement. INSERT INTO digits VALUES (1,'ONE');
UPDATE digits SET description ='TWO' WHER
E id=1;
8. A non-correlated subquery can be defined INSERT INTO digits VALUES (2,'TWO');
as ______ COMMIT;
a) A set of sequen al queries, all of which DELETE FROM digits;
must always return a single value SELECT description FROM digits
VERSIONS BETWEEN TIMESTAMP MINVALUE AND M
b) A set of sequen al queries, all of which AXVALUE;
must return values from the same table
c) A SELECT statement that can be embedded What would be the outcome of the above
in a clause of another SELECT statement only query?

www.studymaterialz.in 119
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) It would not display any values against the constraint.


b) It would display the value TWO once a) CHECK, FOREIGN KEY
c) It would display the value TWO twice b) DELETE, FOREIGN KEY
d) It would display the values ONE, TWO, and c) CHECK, PRIMARY KEY
TWO d) PRIMARY KEY, FOREIGN KEY

Answer: c Answer: a
Explana on: This will replicate the table as in Explana on: Check and foreign constraints
the select statement. are used to constraint the table data.

5. Problems occurs if we don’t implement a


1. Which of the following is not a property of proper locking strategy
transac ons? a) Dirty reads
a) Atomicity b) Phantom reads
b) Concurrency c) Lost updates
c) Isola on d) Unrepeatable reads
d) Durability
Answer: d
Answer: d Explana on: In a concurrent execu on of
Explana on: ACID proper es are the these transac ons, it is intui vely clear that
proper es of transac ons. they conflict, but this is a conflict not
captured by our simple model. This situa on
2. SNAPSHOT is used for (DBA) is referred to as the phantom phenomenon,
a) Synonym because a conflict may exist on “phantom”
b) Tablespace data.
c) System server
d) Dynamic data replica on 6. Which of the following fixed database roles
can add or remove user IDs?
Answer: d a) db_accessadmin
Explana on: Snapshot gets the instance of b) db_securityadmin
the database at that me. c) db_setupadmin
d) db_sysadmin
3. Isola on of the transac ons is ensured by
a) Transac on management Answer: a
b) Applica on programmer Explana on: The database can be accessed
c) Concurrency control by assigning the roles.
d) Recovery management
7. By default sql server has ___________
Answer: c isola on level
Explana on: ACID proper es are the a) READ COMMITTED
proper es of transac ons. b) READ UNCOMMITTED
c) SERIALIZABLE
4. Constraint checking can be disabled in d) REPEATABLE READ
exis ng _______________ and
_____________ constraints so that any data Answer: a
you modify or add to the table is not checked Explana on: Read commi ed is used to

www.studymaterialz.in 120
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

commit the default read opera on. a) Triggers


b) Pointers
8. Which of the following statements is/are c) Locks
not true for SQL profiler? d) Cursors
a) Enables you to monitor events
b) Check if rows are being inserted properly Answer: c
c) Check the performance of a stored Explana on: Locks are used to maintain
procedure database consistency.
d) ALL of the men oned
2. A lock that allows concurrent transac ons
Answer: c to access different rows of the same table is
Explana on: Read commi ed is used to known as a
commit the default read opera on. a) Database-level lock
b) Table-level lock
9. Which of the following is the original c) Page-level lock
purpose of SQL? d) Row-level lock
a) To specify the syntax and seman cs of SQL
data defini on language Answer: d
b) To specify the syntax and seman cs of SQL Explana on: Locks are used to maintain
manipula on language database consistency.
c) To define the data structures
d) All of the men oned 3. Which of the following are introduced to
reduce the overheads caused by the log-
Answer: d based recovery?
Explana on: Read commi ed is used to a) Checkpoints
commit the default read opera on. b) Indices
c) Deadlocks
10. SQL can be used to: d) Locks
a) Create database structures only
b) Query database data only Answer: a
c) Modify database data only Explana on: Checkpoints are introduced to
d) All of the men oned reduce overheads caused by the log-based
recovery.
Answer: d
Explana on: In a concurrent execu on of 4. Which of the following protocols ensures
these transac ons, it is intui vely clear that conflict serializability and safety from
they conflict, but this is a conflict not deadlocks?
captured by our simple model. This situa on a) Two-phase locking protocol
is referred to as the phantom phenomenon, b) Time-stamp ordering protocol
because a conflict may exist on “phantom” c) Graph based protocol
data. d) None of the men oned

Answer: b
1. In order to maintain transac onal integrity Explana on: Time-stamp ordering protocol
and database consistency, what technology ensures conflict serializability and safety from
does a DBMS deploy? deadlocks.

www.studymaterialz.in 121
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

5. Which of the following is the block that is b) DBMS


not permi ed to be wri en back to the disk? c) Lock manager
a) Dead code d) Locking agent
b) Read only
c) Pinned Answer: c
d) Zapped Explana on: A distributed lock manager
(DLM) provides distributed so ware
Answer: c applica ons with a means to synchronize
Explana on: A block that is not permi ed to their accesses to shared resources.
be wri en back to the disk is called pinned.
9. The ____ lock allows concurrent
6. If transac on Ti gets an explicit lock on the transac ons to access the same row as long
file Fc in exclusive mode, then it has an - as they require the use of different fields
__________ on all the records belonging to within that row.
that file. a) Table-level
a) Explicit lock in exclusive mode b) Page-level
b) Implicit lock in shared mode c) Row-level
c) Explicit lock in shared mode d) Field-level
d) Implicit lock in exclusive mode
Answer: d
Answer: d Explana on: Lock is limited to the a ributes
Explana on: If transac on Ti gets an explicit of the rela on.
lock on the file Fc in exclusive mode, then it
has an implicit lock in exclusive mode on all 10. Which of the following is a procedure for
the records belonging to that file. acquiring the necessary locks for a
transac on where all necessary locks are
7. Which refers to a property of computer to acquired before any are released?
run several opera on simultaneously and a) Record controller
possible as computers await response of b) Exclusive lock
each other c) Authoriza on rule
a) Concurrency d) Two phase lock
b) Deadlock
c) Backup Answer: d
d) Recovery Explana on: Two-phase lock is a procedure
for acquiring the necessary locks for a
Answer: a transac on where all necessary locks are
Explana on: Concurrency is a property of acquired before any are released.
systems in which several computa ons are
execu ng simultaneously, and poten ally
interac ng with each other. 1. A system is in a ______ state if there exists
a set of transac ons such that every
8. All lock informa on is managed by a transac on in the set is wai ng for another
__________ which is responsible for transac on in the set.
assigning and policing the locks used by the a) Idle
transac ons. b) Wai ng
a) Scheduler

www.studymaterialz.in 122
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Deadlock Answer: a
d) Ready Explana on: The wait–die scheme is a non-
preemp ve technique.
Answer: c
Explana on: When one data item is wai ng 5. When transac on Ti requests a data item
for another data item in a transac on then currently held by Tj, Ti is allowed to wait only
system is in deadlock. if it has a mestamp larger than that of Tj
(that is, Ti is younger than Tj ). Otherwise, Tj
2. The deadlock state can be changed back to is rolled back (Tj is wounded by Ti). This is
stable state by using _____________ a) Wait-die
statement. b) Wait-wound
a) Commit c) Wound-wait
b) Rollback d) Wait
c) Savepoint
d) Deadlock Answer: c
Explana on: The wound–wait scheme is a
Answer: b preemp ve technique. It is a counterpart to
Explana on: Rollback is used to rollback to the wait–die scheme.
the point before lock is obtained.
6. The situa on where the lock waits only for
3. What are the ways of dealing with a specified amount of me for another lock
deadlock? to be released is
a) Deadlock preven on a) Lock meout
b) Deadlock recovery b) Wait-wound
c) Deadlock detec on c) Timeout
d) All of the men oned d) Wait

Answer: d Answer: a
Explana on: Deadlock preven on is also Explana on: The meout scheme is
called as deadlock recovery. Preven on is par cularly easy to implement, and works
commonly used if the probability that the well if transac ons are short and if longwaits
system would enter a deadlock state is are likely to be due to deadlocks.
rela vely high; otherwise, detec on and
recovery are more efficient. 7. The deadlock in a set of a transac on can
be determined by
4. When transac on Ti requests a data item a) Read-only graph
currently held by Tj, Ti is allowed to wait only b) Wait graph
if it has a mestamp smaller than that of Tj c) Wait-for graph
(that is, Ti is older than Tj). Otherwise, Ti is d) All of the men oned
rolled back (dies). This is
a) Wait-die Answer: a
b) Wait-wound Explana on: Each transac on involved in the
c) Wound-wait cycle is said to be deadlocked.
d) Wait
8. A deadlock exists in the system if and only
if the wait-for graph contains a ___________

www.studymaterialz.in 123
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Cycle c) File
b) Direc on d) Record
c) Bi-direc on
d) Rota on Answer: a
Explana on: This level is the root of the tree.
Answer: a
Explana on: Each transac on involved in the 2. In a database the file is contained in
cycle is said to be deadlocked. ________
a) En re database
9. Selec ng the vic m to be rollbacked to the b) Two area
previous state is determined by the minimum c) One area
cost. The factors determining cost of rollback d) more than one area
is
a) How long the transac on has computed, Answer: c
and how much longer the transac on will Explana on: This level is below the root of
compute before it completes its designated the tree.
task
b) How many data items the transac on has 3. If a node is locked in an inten on mode,
used explicit locking is done at a lower level of the
c) How many more data items the tree. This is called
transac on needs for it to complete a) Inten on lock modes
d) All of the men oned b) Explicit lock
c) Implicit lock
Answer: d d) Exclusive lock
Explana on: We should roll back those
transac ons that will incur the minimum Answer: a
cost. Explana on: There is an inten on mode
associated with shared mode, and there is
10. __________ rollback requires the system one with an exclusive mode.
to maintain addi onal informa on about the
state of all the running transac ons. 4. If a node is locked in __________ explicit
a) Total locking is being done at a lower level of the
b) Par al tree, but with only shared-mode locks.
c) Time a) Inten on lock modes
d) Commit b) Inten on-shared-exclusive mode
c) Inten on-exclusive (IX) mode
Answer: b d) Inten on-shared (IS) mode
Explana on: In total rollback abort the
transac on and then restart it. Answer: a
Explana on: There is an inten on mode
associated with shared mode, and there is
1. In a granularity hierarchy the highest level one with an exclusive mode.
represents the
a) En re database 5. If a node is locked in ____________ then
b) Area explicit locking is being done at a lower level,
with exclusive-mode or shared-mode locks.

www.studymaterialz.in 124
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Inten on lock modes Answer: a


b) Inten on-shared-exclusive mode Explana on: The most common method for
c) Inten on-exclusive (IX) mode doing ordering transac on is to use a
d) Inten on-shared (IS) mode mestamp-ordering scheme.

Answer: c 9. The __________ requires that each


Explana on: There is an inten on mode transac on Ti executes in two or three
associated with shared mode, and there is different phases in its life me, depending on
one with an exclusive mode. whether it is a read-only or an update
transac on.
6. If a node is locked in ______________ the a) Valida on protocol
subtree rooted by that node is locked b) Valida on-based protocol
explicitly in shared mode, and that explicit c) Timestamp protocol
locking is being done at a lower level with d) Timestamp-ordering protocol
exclusive-mode locks.
a) Inten on lock modes Answer: a
b) shared and inten on-exclusive (SIX) mode Explana on: A concurrency-control scheme
c) Inten on-exclusive (IX) mode imposes the overhead of code execu on and
d) Inten on-shared (IS) mode possible delay of transac ons. It may be
be er to use an alterna ve scheme that
Answer: b imposes less overhead.
Explana on: There is an inten on mode
associated with shared mode, and there is 10. This valida on scheme is called the
one with an exclusive mode. _________ scheme since transac ons
execute op mis cally, assuming they will be
7. ____________ denotes the largest able to finish execu on and validate at the
mestamp of any transac on that executed end.
write(Q) successfully. a) Valida on protocol
a) W- mestamp(Q) b) Valida on-based protocol
b) R- mestamp(Q) c) Timestamp protocol
c) RW- mestamp(Q) d) Op mis c concurrency-control
d) WR- mestamp(Q)
Answer: a
Answer: a Explana on: A concurrency-control scheme
Explana on: The most common method for imposes the overhead of code execu on and
doing ordering transac on is to use a possible delay of transac ons. It may be
mestamp-ordering scheme. be er to use an alterna ve scheme that
imposes less overhead.
8. The _____________ ensures that any
conflic ng read and write opera ons are
executed in mestamp order. 1. The most recent version of standard SQL
a) Timestamp-ordering protocol prescribed by the American Na onal
b) Timestamp protocol Standards Ins tute is
c) W- mestamp a) SQL 2016
d) R- mestamp b) SQL 2002

www.studymaterialz.in 125
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) SQL – 4 Answer: d
d) SQL2 Explana on: Deadlock occurs when two
transac ons wait for each other to unlock
Answer: a data.
Explana on: SQL-2016 is the most recent
version of standard SQL prescribed by the 5. _______ means that data used during the
ANSI. execu on of a transac on cannot be used by
a second transac on un l the first one is
2. ANSI-standard SQL allows the use of completed.
special operators in conjunc on with the a) Serializability
WHERE clause. A special operator used to b) Atomicity
check whether an a ribute value is null is c) Isola on
a) BETWEEN d) Time stamping
b) IS NULL
c) LIKE Answer: c
d) IN Explana on: Isola on means that data used
during the execu on of a transac on can’t be
Answer: b used by a second transac on un l the first
Explana on: Exists is used to check whether one is completed.
an a ribute value is null or not in conjunc on
with the where clause. 6. A unit of storage that can store one or
more records in a hash file organiza on is
3. A lock that prevents the use of any tables denoted as
in the database from one transac on while a) Buckets
another transac on is being processed is b) Disk pages
called a c) Blocks
a) Database-level lock d) Nodes
b) Table-level lock
c) Page-level lock Answer: a
d) Row-level lock Explana on: Buckets are used to store one
or more records in a hash file organiza on.
Answer: a
Explana on: Data base-level lock prevents 7. The file organiza on which allows us to
the use of any tables in the data base from read records that would sa sfy the join
one transac on while another transac on is condi on by using one block read is
being processed. a) Heap file organiza on
b) Sequen al file organiza on
4. A condi on that occurs when two c) Clustering file organiza on
transac ons wait for each other to unlock d) Hash files organiza on
data is known as a(n)
a) Shared lock Answer: c
b) Exclusive lock Explana on: Clustering file organiza on
c) Binary lock allows us to read records that would sa sfy
d) Deadlock the join condi on by using one block read.

www.studymaterialz.in 126
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

8. Which of the following is not true about B+ c) Redirec on


trees? d) Repe on-allowance
a) B+ tree index takes the form of balanced
tree Answer: a
b) Performance of B+ tree degrades as the Explana on: It has gained wide acceptance
file grows in commercial and open-source systems,
c) Look-up in B+ tree is straigh orward and including Oracle, PostgreSQL, and SQL Server.
efficient
d) Inser on and dele on in B+ tree is 2. Snapshot isola on is used to give
complicated but efficient a) Transac on a snapshot of the database
b) Database a snapshot of the transac on
Answer: b c) Database a snapshot of commi ed values
Explana on: The answer is evident. in the transac on
d) Transac on a snapshot of the database
9. The extent of the database resource that is and Database a snapshot of commi ed
included with each lock is called the level of values in the transac on
a) Impact
b) Granularity Answer: d
c) Management Explana on: The data values in the snapshot
d) DBMS control consist only of values wri en by commi ed
transac ons.
Answer: b
Explana on: The extent of the data base 3. Lost update problem is
resource that is included with each lock is a) Second update overwrites the first
called the level of Granularity. b) First update overwrites the second
c) The updates are lost due to conflic ng
10. DBMS periodically suspends all problem
processing and synchronizes its files and d) None of the men oned
journals through the use of
a) Checkpoint facility Answer: a
b) Backup facility Explana on: Lost update problem has to be
c) Recovery manager resolved.
d) Database change log
4. Under first updater wins the system uses a
Answer: a __________ mechanism that applies only to
Explana on: DBMS periodically suspends all updates.
processing and synchronizes its files and a) Close
journals through the use of Check point b) Read
facility. c) Locking
d) Beat

1. Snapshot isola on is a par cular type of Answer: c


______________ scheme. Explana on: Reads are unaffected by this,
a) Concurrency-control since they do not obtain locks.
b) Concurrency-allowance

www.studymaterialz.in 127
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

5. When a transac on Ti a empts to update Which statement is true regarding the


a data item, it requests a _________ on that PROD_ID_PK constraint?
data item. a) It would be created only if a unique index
a) Read lock is manually created first
b) Update lock b) It would be created and would use an
c) Write lock automa cally created unique index
d) Chain lock c) It would be created and would use an
automa cally created no unique index
Answer: c d) It would be created and remains in a
Explana on: Reads are unaffected by this, disabled state because no index is specified
since they do not obtain locks. in the command

6. Each of a pair of transac ons has read data Answer: b


that is wri en by the other, but there is no Explana on: Syntax: create table
data wri en by both transac ons, is referred table_name(name constraint).
to as
a) Read skew 9. Evaluate the following CREATE SEQUENCE
b) Update skew statement:
c) Write lock
d) None of the men oned CREATE SEQUENCE seq1
START WITH 100
INCREMENT BY 10
Answer: d MAXVALUE 200
Explana on: Write skew is the issue CYCLE
addressed here. NOCACHE;

7. An applica on developer can guard against The sequence SEQ1 has generated numbers
certain snapshot anomalies by appending a up to the maximum limit of 200. You issue
______ clause to the SQL select query. the following SQL statement:
a) For update SELECT seq1.nextval FROM dual;
b) For read What is displayed by the SELECT statement?
c) For write a) 1
d) None of the men oned b) 10
c) 100
Answer: a d) an error
Explana on: Adding the for update clause
causes the system to treat data that are read Answer: a
as if they had been updated for purposes of Explana on: Sequence is used to generate a
concurrency control. series of values.

8. Evaluate the CREATE TABLE statement: 10. In which scenario would you use the
ROLLUP operator for expression or columns
CREATE TABLE products within a GROUP BY clause?
(product_id NUMBER(6) CONSTRAINT prod_id_ a) To find the groups forming the subtotal in
pk PRIMARY KEY, product_name VARCHAR2(15)
); a row
b) To create group-wise grand totals for the
groups specified within a GROUP BY clause

www.studymaterialz.in 128
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) To create a grouping for expressions or The DELETE statement results in the


columns specified within a GROUP BY clause following error:
in one direc on, from ERROR at line 1: table or view does not exist
right to le for calcula ng the subtotals What would be the outcome?
d) To create a grouping for expressions or a) All the statements before the DELETE
columns specified within a GROUP BY clause statement would be rolled back
in all possible b) All the statements before the DELETE
direc ons, which is cross-tabular report for statement would be implicitly commi ed
calcula ng the subtotals within the session
c) All the statements up to the ALTER TABLE
Answer: c statement would be commi ed and the
Explana on: Sequence is used to generate a outcome of UPDATE statement would be
series of values. rolled back
d) All the statements up to the ALTER TABLE
statement would be commi ed and the
1. Which statements are correct regarding outcome of the UPDATE statement is
indexes? retained uncommi ed within the session
a) When a table is dropped, the
corresponding indexes are automa cally Answer: d
dropped Explana on: Commi ng a transac on refers
b) For each DML opera on performed, the to making the changes to record in the
corresponding indexes are automa cally database.
updated
c) A non-deferrable PRIMARY KEY or UNIQUE 3. Evaluate the following statements:
KEY constraint in a table automa cally
creates a unique index CREATE TABLE digits
(id NUMBER(2),
d) All of the men oned description VARCHAR2(15));
INSERT INTO digits VALUES (1,'ONE);
Answer: d UPDATE digits SET description ='TWO'WHERE
Explana on: Indexes are used to access the id=1;
INSERT INTO digits VALUES (2 ,'TWO');
data efficiently.
COMMIT;
DELETE FROM digits;
2. You executed the following SQL statements SELECT description FROM digits
in the given order: VERSIONS BETWEEN TIMESTAMP MINVALUE AND M
AXVALUE;
CREATE TABLE orders
(order_id NUMBER(3) PRIMARY KEY, What would be the outcome of the above
order_date DATE, query?
customer_idnumber(3));
a) It would not display any values
INSERT INTO orders VALUES (100,'10-mar-20 b) It would display the value TWO once
07,,222); c) It would display the value TWO twice
d) It would display the values ONE, TWO, and
ALTER TABLE orders MODIFY order_date NOT
NULL; TWO

UPDATE orders SET customer_id=333; Answer: c


Explana on: The VERSIONS BETWEEN clause
DELETE FROM order;

www.studymaterialz.in 129
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

of the SELECT statement is used to create a 2 - GRANT CREATE TABLE, SELECT


ON oe. orders TO mgr;
Flashback Version Query.
3 - GRANT mgr, CREATE TABLE TO SCOTT;

4. A non-correlated subquery can be defined Which statement is true regarding the


as________ execu on of the above commands?
a) A set of sequen al queries, all of which a) Statement 1 would not execute because
must always return a single value the WITH GRANT op on is missing
b) A set of sequen al queries, all of which b) Statement 1 would not execute because
must return values from the same table the IDENTIFIED BY clause is missing
c) A SELECT statement that can be embedded c) Statement 3 would not execute because
in a clause of another SELECT statement only role and system privileges cannot be granted
d) A set of one or more sequen al queries in together in a single GRANT statement
which generally the result of the inner query d) Statement 2 would not execute because
is used as the search value in the outer query system privileges and object privileges
cannot be granted together in a single
Answer: d
GRANT command
Explana on: A noncorrelated subquery is
subquery that is independent of the outer Answer: d
query and it can executed on its own without Explana on: The GRANT statement is used
relying on main outer query. to give privileges to a specific user or role, or
to all users, to perform ac ons on database
5. Which statement is true regarding
objects.
synonyms?
a) Synonyms can be created for tables but 7. OE and SCOTT are the users in the
not views database. The ORDERS table is owned by OE.
b) Synonyms are used to reference only Evaluate the statements issued by the DBA in
those tables that are owned by another user the following sequence:
c) A public synonym and a private synonym
can exist with the same name for the same CREATE ROLE r1;
table GRANT SELECT, INSERT ON oe. orders TO r1;
GRANT r1 TO scott;
d) The DROP SYNONYM statement removes
GRANT SELECT ON oe. orders TO scott;
the synonym, and the status of the table on REVOKE SELECT ON oe.orders FROM scott;
which the synonym has been created
becomes invalid What would be the outcome a er execu ng
the statements?
Answer: c a) SCOTT would be able to query the
Explana on: A synonym is an alias or OE.ORDERS table
alternate name for a table, view, sequence, b) SCOTT would not be able to query the
or other schema object. They are used OE.ORDERS table
mainly to make it easy for users to access c) The REVOKE statement would remove the
database objects owned by other users. SELECT privilege from SCOTT as well as from
the role R1
6. SCOTT is a user in the database. d) The REVOKE statement would give an
Evaluate the commands issued BY the DBA:
error because the SELECT privilege has been
1 - CREATE ROLE mgr; granted to the role R1

www.studymaterialz.in 130
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: a es OF the sales staff IN the organizatio


n:
Explana on: The REVOKE statement is used
CREATE OR REPLACE VIEW sales_staff_vu AS
to remove privileges from a specific user or SELECT employee_id, last_name job_id FROM
role, or from all users, to perform ac ons on employees
database objects. WHERE job_id LIKE 'SA_%' WITH CHECK OPTIO
N;
8. Given below are the SQL statements
Which statements are true regarding the
executed in a user session:
above view?
CREATE TABLE product a) It allows you to insert details of all new
(pcode NUMBER(2), staff into the EMPLOYEES table
pnameVARCHAR2(10)); b) It allows you to delete the details of the
INSERT INTO product VALUES(1, 'pen');
INSERT INTO product VALUES (2,'penci'); exis ng sales staff from the EMPLOYEES table
SAVEPOINT a; c) It allows you to update the job ids of the
UPDATE product SET pcode = 10 WHERE pcode exis ng sales staff to any other job id in the
= 1; EMPLOYEES table
SAVEPOINT b;
DELETE FROM product WHERE pcode = 2; d) It allows you to insert the IDs, last
COMMIT;
DELETE FROM product WHERE pcode=10; Answer: d
ROLLBACK TO SAVEPOINT a; Explana on: SQL Create view syntax :
Which statement describes the CREATE VIEW view_name AS
consequences? SELECT column_name(s)
FROM TABLE_NAME
a) No SQL statement would be rolled back WHERE condition.
b) Both the DELETE statements would be
rolled back 10. EMPDET is an external table containing
c) Only the second DELETE statement would the columns EMPNO and ENAME. Which
be rolled back command would work in rela on to the
d) Both the DELETE statements and the EMPDET table?
UPDATE statement would be rolled back a)

Answer: d UPDATE empdet


Explana on: The SAVEPOINT statement SET ename = 'Amit'
WHERE empno = 1234;
names and marks the current point in the
processing of a transac on. With the b)
ROLLBACK TO statement, savepoints undo
parts of a transac on instead of the whole DELETE FROM empdet
transac on. WHERE ename LIKE 'J%';

9. Evaluate the following command: c)

CREATE TABLE employees (employee_id NUMBE CREATE VIEW empvu


R(2) PRIMARY KEY, last_name VARCHAR2(25) AS
NOT SELECT* FROM empdept;
NULL, department_id NUMBER(2), job_id VAR
CHAR2(8), salary NUMBER(10,2)); d)
You issue the following command TO CREATE
a VIEW that displays the IDs AND LAST nam

www.studymaterialz.in 131
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

CREATE INDEX empdet_idx b) Goes up the tree and back down


ON empdet(empno);
c) Goes down the tree and releases
Answer: c d) Goes up the tree and releases
Explana on: External tables are created
Answer: a
using the SQL CREATE TABLE…ORGANIZATION
EXTERNAL statement. When an external Explana on: It moves in a crab like manner.
table is created, you specify type ,default
5. The deadlock can be handled by
directory, access parameters and loca on. a) Removing the nodes that are deadlocked
b) Restar ng the search a er releasing the
lock
c) Restar ng the search without releasing the
1. The method of access that uses key lock
transforma on is called as d) Resuming the search
a) Direct
Answer: b
b) Hash
Explana on: Crabbing protocol moves in a
c) Random
crab like manner.
d) Sequen al
6. In crabbing protocol, the lock obtained on
Answer: b
the root node is in _________ mode.
Explana on: Hash technique uses par cular
a) Shared
hash key value.
b) Exclusive
2. Why do we need concurrency control on c) Read only
B+ trees ? d) None of the men oned
a) To remove the unwanted data
Answer: a
b) To easily add the index elements
Explana on: Crabbing protocol moves in a
c) To maintain accuracy of index
crab like manner down the index tree.
d) All of the men oned
7. If needed to split a node or coalesce it with
Answer: c
its siblings, or redistribute key values
Explana on: Indices do not have to be
between siblings, the crabbing protocol locks
treated like other database structures.
the parent of the node in ____________
3. How many techniques are available to mode.
control concurrency on B+ trees? a) Shared
a) One b) Exclusive
b) Three c) Read only
c) Four d) None of the men oned
d) None of the men oned
Answer: b
Answer: d Explana on: Crabbing protocol moves in a
Explana on: Two techniques are present. crab like manner down the index tree.

4. In crabbing protocol locking 8. In crabbing protocol to inset or delete a


a) Goes down the tree and back up key value the leaf node has to be locked in

www.studymaterialz.in 132
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

___________ mode. Answer: a


a) Shared Explana on: It must minimize the me for
b) Exclusive which the database is not usable a er a
c) Read only failure.
d) None of the men oned
2. Which one of the following is a failure to a
Answer: b system
Explana on: Crabbing protocol moves in a a) Boot crash
crab like manner down the index tree. b) Read failure
c) Transac on failure
9. B-link tree requires a pointer to its d) All of the men oned
__________ sibling.
a) Upper Answer: c
b) Lower Explana on: Types of system failure are
c) Right transac on failure, system crash and disk
d) Le failure.

Answer: c 3. Which of the following belongs to


Explana on: This pointer is required because transac on failure
a lookup that occurs while a node is being a) Read error
split may have to search not only that node b) Boot error
but also that node’s right sibling. c) Logical error
d) All of the men oned
10. Instead of locking index leaf nodes in a
two-phase manner, some index concurrency- Answer: c
control schemes use ___________ on Explana on: Types of system transac on
individual key values, allowing other key failure are logical and system error.
values to be inserted or deleted from the
same leaf. 4. The system has entered an undesirable
a) B+ tree locking state (for example, deadlock), as a result of
b) Link level locking which a transac on cannot con nue with its
c) Key-value locking normal execu on. This is
d) Next value locking a) Read error
b) Boot error
Answer: c c) Logical error
Explana on: Key-value locking thus provides d) System error
increased concurrency.
Answer: c
Explana on: The transac on, can be re-
1. The recovery scheme must also provide executed at a later me.
a) High availability
b) Low availability 5. The transac on can no longer con nue
c) High reliability with its normal execu on because of some
d) High durability internal condi on, such as bad input, data
not found, overflow, or resource limit
exceeded. This is

www.studymaterialz.in 133
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Read error Answer: a


b) Boot error Explana on: Copies of the data on other
c) Logical error disks, or archival backups on ter ary media,
d) System error such as DVD or tapes, are used to recover
from the failure.
Answer: c
Explana on: The transac on, can be re- 9. The database is par oned into fixed-
executed at a later me. length storage units called
a) Parts
6. The assump on that hardware errors and b) Blocks
bugs in the so ware bring the system to a c) Reads
halt, but do not corrupt the nonvola le d) Build
storage contents, is known as the
a) Stop assump on Answer: b
b) Fail assump on Explana on: Blocks are the units of data
c) Halt assump on transfer to and from disk, and may contain
d) Fail-stop assump on several data items.

Answer: d 10. Which of the following causes system to


Explana on: Well-designed systems have crash
numerous internal checks, at the hardware a) Bug in so ware
and the so ware level, that bring the system b) Loss of vola le data
to a halt when there is an error. Hence, the c) Hardware malfunc on
fail-stop assump on is a reasonable one. d) All of the men oned

7. Which kind of failure loses its data in head Answer: d


crash or failure during a transfer opera on. Explana on: The content of non-vola le
a) Transac on failure storage remains intact, and is not corrupted.
b) System crash
c) Disk failure
d) All of the men oned 1. The log is a sequence of _________
recording all the update ac vi es in the
Answer: c database.
Explana on: Copies of the data on other a) Log records
disks, or archival backups on ter ary media, b) Records
such as DVD or tapes, are used to recover c) Entries
from the failure. d) Redo

8. The failure occurred sufficiently early Answer: a


during the transfer that the des na on block Explana on: The most widely used structure
remains intact. for recording database modifica ons is the
a) Par al Failure log.
b) Total failure
c) Successful comple on 2. In the ___________ scheme, a transac on
d) Data transfer failure that wants to update the database first
creates a complete copy of the database.

www.studymaterialz.in 134
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

a) Shadow copy c) Immediate-modifica on


b) Shadow Paging d) Undo
c) Update log records
d) All of the men oned Answer: a
Explana on: Deferred modifica on has the
Answer: a overhead that transac ons need to make
Explana on: If at any point the transac on local copies of all updated data items;
has to be aborted, the system merely deletes further, if a transac on reads a data item that
the new copy. The old copy of the database it has updated, it must read the value from
has not been affected. its local copy.

3. The ____________ scheme uses a page 6. If database modifica ons occur while the
table containing pointers to all pages; the transac on is s ll ac ve, the transac on is
page table itself and all updated pages are said to use the ___________technique.
copied to a new loca on. a) Deferred-modifica on
a) Shadow copy b) Late-modifica on
b) Shadow Paging c) Immediate-modifica on
c) Update log records d) Undo
d) All of the men oned
Answer: c
Answer: b Explana on: We say a transac on modifies
Explana on: Any page which is not updated the database if it performs an update on a
by a transac on is not copied, but instead disk buffer, or on the disk itself; updates to
the new page table just stores a pointer to the private part of main memory do not
the original page. count as database modifica ons.

4. The current copy of the database is 7. ____________ using a log record sets the
iden fied by a pointer, called ____________ data item specified in the log record to the
which is stored on disk. old value.
a) Db-pointer a) Deferred-modifica on
b) Update log b) Late-modifica on
c) Update log records c) Immediate-modifica on
d) All of the men oned d) Undo

Answer: a Answer: d
Explana on: Any page which is not updated Explana on: Undo brings the previous
by a transac on is not copied, but instead contents.
the new page table just stores a pointer to
the original page. 8. In the __________ phase, the system
replays updates of all transac ons by
5. If a transac on does not modify the scanning the log forward from the last
database un l it has commi ed, it is said to checkpoint.
use the ___________ technique. a) Repea ng
a) Deferred-modifica on b) Redo
b) Late-modifica on c) Replay
d) Undo

www.studymaterialz.in 135
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: b they were wri en to the log buffer.


Explana on: Undo brings the previous a) Must be exactly the same
contents. b) Can be different
c) Is opposite
9. The ac ons which are played in the order d) Can be par ally same
while recording it is called ______________
history. Answer: a
a) Repea ng Explana on: As a result of log buffering, a log
b) Redo record may reside in only main memory
c) Replay (vola le storage) for a considerable me
d) Undo before it is output to stable storage.

Answer: a 3. Before a block of data in main memory can


Explana on: Undo brings the previous be output to the database, all log records
contents. pertaining to data in that block must have
been output to stable storage. This is
10. A special redo-only log record < Ti, Xj, V1> a) Read-write logging
is wri en to the log, where V1 is the value b) Read-ahead logging
being restored to data item Xj during the c) Write-ahead logging
rollback. These log records are some mes d) None of the men oned
called
a) Log records Answer: c
b) Records Explana on: The WAL rule requires only that
c) Compensa on log records the undo informa on in the log has been
d) Compensa on redo records output to stable storage, and it permits the
redo informa on to be wri en later.
Answer: c
Explana on: Such records do not need undo 4. Wri ng the buffered log to __________ is
informa on since we never need to undo some mes referred to as a log force.
such an undo opera on. a) Memory
b) Backup
c) Redo memory
1. In order to reduce the overhead in d) Disk
retrieving the records from the storage space
we use Answer: d
a) Logs Explana on: If there are insufficient log
b) Log buffer records to fill the block, all log records in
c) Medieval space main memory are combined into a par ally
d) Lower records full block and are output to stable storage.

Answer: b 5. The _______________ policy, allows a


Explana on: The output to stable storage is transac on to commit even if it has modified
in units of blocks. some blocks that have not yet been wri en
back to disk.
2. The order of log records in the stable a) Force
storage ____________ as the order in which b) No-force

www.studymaterialz.in 136
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Steal Answer: a
d) No-steal Explana on: These locks, and other similar
locks that are held for a short dura on.
Answer: b
Explana on: No-force policy allows faster 9. The __________________ contains a list of
commit of transac ons. blocks that have been updated in the
database buffer.
6. ______________ policy allows mul ple a) Latches
updates to accumulate on a block before it is b) Swap Space
output to stable storage, which can reduce c) Dirty Block
the number of output opera ons greatly for d) None of the men oned
frequently updated blocks.
a) Force Answer: c
b) No-force Explana on: Dirty blocks are those that have
c) Steal been updated in memory, and the disk
d) No-steal version is not up-to-date.

Answer: b 10. The opera ng system reserves space on


Explana on: No-force policy allows faster disk for storing virtual-memory pages that
commit of transac ons. are not currently in main memory; this space
is called
7. The ___________ policy, allows the system a) Latches
to write modified blocks to disk even if the b) Swap Space
transac ons that made those modifica ons c) Dirty Block
have not all commi ed. d) None of the men oned
a) Force
b) No-force Answer: b
c) Steal Explana on: Almost all current-genera on
d) No-steal opera ng systems retain complete control of
virtual memory.
Answer: c
Explana on: The no-steal policy does not
work with transac ons that perform a large 1. The silicon chips used for data processing
number of updates. are called
a) RAM chips
8. Locks on buffer blocks are unrelated to b) ROM chips
locks used for concurrency-control of c) Micro processors
transac ons, and releasing them in a non- d) PROM chips
two-phase manner does not have any
implica ons on transac on serializability. Answer: d
This is Explana on: PROM is Programmable Read
a) Latches Only Memory.
b) Swap Space
c) Dirty Block 2. Which of the following is used for
d) None of the men oned manufacturing chips?
a) Control bus

www.studymaterialz.in 137
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Control unit 6. Which of the following is used only for


c) Parity unit data entry and storage, and never for
d) Semiconductor processing?
a) Mouse
Answer: d b) Dumb terminal
Explana on: A semiconductor is a material c) Micro computer
which has electrical conduc vity between d) Dedicated data entry system
that of a conductor such as copper and that
of an insulator such as glass. Answer: b
Explana on: Dumb terminals are those that
3. What was the name of the first can interpret a limited number of control
commercially available microprocessor chip? codes.
a) Intel 308
b) Intel 33 7. Non-vola le storage needs to have a
c) Intel 4004 _________ where the loses in future can be
d) Motorola 639 recovered.
a) Dump
Answer: c b) Recover place
Explana on: The Intel 4004 is a 4-bit central c) Disk
processing unit (CPU) released by Intel d) Redo plan
Corpora on in 1971
Answer: a
4. The magne c storage chip used to provide Explana on: The basic scheme is to dump
non-vola le direct access storage of data and the en re contents of the database to stable
that have no moving parts are known as storage periodically—say, once per day.
a) Magne c core memory
b) Magne c tape memory 8. A dump of the database contents is also
c) Magne c disk memory referred to as an _____________ dump.
d) Magne c bubble memory a) Archival
b) Fuzzy
Answer: d c) SQL
Explana on: Bubble domain visualiza on by d) All of the men oned
using CMOS-MagView.
Answer: a
5. The ALU of a computer normally contains a Explana on: We can archive the dumps and
number of high speed storage element called use them later to examine old states of the
a) Semiconductor memory database.
b) Registers
c) Hard disks 9. ________ dump, writes out SQL DDL
d) Magne c disk statements and SQL insert statements to a
file, which can then be reexecuted to re-
Answer: b create the database.
Explana on: External control unit tells the a) Archival
ALU what opera on to perform on that data, b) Fuzzy
and then the ALU stores its result into an c) SQL
output register. d) All of the men oned

www.studymaterialz.in 138
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

Answer: c page may result in many other records in the


Explana on: Such dumps are useful when page being shi ed, if a slo ed page structure
migra ng data to a different instance of the is used.
database, or to a different version of the
database so ware, since the physical 3. ______________ is used to minimize
loca ons and layout may be different in the unnecessary redos during recovery.
other database instance or database a) Dirty page table
so ware version. b) Page table
c) Dirty redo
10. _________ dump schemes have been d) All of the men oned
developed that allow transac ons to be
ac ve while the dump is in progress. Answer: a
a) Archival Explana on: Dirty pages are those that have
b) Fuzzy been updated in memory, and the disk
c) SQL version is not up-to-date.
d) All of the men oned
4. __________ scheme that records only
Answer: b informa on about dirty pages and associated
Explana on: The simple dump procedure informa on and does not even require of
described here is costly and so fuzzy dump is wri ng dirty pages to disk.
used. a) Fuzzy logic
b) Checkpoints
c) Fuzzy-checkpoint
1. ARIES uses a ___________ to iden fy log d) Logical checkpoint
records, and stores it in database pages.
a) Log sequence number Answer: c
b) Log number Explana on: It flushes dirty pages in the
c) Lock number background, con nuously, instead of wri ng
d) Sequence them during checkpoints.

Answer: b 5. Whenever an update opera on occurs on


Explana on: LSN is used to iden fy which a page, the opera on stores the LSN of its log
opera ons have been applied to a database record in the _______ field of the page.
page. a) LSN
b) ReadLSN
2. ARIES supports ___________ opera ons, c) PageLSN
which are physical in that the affected page is d) RedoLSN
physically iden fied, but can be logical within
the page. Answer: c
a) Physiological redo Explana on: Each page maintains an
b) Physiological undo iden fier called the PageLSN.
c) Logical redo
d) Logical undo 6. There are special redo-only log records
generated during transac on rollback, called
Answer: a _________ in ARIES.
Explana on: The dele on of a record from a a) Compensa on log records

www.studymaterialz.in 139
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Read log records Answer: b


c) Page log records Explana on: The redo pass repeats history
d) Redo log records by replaying every ac on that is not already
reflected in the page on disk.
Answer: a
Explana on: These serve the same purpose 10. ______________ rolls back all
as the redo-only log records in our earlier transac ons that were incomplete at the
recovery scheme. me of crash.
a) Analysis pass
7. The __________________ contains a list of b) Redo pass
pages that have been updated in the c) Undo pass
database buffer. d) None of the men oned
a) Dirty page table
b) Page table Answer: c
c) Dirty redo Explana on: It performs a single backward
d) All of the men oned scan of the log, undoing all transac ons in
undo-list.
Answer: a
Explana on: Dirty pages are those that have
been updated in memory, and the disk 1. Which lock should be obtained to prevent
version is not up-to-date. a concurrent transac on from execu ng a
conflic ng read, insert or delete opera on on
8. ___________ determines which the same key value.
transac ons to undo, which pages were dirty a) Higher-level lock
at the me of the crash, and the LSN from b) Lower-level lock
which the redo pass should start. c) Read only lock
a) Analysis pass d) Read write
b) Redo pass
c) Undo pass Answer: a
d) None of the men oned Explana on: Opera ons acquire lower-level
locks while they execute, but release them
Answer: a when they complete; the corresponding
Explana on: The analysis pass finds the last transac on must however retain a higher-
complete checkpoint log record, and reads in level lock in a two-phase manner to prevent
the DirtyPageTable from this record. concurrent transac ons from execu ng
conflic ng ac ons.
9. __________ starts from a posi on
determined during analysis, and performs a 2. Once the lower-level lock is released, the
redo, repea ng history, to bring the database opera on cannot be undone by using the old
to a state it was in before the crash. values of updated data items, and must
a) Analysis pass instead be undone by execu ng a
b) Redo pass compensa ng opera on; such an opera on
c) Undo pass is called
d) None of the men oned a) Logical opera on
b) Redo opera on

www.studymaterialz.in 140
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

c) Logical undo opera on Answer: c


d) Undo opera on Explana on: Data structures such as B+-trees
would not be in a consistent state, and
Answer: a neither logical redo nor logical undo
Explana on: It is important that the lower- opera ons can be performed on an
level locks acquired during an opera on are inconsistent data structure.
sufficient to perform a subsequent logical
undo of the opera on. 6. An opera on is said to be __________ if
execu ng it several mes in a row gives the
3. Which of the following is used for undo same result as execu ng it once.
opera ons alone? a) Idempotent
a) Logical logging b) Changed
b) Physical logging c) Repe ve
c) Physical log records d) All of the above
d) Physical logging and Physical log records
Answer: a
Answer: a Explana on: Opera ons such as inser ng an
Explana on: If the opera on inserted an entry into a B+-tree may not be idempotent,
entry in a B+-tree, the undo informa on U and the recovery algorithm must therefore
would indicate that a dele on opera on is to make sure that an opera on that has already
be performed, and would iden fy the B+-tree been performed is not performed again.
and what entry to delete from the tree. Such
logging of informa on about opera ons is 7. Immediate database modifica on
called logical logging. technique uses
a) Both undo and redo
4. Redo opera ons are performed exclusively b) Undo but no redo
using c) Redo but no undo
a) Logical logging d) Neither undo nor redo
b) Physical logging
c) Physical log records Answer: a
d) Both Physical logging and Physical log Explana on: Undo erases all the changes
records and redo makes the deleted changes.

Answer: d 8. Shadow paging has


Explana on: Logging of old-value and new- a) no redo
value informa on is called physical logging. b) no undo
c) redo but no undo
5. To perform logical redo or undo, the d) neither redo nor undo
database state on disk must be opera on
___________ that is, it should not have Answer: a
par al effects of any opera on. Explana on: Undo erases all the changes
a) Persistent and redo makes the deleted changes.
b) Resistant
c) Consistent 9. For correct behaviour during recovery,
d) None of the men oned undo and redo opera on must be
a) Commuta ve

www.studymaterialz.in 141
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

b) Associa ve Answer: a
c) Idempotent Explana on: We can achieve high availability
d) Distribu ve by performing transac on processing at one
site, called the primary site, and having a
Answer: c remote backup site where all the data from
Explana on: Undo erases all the changes the primary site are replicated.
and redo makes the deleted changes.
3. The backup is taken by
10. If ___________ are not obtained in undo a) Erasing all previous records
opera on it will cause problem in undo- b) Entering the new records
phase. c) Sending all log records from primary site to
a) Higher-level lock the remote backup site
b) Lower-level lock d) Sending selected records from primary site
c) Read only lock to the remote backup site
d) Read write
Answer: c
Answer: b Explana on: We can achieve high availability
Explana on: Opera ons acquire lower-level by performing transac on processing at one
locks while they execute, but release them site, called the primary site, and having a
when they complete; the corresponding remote backup site where all the data from
transac on must however retain a higher- the primary site are replicated.
level lock in a two-phase manner to prevent
concurrent transac ons from execu ng 4. When the __________ the backup site
conflic ng ac ons. takes over processing and becomes the
primary.
1. The remote backup site is some mes also a) Secondary fails
called the b) Backup recovers
a) Primary Site c) Primary fails
b) Secondary Site d) None of the men oned
c) Ter ary Site
Answer: c
d) None of the men oned
Explana on: When the original primary site
Answer: b recovers, it can either play the role of remote
Explana on: We can achieve high availability backup, or take over the role of primary site
by performing transac on processing at one again.
site, called the primary site, and having a
5. The simplest way of transferring control is
remote backup site where all the data from
for the old primary to receive __________
the primary site are replicated.
from the old backup site.
2. Remote backup system must be a) Undo logs
_________ with the primary site. b) Redo Logs
a) Synchronised c) Primary Logs
b) Separated d) All of the men oned
c) Connected
Answer: c
d) Detached but related
Explana on: If control must be transferred

www.studymaterialz.in 142
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017

back, the old backup site can pretend to have Answer: a


failed, resul ng in the old primary taking Explana on: The problem with this scheme
over. is that the updates of a commi ed
transac on may not have made it to the
6. The me to process the remote backup backup site, when the backup site takes over
can be reduced by processing.
a) Flags
b) Breakpoints 9. A transac on commits as soon as its
c) Redo points commit log record is wri en to stable storage
d) Checkpoints at the primary and the backup site. This is
a) One Safe
Answer: d b) Two Safe
Explana on: If the log at the remote backup c) Two-very Safe
grows large, recovery will take a long me. d) Very Safe
The remote backup site can periodically
process the redo log records that it has Answer: c
received and can perform a checkpoint, so Explana on: The problem with this scheme
that earlier parts of the log can be deleted. is that transac on processing cannot proceed
if either the primary or the backup site is
7. A _______________ configura on can down.
make takeover by the backup site almost
instantaneous. 10. If only the primary is ac ve, the
a) Hot-spare transac on is allowed to commit as soon as
b) Remote its commit log record is wri en to stable
c) Direct storage at the primary site. This is
d) Spare a) One Safe
b) Two Safe
Answer: d c) Two-very Safe
Explana on: In this configura on, the d) Very Safe
remote backup site con nually processes
redo log records as they arrive, applying the Answer: b
updates locally. Explana on: This scheme provides be er
availability than does two-very-safe, while
8. A transac on commits as soon as its avoiding the problem of lost transac ons
commit log record is wri en to stable storage faced by the one-safe scheme.
at the primary site. This is
a) One Safe
b) Two Safe
c) Two-very Safe
d) Very Safe

www.studymaterialz.in 143

You might also like