Professional Documents
Culture Documents
Cs8492 MCQ
Cs8492 MCQ
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.
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
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
www.studymaterialz.in 3
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 4
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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);
www.studymaterialz.in 6
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 7
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 8
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
5. b)
SELECT name
SELECT name
FROM instructor
FROM employee
WHERE dept name = ’Physics’
WHERE salary <= 90000 AND salary>=100000;
ORDER BY name;
www.studymaterialz.in 9
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 10
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 11
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 12
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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: 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’);
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
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
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
www.studymaterialz.in 21
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 22
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
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.
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
www.studymaterialz.in 26
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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
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;
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
www.studymaterialz.in 32
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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.
www.studymaterialz.in 36
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 37
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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”
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
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
www.studymaterialz.in 43
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 44
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 45
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 46
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
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
www.studymaterialz.in 52
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 53
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
www.studymaterialz.in 55
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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:
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:
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: 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
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
www.studymaterialz.in 62
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 63
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
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
www.studymaterialz.in 65
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
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.
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
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
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.
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.
www.studymaterialz.in 75
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 76
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 77
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 78
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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.
www.studymaterialz.in 81
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 83
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 86
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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
www.studymaterialz.in 91
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
www.studymaterialz.in 93
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 94
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 95
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 96
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
www.studymaterialz.in 98
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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.
www.studymaterialz.in 102
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
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
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
www.studymaterialz.in 107
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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
www.studymaterialz.in 112
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 113
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 114
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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
www.studymaterialz.in 118
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 119
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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.
www.studymaterialz.in 120
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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
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
www.studymaterialz.in 127
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 129
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 130
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 131
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 132
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 133
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 134
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
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.
www.studymaterialz.in 137
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 138
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 139
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
www.studymaterialz.in 140
CS8492 - DATABASE MANAGEMENT SYSTEMS Regulations 2017
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
www.studymaterialz.in 143