Vous êtes sur la page 1sur 72

Database Management System: 5.

For each attribute of a relation, there is a set


of permitted values, called the ________ of that
1. A relational database consists of a collection attribute.
of a) Domain
a) Tables b) Relation
b) Fields c) Set
c) Records d) Schema
d) Keys View Answer
View Answer
Answer: a
Answer: a Explanation: The values of the attribute should
Explanation: Fields are the column of the be present in the domain. Domain is a set of
relation or tables. Records are each row in a values permitted.
relation. Keys are the constraints in a relation.
6. Database __________ which is the logical
2. A ________ in a table represents a design of the database, and the database
relationship among a set of values. _______ which is a snapshot of the data in the
a) Column database at a given instant in time.
b) Key a) Instance, Schema
c) Row b) Relation, Schema
d) Entry c) Relation, Domain
View Answer d) Schema, Instance
View Answer
Answer: c
Explanation: Column has only one set of values. Answer: d
Keys are constraints and row is one whole set of Explanation: Instance is an instance of time and
attributes. Entry is just a piece of data. schema is a representation.

3. The term _______ is used to refer to a row. 7. Course(course_id,sec_id,semester)


a) Attribute Here the course_id,sec_id and semester are
b) Tuple __________ and course is a _________
c) Field a) Relations, Attribute
d) Instance b) Attributes, Relation
View Answer c) Tuple, Relation
d) Tuple, Attributes
Answer: b View Answer
Explanation: Tuple is one entry of the relation
with several attributes which are fields. Answer: b
Explanation: The relation course has a set of
4. The term attribute refers to a ___________ of attributes course_id,sec_id,semester .
a table. advertisement
a) Record
b) Column 8. Department (dept name, building, budget) and
c) Tuple Employee (employee_id, name, dept name,
d) Key salary)
View Answer Here the dept_name attribute appears in both the
relations. Here using common attributes in
Answer: b relation schema is one way of relating
Explanation: Attribute is a specific domain in ___________ relations.
the relation which has entries of all tuples. a) Attributes of common

1
b) Tuple of common c) CITY
c) Tuple of distinct d) CITY, ID
d) Attributes of distinct View Answer
View Answer
Answer: b
Answer: c Explanation: Here the id is the only attribute
Explanation: Here the relations are connected by which can be taken as a key. Other attributes are
the common attributes. not uniquely identified.

9. A domain is atomic if elements of the domain 3. The subset of a super key is a candidate key
are considered to be ____________ units. under what condition?
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
View Answer View Answer

Answer: b Answer: a
Explanation: None. Explanation: The subset of a set cannot be the
same set. Candidate key is a set from a super key
10. The tuples of the relations can be of which cannot be the whole of the super set.
________ order.
a) Any 4. A _____ is a property of the entire relation,
b) Same rather than of the individual tuples in which each
c) Sorted tuple is unique.
d) Constant a) Rows
View Answer b) Key
c) Attribute
Answer: a d) Fields
Explanation: The values only count. The order View Answer
of the tuples does not matter.
Answer: b
1. Which one of the following is a set of one or Explanation: Key is the constraint which
more attributes taken collectively to uniquely specifies uniqueness.
identify a record?
a) Candidate key 5. Which one of the following attribute can be
b) Sub key taken as a primary key?
c) Super key a) Name
d) Foreign key b) Street
View Answer c) Id
d) Department
Answer: c View Answer
Explanation: Super key is the superset of all the
keys in a relation. Answer: c
Explanation: The attributes name, street and
2. Consider attributes ID, CITY and NAME. department can repeat for some tuples. But the
Which one of this can be considered as a super id attribute has to be unique. So it forms a
key? primary key.
a) NAME
b) ID

2
6. Which one of the following cannot be taken Answer: c
as a primary key? Explanation: None.
a) Id
b) Register number 10. A _________ integrity constraint requires
c) Dept_id that the values appearing in specified attributes
d) Street of any tuple in the referencing relation also
View Answer appear in specified attributes of at least one tuple
in the referenced relation.
Answer: d a) Referential
Explanation: Street is the only attribute which b) Referencing
can occur more than once. c) Specific
d) Primary
7. An attribute in a relation is a foreign key if the View Answer
_______ key from one relation is used as an
attribute in that relation. Answer: a
a) Candidate Explanation: A relation, say r1, may include
b) Primary among its attributes the primary key of another
c) Super relation, say r2. This attribute is called a foreign
d) Sub key from r1, referencing r2. The relation r1 is
View Answer also called the referencing relation of the foreign
key dependency, and r2 is called the referenced
Answer: b relation of the foreign key.
Explanation: The primary key has to be referred
in the other relation to form a foreign key in that 1. Using which language can a user request
relation. information from a database?
advertisement a) Query
b) Relational
8. The relation with the attribute which is the c) Structural
primary key is referenced in another relation. d) Compiler
The relation which has the attribute as a primary View Answer
key is called
a) Referential relation Answer: a
b) Referencing relation Explanation: Query language is a method
c) Referenced relation through which the database entries can be
d) Referred relation accessed.
View Answer
2. Student(ID, name, dept name, tot_cred)
Answer: b In this query which attributes form the primary
Explanation: None. key?
a) Name
9. The ______ is the one in which the primary b) Dept
key of one relation is used as a normal attribute c) Tot_cred
in another relation. d) ID
a) Referential relation View Answer
b) Referencing relation
c) Referenced relation Answer: d
d) Referred relation Explanation: The attributes name, dept and
View Answer tot_cred can have same values unlike ID.

3
3. Which one of the following is a procedural Answer: a
language? Explanation: Union just combines all the values
a) Domain relational calculus of relations of same attributes.
b) Tuple relational calculus
c) Relational algebra 7. The most commonly used operation in
d) Query language relational algebra for projecting a set of tuple
View Answer from a relation is
a) Join
Answer: c b) Projection
Explanation: Domain and Tuple relational c) Select
calculus are non-procedural language. Query d) Union
language is a method through which database View Answer
entries can be accessed.
Answer: c
4. The_____ operation allows the combining of Explanation: Select is used to view the tuples of
two relations by merging pairs of tuples, one the relation with or without some constraints.
from each relation, into a single tuple. advertisement
a) Select
b) Join 8. The _______ operator takes the results of two
c) Union queries and returns only rows that appear in both
d) Intersection result sets.
View Answer a) Union
b) Intersect
Answer: b c) Difference
Explanation: Join finds the common tuple in the d) Projection
relations and combines it. View Answer

5. The result which operation contains all pairs Answer: b


of tuples from the two relations, regardless of Explanation: The union operator gives the result
whether their attribute values match. which is the union of two queries and difference
a) Join is the one where query which is not a part of
b) Cartesian product second query.
c) Intersection
d) Set difference 9. A ________ is a pictorial depiction of the
View Answer schema of a database that shows the relations in
the database, their attributes, and primary keys
Answer: b and foreign keys.
Explanation: Cartesian product is the a) Schema diagram
multiplication of all the values in the attributes. b) Relational algebra
c) Database diagram
6. The _______operation performs a set union of d) Schema flow
two “similarly structured” tables View Answer
a) Union
b) Join Answer: a
c) Product Explanation: None.
d) Intersect
View Answer 10. The _________ provides a set of operations
that take one or more relations as input and
return a relation as an output.
a) Schematic representation

4
b) Relational algebra language which performs all the operation in
c) Scheme diagram defining structure of relation.
d) Relation flow
View Answer 4.

Answer: b SELECT * FROM employee


Explanation: None.
What type of statement is this?
1. Which one of the following is used to define a) DML
the structure of the relation, deleting relations b) DDL
and relating schemas? c) View
a) DML(Data Manipulation Langauge) d) Integrity constraint
b) DDL(Data Definition Langauge) View Answer
c) Query
d) Relational Schema Answer: a
View Answer Explanation: Select operation just shows the
required fields of the relation. So it forms a
Answer: b DML.
Explanation: Data Definition language is the
language which performs all the operation in 5. The basic data type char(n) is a _____ length
defining structure of relation. character string and varchar(n) is _____ length
character.
2. Which one of the following provides the a) Fixed, equal
ability to query information from the database b) Equal, variable
and to insert tuples into, delete tuples from, and c) Fixed, variable
modify tuples in the database? d) Variable, equal
a) DML(Data Manipulation Langauge) View Answer
b) DDL(Data Definition Langauge)
c) Query Answer: c
d) Relational Schema Explanation: Varchar changes its length
View Answer accordingly whereas char has a specific length
which has to be filled by either letters or spaces.
Answer: a
Explanation: DML performs the change in the 6. An attribute A of datatype varchar(20) has the
values of the relation. value “Avi”. The attribute B of datatype
char(20) has value ”Reed”. Here attribute A has
3. ____ spaces and attribute B has ____ spaces.
a) 3, 20
CREATE TABLE employee (name VARCHAR, b) 20, 4
id INTEGER) c) 20, 20
d) 3, 4
What type of statement is this? View Answer
a) DML
b) DDL Answer: a
c) View Explanation: Varchar changes its length
d) Integrity constraint accordingly whereas char has a specific length
View Answer which has to be filled by either letters or spaces.

Answer: b 7. To remove a relation from an SQL database,


Explanation: Data Definition language is the we use the ______ command.

5
a) Delete d) DDL constraints
b) Purge View Answer
c) Remove
d) Drop table Answer: a
View Answer Explanation: Integrity constraint has to be
maintained in the entries of the relation.
Answer: d
Explanation: Drop table deletes the whole 1.
structure of the relation .purge removes the table
which cannot be obtained again. Name
Annie
8.
Bob
advertisement Callie
Derek
DELETE FROM r; //r - relation
Which of these query will display the the table
This command performs which of the following
given above ?
action?
a) Select employee from name
a) Remove relation
b) Select name
b) Clear relation entries
c) Select name from employee
c) Delete fields
d) Select employee
d) Delete rows
View Answer
View Answer
Answer: c
Answer: b
Explanation: The field to be displayed is
Explanation: Delete command removes the
included in select and the table is included in the
entries in the table.
from clause.
9.
2. Here which of the following displays the
unique values of the column?
INSERT INTO instructor VALUES (10211,
’Smith’, ’Biology’, 66000);
SELECT ________ dept_name
FROM instructor;
What type of statement is this?
a) Query
a) All
b) DML
b) From
c) Relational
c) Distinct
d) DDL
d) Name
View Answer
View Answer
Answer: b
Answer: c
Explanation: The values are manipulated. So it
Explanation: Distinct keyword selects only the
is a DML.
entries that are unique.
10. Updates that violate __________ are
3. The ______ clause allows us to select only
disallowed.
those rows in the result relation of the ____
a) Integrity constraints
clause that satisfy a specified predicate.
b) Transaction control
a) Where, from
c) Authorization

6
b) From, select join teaches;
c) Select, from c) Select name, course_id from instructor;
d) From, where d) Select course_id from instructor join teaches;
View Answer View Answer

Answer: a Answer: b
Explanation: Where selects the rows on a Explanation: Join clause joins two tables by
particular condition. From gives the relation matching the common column.
which involves the operation. advertisement

4. The query given below will not give an error. 7.


Which one of the following has to be replaced to
get the desired output? SELECT * FROM employee WHERE
salary>10000 AND dept_id=101;
SELECT ID, name, dept name, salary * 1.1
WHERE instructor; Which of the following fields are displayed as
output?
a) Salary*1.1 a) Salary, dept_id
b) ID b) Employee
c) Where c) Salary
d) Instructor d) All the field of employee relation
View Answer View Answer

Answer: c Answer: d
Explanation: Where selects the rows on a Explanation: Here * is used to select all the
particular condition. From gives the relation fields of the relation.
which involves the operation. Since Instructor is
a relation it has to have from clause. 8.

5. The ________ clause is used to list the Employee_id Name Salary


attributes desired in the result of a query.
1001 Annie 6000
a) Where
b) Select 1009 Ross 4500
c) From 1018 Zeith 7000
d) Distinct
View Answer This is Employee table.
Which of the following employee_id will be
Answer: b displayed for the given query?
Explanation: None
SELECT * FROM employee WHERE
6. This Query can be replaced by which one of employee_id>1009;
the following?
a) 1009, 1001, 1018
SELECT name, course_id b) 1009, 1018
FROM instructor, teaches c) 1001
WHERE instructor_ID= teaches_ID; d) 1018
View Answer
a) Select name,course_id from teaches,instructor
where instructor_id=course_id;
b) Select name, course_id from instructor natural

7
Answer: d Answer: c
Explanation: Greater than symbol does not Explanation: As keyword is used to rename.
include the given value unlike >=.
2.
9. Which of the following statements contains an
error? SELECT * FROM employee WHERE
a) Select * from emp where empid = 10003; dept_name="Comp Sci";
b) Select empid from emp where empid =
10006; In the SQL given above there is an error .
c) Select empid from emp; Identify the error.
d) Select empid where empid = 1009 and a) Dept_name
lastname = ‘GELLER’; b) Employee
View Answer c) “Comp Sci”
d) From
Answer: d View Answer
Explanation: This query do not have from clause
which specifies the relation from which the Answer: c
values has to be selected. Explanation: For any string operations single
quoted(‘) must be used to enclose.
10. In the given query which of the keyword has
to be inserted? 3.

INSERT INTO employee _____ SELECT emp_name


(1002,Joey,2000); FROM department
WHERE dept_name LIKE ’ _____ Computer
a) Table Science’;
b) Values
c) Relation Which one of the following has to be added into
d) Field the blank to select the dept_name which has
View Answer Computer Science as its ending string?
a) %
Answer: b b) _
Explanation: Value keyword has to be used to c) ||
insert the values into the table. d) $
View Answer
1.
Answer: a
SELECT name ____ instructor name, course id Explanation: The % character matches any
FROM instructor, teaches substring.
WHERE instructor.ID= teaches.ID;
4. ’_ _ _ ’ matches any string of ______ three
Which keyword must be used here to rename the characters. ’_ _ _ %’ matches any string of at
field name? ______ three characters.
a) From a) Atleast, Exactly
b) Rename b) Exactly, Atleast
c) As c) Atleast, All
d) Join d) All, Exactly
View Answer View Answer

8
Answer: b This query can be replaced by which of the
Explanation: None. following ?
a)
5.
SELECT name
SELECT name FROM instructor
FROM instructor WHERE salary BETWEEN 90000 AND
WHERE dept name = ’Physics’ 100000;
ORDER BY name;
b)
By default, the order by clause lists items in
______ order. SELECT name
a) Descending FROM employee
b) Any WHERE salary <= 90000 AND
c) Same salary>=100000;
d) Ascending
View Answer c)

Answer: d SELECT name


Explanation: Specification of descending order FROM employee
is essential but it not for ascending. WHERE salary BETWEEN 90000 AND
100000;
6.
d)
SELECT *
FROM instructor SELECT name
ORDER BY salary ____, name ___; FROM instructor
WHERE salary BETWEEN 100000 AND
To display the salary from greater to smaller and 90000;
name in ascending order which of the following View Answer
options should be used? Answer: a
a) Ascending, Descending Explanation: SQL includes a between
b) Asc, Desc comparison operator to simplify where clauses
c) Desc, Asc that specify that a value be less than or equal to
d) Descending, Ascending some value and greater than or equal to some
View Answer other value.

Answer: c
Explanation: None.
8.
7.
SELECT instructor.*
advertisement FROM instructor, teaches
WHERE instructor.ID= teaches.ID;
SELECT name
FROM instructor This query does which of the following
WHERE salary <= 100000 AND salary >= operation?
90000; a) All attributes of instructor and teaches are
selected
b) All attributes of instructor are selected on the

9
given condition c) All
c) All attributes of teaches are selected on given d) Repeating
condition View Answer
d) Only the some attributes from instructed and
teaches are selected Answer: b
View Answer Explanation: Intersection operator ignores
unique tuples and takes only common ones.
Answer: b
Explanation: The asterisk symbol “ * ” can be 3. The union operation automatically
usedin the select clause to denote “all __________ unlike the select clause.
attributes.” a) Adds tuples
b) Eliminates unique tuples
9. In SQL the spaces at the end of the string are c) Adds common tuples
removed by _______ function. d) Eliminates duplicate
a) Upper View Answer
b) String
c) Trim Answer: d
d) Lower Explanation: None.
View Answer
4. If we want to retain all duplicates, we must
Answer: c write ________ in place of union.
Explanation: The syntax of trim is Trim(s); a) Union all
where s-string. b) Union some
c) Intersect all
10. _____ operator is used for appending two d) Intersect some
strings. View Answer
a) &
b) % Answer: a
c) || Explanation: Union all will combine all the
d) _ tuples including duplicates.
View Answer
5.
Answer: c
Explanation: || is the concatenation operator. (SELECT course id
FROM SECTION
1. The union operation is represented by WHERE semester = ’Fall’ AND YEAR= 2009)
a) ∩ EXCEPT
b) U (SELECT course id
c) – FROM SECTION
d) * WHERE semester = ’Spring’ AND YEAR=
View Answer 2010);

Answer: b This query displays


Explanation: Union operator combines the a) Only tuples from second part
relations. b) Only tuples from the first part which has the
tuples from second part
2. The intersection operator is used to get the c) Tuples from both the parts
_____ tuples. d) Tuples from first part which do not have
a) Different second part
b) Common View Answer

10
Answer: d Answer: b
Explanation: Except keyword is used to ignore Explanation: It is optional to give the inner
the values. keyword with the join as it is default.

6. For like predicate which of the following is 10. The _____________ is essentially used to
true. search for patterns in target string.
a) Like Predicate
i) % matches zero OF more characters. b) Null Predicate
ii) _ matches exactly one CHARACTER. c) In Predicate
d) Out Predicate
a) i-only View Answer
b) ii-only
c) i & ii Answer: a
d) None of the mentioned Explanation: Like predicate matches the string
View Answer in the given pattern.

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


Explanation:% is used with like and _ is used to exist but be unknown or that may not exist at all.
fill in the character. a) Empty tuple
advertisement b) New value
c) Null value
7. The number of attributes in relation is called d) Old value
as its View Answer
a) Cardinality
b) Degree Answer: c
c) Tuples Explanation: None.
d) Entity
View Answer 2. If the attribute phone number is included in
the relation all the values need not be entered
Answer: b into the phone number column. This type of
Explanation: None. entry is given as
a) 0
8. _____ clause is an additional filter that is b) –
applied to the result. c) Null
a) Select d) Empty space
b) Group-by View Answer
c) Having
d) Order by Answer: c
View Answer Explanation: Null is used to represent the
absence of a value.
Answer: c
Explanation: Having is used to provide 3. The predicate in a where clause can involve
additional aggregate filtration to the query. Boolean operations such as and. The result of
true and unknown is_______ false and unknown
9. _________ joins are SQL server default is _____ while unknown and unknown is _____
a) Outer a) Unknown, unknown, false
b) Inner b) True, false, unknown
c) Equi c) True, unknown, unknown
d) None of the mentioned d) Unknown, false, unknown
View Answer View Answer

11
Answer: d INSERT INTO employee VALUES
Explanation: None. (1005,Rach,0);
INSERT INTO employee VALUES (1007,Ross,
4. );
INSERT INTO employee VALUES
SELECT name (1002,Joey,335);
FROM instructor
WHERE salary IS NOT NULL; Some of these insert statements will produce an
Selects error. Identify the statement.
a) Insert into employee values (1005,Rach,0);
a) Tuples with null value b) Insert into employee values (1002,Joey,335);
b) Tuples with no null values c) Insert into employee values (1007,Ross, );
c) Tuples with any salary d) None of the mentioned
d) All of the mentioned View Answer
View Answer
Answer: c
Answer: b Explanation: Not null constraint is specified
Explanation: Not null constraint removes the which means sone value (can include 0 also)
tpules of null values. should be given.

5. In an employee table to include the attributes 8. The primary key must be


whose value always have some value which of a) Unique
the following constraint must be used? b) Not null
a) Null c) Both Unique and Not null
b) Not null d) Either Unique or Not null
c) Unique View Answer
d) Distinct
View Answer Answer: c
Explanation: Primary key must satisfy unique
Answer: b and not null condition for sure.
Explanation: Not null constraint removes the advertisement
tuples of null values.
9. You attempt to query the database with this
6. Using the ______ clause retains only one command:
copy of such identical tuples.
a) Null SELECT nvl (100 / quantity, NONE)
b) Unique FROM inventory;
c) Not null
d) Distinct Why does this statement cause an error when
View Answer QUANTITY values are null?
a) The expression attempts to divide by a null
Answer: d value
Explanation: Unique is a constraint. b) The data types in the conversion function are
incompatible
7. c) The character string none should be enclosed
in single quotes (‘ ‘)
CREATE TABLE employee (id d) A null value used in an expression cannot be
INTEGER,name VARCHAR(20),salary NOT converted to an actual value
NULL); View Answer

12
Answer: a If we do want to eliminate duplicates, we use the
Explanation: The expression attempts to divide keyword ______in the aggregate expression.
by a null value is erroneous in sql. a) Distinct
b) Count
10. The result of _____unknown is unknown. c) Avg
a) Xor d) Primary key
b) Or View Answer
c) And
d) Not Answer: a
View Answer Explanation: Distinct keyword is used to select
only unique items from the relation.
Answer: d
Explanation: Since unknown does not hold any 4. All aggregate functions except _____ ignore
value the value cannot have a reverse value. null values in their input collection.
a) Count(attribute)
1. Aggregate functions are functions that take a b) Count(*)
___________ as input and return a single value. c) Avg
a) Collection of values d) Sum
b) Single value View Answer
c) Aggregate value
d) Both Collection of values & Single value Answer: b
View Answer Explanation: * is used to select all values
including null.
Answer: a
Explanation: None. 5. A Boolean data type that can take values true,
false, and________
2. a) 1
b) 0
SELECT __________ c) Null
FROM instructor d) Unknown
WHERE dept name= ’Comp. Sci.’; View Answer

Which of the following should be used to find Answer: d


the mean of the salary ? Explanation: Unknown values do not take null
a) Mean(salary) value but it is not known.
b) Avg(salary)
c) Sum(salary) 6. The ____ connective tests for set membership,
d) Count(salary) where the set is a collection of values produced
View Answer by a select clause. The ____ connective tests for
the absence of set membership.
Answer: b a) Or, in
Explanation: Avg() is used to find the mean of b) Not in, in
the values. c) In, not in
d) In, or
3. View Answer

SELECT COUNT (____ ID) Answer: c


FROM teaches Explanation: In checks, if the query has the
WHERE semester = ’Spring’ AND YEAR = value but not in checks if it does not have the
2010; value.

13
7. Which of the following should be used to find Answer: d
all the courses taught in the Fall 2009 semester Explanation: >some takes atlest one value above
but not in the Spring 2010 semester . it .
a)
9. Which of the following is used to find all
SELECT DISTINCT course id courses taught in both the Fall 2009 semester
FROM SECTION and in the Spring 2010 semester .
WHERE semester = ’Fall’ AND YEAR= 2009 a)
AND
course id NOT IN (SELECT course id SELECT course id
FROM SECTION FROM SECTION AS S
WHERE semester = ’Spring’ AND YEAR= WHERE semester = ’Fall’ AND YEAR= 2009
2010); AND
EXISTS (SELECT *
b) FROM SECTION AS T
WHERE semester = ’Spring’ AND YEAR=
SELECT DISTINCT course_id 2010 AND
FROM instructor S.course id= T.course id);
WHERE name NOT IN (’Fall’, ’Spring’);
b)
c)
SELECT name
(SELECT course id FROM instructor
FROM SECTION WHERE salary > SOME (SELECT salary
WHERE semester = ’Spring’ AND YEAR= FROM instructor
2010) WHERE dept name = ’Biology’);

d) c)

advertisement SELECT COUNT (DISTINCT ID)


FROM takes
SELECT COUNT (DISTINCT ID) WHERE (course id, sec id, semester, YEAR) IN
FROM takes (SELECT course id, sec id, semester, YEAR
WHERE (course id, sec id, semester, YEAR) IN FROM teaches
(SELECT course id, sec id, semester, YEAR WHERE teaches.ID= 10101);
FROM teaches
WHERE teaches.ID= 10101); d)
View Answer
Answer: a (SELECT course id
Explanation: None. FROM SECTION
WHERE semester = ’Spring’ AND YEAR=
2010)
View Answer
8. The phrase “greater than at least one” is Answer: a
represented in SQL by _____ Explanation: None.
a) < all
b) < some
c) > all
d) > some 10. We can test for the nonexistence of tuples in
View Answer a subquery by using the _____ construct.

14
a) Not exist b) Having, where
b) Not exists c) Group by, having
c) Exists d) Group by, where
d) Exist View Answer
View Answer
Answer: b
Answer: b Explanation: To include aggregate functions
Explanation: Exists is used to check for the having clause must be included after where.
existence of tuples.
4. The ________ keyword is used to access
1. attributes of preceding tables or subqueries in
the from clause.
SELECT dept_name, ID, avg (salary) a) In
FROM instructor b) Lateral
GROUP BY dept_name; c) Having
This statement IS erroneous because d) With
View Answer
a) Avg(salary) should not be selected
b) Dept_id should not be used in group by clause Answer: b
c) Misplaced group by clause Explanation:
d) Group by clause is not valid in this query Eg : SELECT name, salary, avg salary
View Answer FROM instructor I1, lateral (SELECT
avg(salary) AS avg salary
Answer: b FROM instructor I2
Explanation: Any attribute that is not present in WHERE I2.dept name= I1.dept name);
the group by clause must appear only inside an
aggregate function if it appears in the select Without the lateral clause, the subquery cannot
clause, otherwise the query is treated as access the correlation variable
erroneous. I1 from the outer query.

2. SQL applies predicates in the _______ clause 5. Which of the following creates a temporary
after groups have been formed, so aggregate relation for the query on which it is defined?
functions may be used. a) With
a) Group by b) From
b) With c) Where
c) Where d) Select
d) Having View Answer
View Answer
Answer: a
Answer: b Explanation: The with clause provides a way of
Explanation: The with clause provides away of defining a temporary relation whose definition is
defining a temporary relation whose definition is available only to the query in which the with
available only to the query in which the with clause occurs.
clause occurs.
6.
3. Aggregate functions can be used in the select
list or the_______clause of a select statement or WITH max_budget (VALUE) AS
subquery. They cannot be used in a ______ (SELECT MAX(budget)
clause. FROM department)
a) Where, having SELECT budget

15
FROM department, max_budget Answer: a
WHERE department.budget = MAX Explanation: EXISTS keyword checks for
budget.value; existance of a condition.

In the query given above which one of the 10. How can you find rows that do not match
following is a temporary relation? some specified condition?
a) Budget a) EXISTS
b) Department b) Double use of NOT EXISTS
c) Value c) NOT EXISTS
d) Max_budget d) None of the mentioned
View Answer View Answer

Answer: d Answer: b
Explanation: With clause creates a temporary Explanation: None.
relation.
advertisement 1. A Delete command operates on ______
relation.
7. Subqueries cannot: a) One
a) Use group by or group functions b) Two
b) Retrieve data from a table different from the c) Several
one in the outer query d) Null
c) Join tables View Answer
d) Appear in select, update, delete, insert
statements. Answer: a
View Answer Explanation: Delete can delete from only one
table at a time.
Answer: c
Explanation: None. 2.

8. Which of the following is not an aggregate Delete from r where P;


function?
a) Avg The above command
b) Sum a) Deletes a particular tuple from the relation
c) With b) Deletes the relation
d) Min c) Clears all entries from the relation
View Answer d) All of the mentioned
View Answer
Answer: c
Explanation: With is used to create temporary Answer: a
relation and its not an aggregate function. Explanation: Here P gives the condition for
deleting specific rows.
9. The EXISTS keyword will be true if:
a) Any row in the subquery meets the condition 3. Which one of the following deletes all the
only entries but keeps the structure of the relation.
b) All rows in the subquery fail the condition a) Delete from r where P;
only b) Delete from instructor where dept name=
c) Both of these two conditions are met ’Finance’;
d) Neither of these two conditions is met c) Delete from instructor where salary between
View Answer 13000 and 15000;

16
d) Delete from instructor; WHERE building='Watson';
View Answer
c)
Answer: d
Explanation: Absence of condition deletes all DELETE FROM instructor
rows. WHERE dept_name IN (SELECT dept name
FROM department
4. Which of the following is used to insert a WHERE building = ’Watson’);
tuple from another relation?
a) d) None of the mentioned
View Answer
INSERT INTO course (course id, title, dept
name, credits) Answer: c
VALUES (’CS-437’, ’DATABASE Systems’, Explanation: The query must include
’Comp. Sci.’, 4); building=watson condition to filter the tuples.
advertisement
b)
6.
INSERT INTO instructor
SELECT ID, name, dept name, 18000 UPDATE instructor
FROM student _____ salary= salary * 1.05;
WHERE dept name = ’Music’ AND tot cred >
144; Fill in with correct keyword to update the
instructor relation.
c) a) Where
b) Set
INSERT INTO course VALUES (’CS-437’, c) In
’DATABASE Systems’, ’Comp. Sci.’, 4); d) Select
View Answer
d) Not possible
View Answer Answer: b
Explanation: Set is used to update the particular
Answer: b value.
Explanation: Using select statement in insert
will include rows which are the result of the 7. _________ are useful in SQL update
selection. statements, where they can be used in the set
clause.
5. Which of the following deletes all tuples in a) Multiple queries
the instructor relation for those instructors b) Sub queries
associated with a department located in the c) Update
Watson building which is in department relation. d) Scalar subqueries
a) View Answer

DELETE FROM instructor Answer: d


WHERE dept_name IN 'Watson'; Explanation: None.

b) 8. The problem of ordering the update in


multiple updates is avoided using
DELETE FROM department a) Set
b) Where

17
c) Case UPDATE instructor
d) When SET salary = salary * 1.03
View Answer WHERE salary > 100000;
UPDATE instructor
Answer: c SET salary = salary * 1.05
Explanation: The case statements can add the WHERE salary <= 100000;
order of updating tuples.
b)
9. Which of the following is the correct format
for case statements. UPDATE instructor
a) SET salary = salary * 1.05
WHERE salary < (SELECT avg (salary)
CASE FROM instructor);
WHEN pred1 ... result1
WHEN pred2 ... result2 c)
...
WHEN predn ... resultn UPDATE instructor
ELSE result0 SET salary = CASE
END WHEN salary <= 100000 THEN salary * 1.03
ELSE salary * 1.05
b) END

CASE d) None of the mentioned


WHEN pred1 THEN result1 View Answer
WHEN pred2 THEN result2
... Answer: a
WHEN predn THEN resultn Explanation: The order of the two update
ELSE result0 statements is important. If we changed the order
END of the two statements, an instructor with a salary
just under $100,000 would receive an over 8
c) percent raise. SQL provides a case construct that
we can use to perform both the updates with a
CASE single update statement, avoiding the problem
WHEN pred1 THEN result1 with the order of updates.
WHEN pred2 THEN result2
... 1. The____condition allows a general predicate
WHEN predn THEN resultn over the relations being joined.
ELSE result0 a) On
b) Using
d) All of the mentioned c) Set
View Answer d) Where
View Answer
Answer: b
Explanation: None. Answer: a
Explanation: On gives the condition for the join
10. Which of the following relation updates all expression.
instructors with salary over $100,000 receive a 3
percent raise, whereas all others receive a 5 2. Which of the join operations do not preserve
percent raise. non matched tuples?
a) a) Left outer join

18
b) Right outer join record in the two joined tables to have a
c) Inner join matching record..
d) Natural join advertisement
View Answer
5. How many tables may be included with a
Answer: c join?
Explanation: INNER JOIN: Returns all rows a) One
when there is at least one match in BOTH tables. b) Two
c) Three
3. d) All of the mentioned
View Answer
SELECT *
FROM student JOIN takes USING (ID); Answer: d
Explanation: Join can combine multiple tables.
The above query is equivalent to
a) 6. Which are the join types in join condition:
a) Cross join
SELECT * b) Natural join
FROM student INNER JOIN takes USING c) Join with USING clause
(ID); d) All of the mentioned
View Answer
b)
Answer: d
SELECT * Explanation: There are totally four join types in
FROM student OUTER JOIN takes USING SQL.
(ID);
7. How many join types in join condition:
c) a) 2
b) 3
SELECT * c) 4
FROM student LEFT OUTER JOIN takes d) 5
USING (ID); View Answer

d) None of the mentioned Answer: d


View Answer Explanation: Types are inner join, left outer join,
right outer join, full join, cross join.
Answer: a
Explanation: Join can be replaced by inner join. 8. Which join refers to join records from the
right table that have no matching key in the left
table are include in the result set:
4. What type of join is needed when you wish to
a) Left outer join
include rows that do not have matching values?
b) Right outer join
a) Equi-join
c) Full outer join
b) Natural join
d) Half outer join
c) Outer join
View Answer
d) All of the mentioned
View Answer
Answer: b
Explanation: RIGHT OUTER JOIN: Return all
Answer: c
rows from the right table and the matched rows
Explanation: An outer join does not require each
from the left table.

19
9. The operation which is not considered a basic SELECT course_id
operation of relational algebra is FROM physics_fall_2009
a) Join WHERE building= ’Watson’;
b) Selection
c) Union Here the tuples are selected from the
d) Cross product view.Which one denotes the view.
View Answer a) Course_id
b) Watson
Answer: a c) Building
Explanation: None. d) physics_fall_2009
View Answer
10. In SQL the statement select * from R, S is
equivalent to Answer: c
a) Select * from R natural join S Explanation: View names may appear in a query
b) Select * from R cross join S any place where a relation name may appear.
c) Select * from R union join S
d) Select * from R inner join S 4. Materialised views make sure that
View Answer a) View definition is kept stable
b) View definition is kept up-to-date
Answer: b c) View definition is verified for error
Explanation: None. d) View is deleted after specified time
View Answer
1. Which of the following creates a virtual
relation for storing the query? Answer: b
a) Function Explanation: None.
b) View
c) Procedure 5. Updating the value of the view
d) None of the mentioned a) Will affect the relation from which it is
View Answer defined
b) Will not change the view definition
Answer: b c) Will not affect the relation from which it is
Explanation: Any such relation that is not part of defined
the logical model, but is made visible to a user d) Cannot determine
as a virtual relation, is called a view. View Answer

2. Which of the following is the syntax for views Answer: a


where v is view name? Explanation: None.
a) Create view v as “query name”;
b) Create “query expression” as view; 6. SQL view is said to be updatable (that is,
c) Create view v as “query expression”; inserts, updates or deletes can be applied on the
d) Create view “query expression”; view) if which of the following conditions are
View Answer satisfied by the query defining the view?
a) The from clause has only one database
Answer: c relation
Explanation: <query expression> is any legal b) The query does not have a group by or having
query expression. The view name is represented clause
by v. c) The select clause contains only attribute
names of the relation and does not have any
3. expressions, aggregates, or distinct specification

20
d) All of the mentioned WHERE instructor.dept name= department.dept
View Answer name;

Answer: d b)
Explanation: All of the conditions must be
satisfied to update the view in sql. CREATE VIEW instructor_info
SELECT ID, name, building
7. Which of the following is used at the end of FROM instructor, department;
the view to reject the tuples which do not satisfy
the condition in where clause? c)
a) With
b) Check CREATE VIEW instructor_info AS
c) With check SELECT ID, name, building
d) All of the mentioned FROM instructor;
View Answer
d)
Answer: c
Explanation: Views can be defined with a with advertisement
check option clause at the end of the view
definition; then, if a tuple inserted into the view CREATE VIEW instructor_info AS
does not satisfy the view’s where clause SELECT ID, name, building
condition, the insertion is rejected by the FROM department;
database system. View Answer
Answer: a
8. Consider the two relations instructor and Explanation: None.
department
Instructor:

ID Name Dept_name Salary 9. For the view Create view instructor_info as


1001 Ted Finance 10000
SELECT ID, name, building
1002 Bob Music 20000
FROM instructor, department
1003 Ron Physics 50000 WHERE instructor.dept name=
department.dept name;
Department:
If we insert tuple into the view as insert into
Dept_name Building Budget instructor info values (’69987’, ’White’,
’Taylor’);
Biology Watson 40000
What will be the values of the other attributes in
Chemistry Painter 30000 instructor and department relations?
Music Taylor 50000 a) Default value
b) Null
Which of the following is used to create view for c) Error statement
these relations together? d) 0
a) View Answer

CREATE VIEW instructor_info AS Answer: b


SELECT ID, name, building Explanation: The values take null if there is no
FROM instructor, department constraint in the attribute else it is an Erroneous
statement.

21
10. Answer: c
Explanation: Rollback work causes the current
CREATE VIEW faculty AS transaction to be rolled back; that is, it undoes
SELECT ID, name, dept name all the updates performed by the SQL statements
FROM instructor; in the transaction.

Find the error in this query. 4. Consider the following action:


a) Instructor
b) Select TRANSACTION.....
c) View …as Commit;
d) None of the mentioned ROLLBACK;
View Answer
What does Rollback do?
Answer: d a) Undoes the transactions before commit
Explanation: Syntax is – create view v as <query b) Clears all transactions
expression>;. c) Redoes the transactions before commit
d) No action
1. A _________ consists of a sequence of query View Answer
and/or update statements.
a) Transaction Answer: d
b) Commit Explanation: Once a transaction has executed
c) Rollback commit work, its effects can no longer be
d) Flashback undone by rollback work.
View Answer
5. In case of any shut down during transaction
Answer: a before commit which of the following statement
Explanation: Transaction is a set of operation is done automatically?
until commit. a) View
b) Commit
2. Which of the following makes the transaction c) Rollback
permanent in the database? d) Flashback
a) View View Answer
b) Commit
c) Rollback Answer: c
d) Flashback Explanation: Once a transaction has executed
View Answer commit work, its effects can no longer be
undone by rollback work.
Answer: b
Explanation: Commit work commits the current 6. In order to maintain the consistency during
transaction. transactions, database provides
a) Commit
3. In order to undo the work of transaction after b) Atomic
last commit which one should be used? c) Flashback
a) View d) Retain
b) Commit View Answer
c) Rollback
d) Flashback Answer: b
View Answer Explanation: By atomic, either all the effects of
the transaction are reflected in the database, or
none are (after rollback).

22
7. Transaction processing is associated with a) Create table
everything below except b) Modify table
a) Conforming an action or triggering a response c) Alter table
b) Producing detail summary or exception report d) Drop table
c) Recording a business activity View Answer
d) Maintaining a data
View Answer Answer: c
Explanation: SYNTAX – alter table table-name
Answer: a add constraint, where constraint can be any
Explanation: None. constraint on the relation.

8. A transaction completes its execution is said 2. Which of the following is not an integrity
to be constraint?
a) Committed a) Not null
b) Aborted b) Positive
c) Rolled back c) Unique
d) Failed d) Check ‘predicate’
View Answer View Answer

Answer: a Answer: b
Explanation: A complete transaction always Explanation: Positive is a value and not a
commits. constraint.
advertisement
3.
9. Which of the following is used to get back all
the transactions back after rollback? CREATE TABLE Employee(Emp_id
a) Commit NUMERIC NOT NULL, Name VARCHAR(20)
b) Rollback , dept_name VARCHAR(20), Salary NUMERIC
c) Flashback UNIQUE(Emp_id,Name));
d) Redo INSERT INTO Employee VALUES(1002,
View Answer Ross, CSE, 10000)
INSERT INTO Employee
Answer: c VALUES(1006,Ted,Finance, );
Explanation: None. INSERT INTO Employee
VALUES(1002,Rita,Sales,20000);
10. ______ will undo all statements up to
commit? What will be the result of the query?
a) Transaction a) All statements executed
b) Flashback b) Error in create statement
c) Rollback c) Error in insert into Employee
d) Abort values(1006,Ted,Finance, );
View Answer d) Error in insert into Employee
values(1008,Ross,Sales,20000);
Answer: c View Answer
Explanation: Flashback will undo all the
statements and Abort will terminate the Answer: d
operation. Explanation: The not null specification prohibits
the insertion of a null value for the attribute.
1. To include integrity constraint in an existing The unique specification says that no two tuples
relation use :

23
in the relation can be equal on all the listed c) Set null
attributes. d) All of the mentioned
View Answer
4.
Answer: b
CREATE TABLE Manager(ID Explanation: The delete “cascades” to the course
NUMERIC,Name VARCHAR(20),budget relation, deletes the tuple that refers to the
NUMERIC,Details VARCHAR(30)); department that was deleted.
advertisement
Inorder to ensure that the value of budget is non-
negative which of the following should be used? 7. Domain constraints, functional dependency
a) Check(budget>0) and referential integrity are special forms of
b) Check(budget<0) _________
c) Alter(budget>0) a) Foreign key
d) Alter(budget<0) b) Primary key
View Answer c) Assertion
d) Referential constraint
Answer: a View Answer
Explanation: A common use of the check clause
is to ensure that attribute values satisfy specified Answer: c
conditions, in effect creating a powerful type Explanation: An assertion is a predicate
system. expressing a condition we wish the database to
always satisfy.
5. Foreign key is the one in which the ________
of one relation is referenced in another relation. 8. Which of the following is the right syntax for
a) Foreign key the assertion?
b) Primary key a) Create assertion ‘assertion-name’ check
c) References ‘predicate’;
d) Check constraint b) Create assertion check ‘predicate’ ‘assertion-
View Answer name’;
c) Create assertions ‘predicates’;
Answer: b d) All of the mentioned
Explanation: The foreign-key declaration View Answer
specifies that for each course tuple, the
department name specified in the tuple must Answer: a
exist in the department relation. Explanation: None.

6. 9. Data integrity constraints are used to:


a) Control who is allowed access to the data
CREATE TABLE course b) Ensure that duplicate records are not entered
(... into the table
FOREIGN KEY (dept name) REFERENCES c) Improve the quality of data entered for a
department specific property (i.e., table column)
. . . ); d) Prevent users from changing the values stored
in the table
Which of the following is used to delete the View Answer
entries in the referenced table when the tuple is
deleted in course table? Answer: c
a) Delete Explanation: None.
b) Delete cascade

24
10. Which of the following can be addressed by a) StudentID_index
enforcing a referential integrity constraint? b) ID
a) All phone numbers must include the area code c) StudentID
b) Certain fields are required (such as the email d) Student
address, or phone number) before the record is View Answer
accepted
c) Information on the customer must be known Answer: d
before anything can be sold to that customer Explanation: The statement creates an index
d) When entering an order quantity, the user named studentID index on the attribute ID of the
must input a number and not some text (i.e., 12 relation student.
rather than ‘a dozen’)
View Answer 4. Which of the following is used to store movie
and image files?
Answer: c a) Clob
Explanation: The information can be referred to b) Blob
and obtained. c) Binary
d) Image
1. Dates must be specified in the format View Answer
a) mm/dd/yy
b) yyyy/mm/dd Answer: b
c) dd/mm/yy Explanation: SQL therefore provides large-
d) yy/dd/mm object data types for character data (clob) and
View Answer binary data (blob). The letters “lob” in these data
types stand for “Large OBject”.
Answer: b
Explanation: yyyy/mm/dd is the default format 5. The user defined data type can be created
in sql. using
a) Create datatype
2. A ________ on an attribute of a relation is a b) Create data
data structure that allows the database system to c) Create definetype
find those tuples in the relation that have a d) Create type
specified value for that attribute efficiently, View Answer
without scanning through all the tuples of the
relation. Answer: d
a) Index Explanation: The create type clause can be used
b) Reference to define new types.Syntax : create type Dollars
c) Assertion as numeric(12,2) final; .
d) Timestamp
View Answer 6. Values of one type can be converted to
another domain using which of the following?
Answer: a a) Cast
Explanation: Index is the reference to the tuples b) Drop type
in a relation. c) Alter type
d) Convert
3. View Answer

Create index studentID_index on student(ID); Answer: a


Explanation: Example of cast :cast
Here which one denotes the relation for which (department.budget to numeric(12,2)). SQL
index is created?

25
provides drop type and alter type clauses to drop Answer: a
or modify types that have been created earlier. Explanation: None.

7. 10. Which of the following statements creates a


new table temp instructor that has the same
CREATE DOMAIN YearlySalary schema as an instructor.
NUMERIC(8,2) a) create table temp_instructor;
CONSTRAINT salary VALUE test b) Create table temp_instructor like instructor;
__________; c) Create Table as temp_instructor;
d) Create table like temp_instructor;
In order to ensure that an instructor’s salary View Answer
domain allows only values greater than a
specified value use: Answer: b
a) Value>=30000.00 Explanation: None.
b) Not null;
c) Check(value >= 29000.00); 1. The database administrator who authorizes all
d) Check(value) the new users, modifies the database and takes
View Answer grants privilege is
a) Super user
Answer: c b) Administrator
Explanation: Check(value ‘condition’) is the c) Operator of operating system
syntax. d) All of the mentioned
View Answer
8. Which of the following closely resembles
Create view? Answer: d
a) Create table . . .like Explanation: The authorizations provided by the
b) Create table . . . as administrator to the user is a privilege.
c) With data
d) Create view as 2. Which of the following is a basic form of
View Answer grant statement?
a)
Answer: b
Explanation: The ‘create table . . . as’ statement GRANT 'privilege list'
closely resembles the create view statement and ON 'relation name or view name'
both are defined by using queries. The main TO 'user/role list';
difference is that the contents of the table are set
when the table is created, whereas the contents b)
of a view always reflect the current query result.
advertisement GRANT 'privilege list'
ON 'user/role list'
9. In contemporary databases, the top level of TO 'relation name or view name';
the hierarchy consists of ______ each of which
can contain _____ c)
a) Catalogs, schemas
b) Schemas, catalogs GRANT 'privilege list'
c) Environment, schemas TO 'user/role list'
d) Schemas, Environment
View Answer d)

26
GRANT 'privilege list' c)
ON 'relation name or view name'
ON 'user/role list'; CREATE ROLE instructor;
View Answer GRANT DELETE ON takes
Answer: a TO instructor;
Explanation: The privilege list allows the
granting of several privileges in one command . d) All of the mentioned
View Answer

Answer: c
3. Which of the following is used to provide Explanation: The role is first created and the
privilege to only a particular attribute? authorization is given on relation takes to the
a) Grant select on employee to Amit role.
b) Grant update(budget) on department to Raj
c) Grant update(budget,salary,Rate) on 6. Which of the following is true regarding
department to Raj views?
d) Grant delete to Amit a) The user who creates a view cannot be given
View Answer update authorization on a view without having
update authorization on the relations used to
Answer: b define the view
Explanation: This grant statement gives user Raj b) The user who creates a view cannot be given
update authorization on the budget attribute of update authorization on a view without having
the department relation. update authorization on the relations used to
define the view
4. Which of the following statement is used to c) If a user creates a view on which no
remove the privilege from the user Amir? authorization can be granted, the system will
a) Remove update on department from Amir allow the view creation request
b) Revoke update on employee from Amir d) A user who creates a view receives all
c) Delete select on department from Raj privileges on that view
d) Grant update on employee from Amir View Answer
View Answer
Answer: c
Answer: b Explanation: A user who creates a view does not
Explanation: revoke on from ; necessarily receive all privileges on that view.

5. Which of the following is used to provide 7. If we wish to grant a privilege and to allow
delete authorization to instructor? the recipient to pass the privilege on to other
a) users, we append the __________ clause to the
appropriate grant command.
advertisement a) With grant
b) Grant user
CREATE ROLE instructor ; c) Grant pass privelege
GRANT DELETE TO instructor; d) With grant option
View Answer
b)
Answer: d
CREATE ROLE instructor; Explanation: None.
GRANT SELECT ON takes
TO instructor; 8. In authorization graph, if DBA provides
authorization to u1 which inturn gives to u2

27
which of the following is correct? 1. Which of the following is used to access the
a) If DBA revokes authorization from u1 then u2 database server at the time of executing the
authorization is also revoked program and get the data from the server
b) If u1 revokes authorization from u2 then u2 accordingly?
authorization is revoked a) Embedded SQL
c) If DBA & u1 revokes authorization from u1 b) Dynamic SQL
then u2 authorization is also revoked c) SQL declarations
d) If u2 revokes authorization then u1 d) SQL data analysis
authorization is revoked View Answer
View Answer
Answer: b
Answer: c Explanation: Embedded SQL, the SQL
Explanation: A user has an authorization if and statements are identified at compile time using a
only if there is a path from the root of the preprocessor. The preprocessor submits the SQL
authorization graph down to the node statements to the database system for
representing the user. precompilation and optimization; then it replaces
the SQL statements in the application program
9. Which of the following is used to avoid with appropriate code and function calls before
cascading of authorizations from the user? invoking the programming-language compiler.
a) Granted by current role
b) Revoke select on department from Amit, 2. Which of the following header must be
Satoshi restrict; included in java program to establish database
c) Revoke grant option for select on department connectivity using JDBC ?
from Amit; a) Import java.sql.*;
d) Revoke select on department from Amit, b) Import java.sql.odbc.jdbc.*;
Satoshi cascade; c) Import java.jdbc.*;
View Answer d) Import java.sql.jdbc.*;
View Answer
Answer: b
Explanation: The revoke statement may specify Answer: a
restrict in order to prevent cascading revocation. Explanation: The Java program must import
The keyword cascade can be used instead of java.sql.*, which contains the interface
restrict to indicate that revocation should definitions for the functionality provided by
cascade. JDBC.

10. The granting and revoking of roles by the 3. DriverManager.getConnection(_______ ,


user may cause some confusions when that user ______ , ______)
role is revoked. To overcome the above situation What are the two parameters that are included?
a) The privilege must be granted only by roles a) URL or machine name where server runs,
b) The privilege is granted by roles and users Password, User ID
c) The user role cannot be removed once given b) URL or machine name where server runs,
d) By restricting the user access to the roles User ID, Password
View Answer c) User ID, Password, URL or machine name
where server runs
Answer: a d) Password, URL or machine name where
Explanation: The current role associated with a server runs, User ID
session can be set by executing set role name. View Answer
The specified role must have been granted to the
user, else the set role statement fails. Answer: b
Explanation: The database must be opened first

28
in order to perform any operations for which this b) EXEC SQL <embedded SQL statement >
get connection method is used. END-EXEC
c) EXEC SQL <embedded SQL statement >
4. Which of the following invokes functions in d) EXEC SQL <embedded SQL statement >
sql? END EXEC;
a) Prepared Statements View Answer
b) Connection statement
c) Callable statements Answer: b
d) All of the mentioned Explanation: EXEC SQL <embedded SQL
View Answer statement >; is normally in C.

Answer: c 8. Which of the following is used to distinguish


Explanation: JDBC provides a Callable the variables in SQL from the host language
Statement interface that allows invocation of variables?
SQL stored procedures and functions. a) .
b) –
5. Which of the following function is used to c) :
find the column count of the particular resultset? d) ,
a) getMetaData() View Answer
b) Metadata()
c) getColumn() Answer: b
d) get Count() Explanation:
View Answer EXEC SQL
DECLARE c cursor FOR
Answer: a SELECT ID, name
Explanation: The interface ResultSet FROM student
has a method, getMetaData(), that returns a WHERE tot cred > :credit amount;
ResultSetMetaData object that contains
metadata about the result set. .
ResultSetMetaData, in turn, has methods to find
metadata information, such as the number of advertisement
columns in the result, the name of a specified
column, or the type of a specified column. 9. The update statement can be executed in host
language using
6. Which of the following is a following a) EXEC SQL update c;
statement is a prepared statements? b) EXEC SQL update c into :si, :sn;
a) Insert into department values(?,?,?) c)
b) Insert into department values(x,x,x)
c) SQLSetConnectOption(conn, SQL EXEC SQL
AUTOCOMMIT, 0) UPDATE instructor
d) SQLTransact(conn, SQL ROLLBACK) SET salary = salary + 100
View Answer WHERE CURRENT OF c;

Answer: a d) EXEC SQL update END-SQL


Explanation:? is used as a placeholder whose View Answer
value can be provided later.
Answer: c
7. Which of the following is used as the Explanation: The SQL can be terminated by ; to
embedded SQL in COBOL? terminate the sentence.
a) EXEC SQL <embedded SQL statement >;

29
10. Which of the following is used to access SELECT dept name, budget
large objects from a database ? WHERE dept COUNT(dept name) > 12;
a) setBlob()
b) getBlob() d)
c) getClob()
d) all of the mentioned SELECT dept name, budget
View Answer FROM instructor
WHERE dept COUNT(budget) > 12;
Answer: d View Answer
Explanation: None. Answer: b
Explanation: The count of the dept_name must
1. be checked for the displaying from instructor
relation.
Create function dept count(dept_name
varchar(20))
begin
declare d count integer; 3. Which of the following is used to input the
select count(*) into d count entry and give the result in a variable in a
from instructor procedure?
where instructor.dept_name= dept_name a) Put and get
return d count; b) Get and put
end c) Out and In
d) In and out
Find the error in the the above statement. View Answer
a) Return type missing
b) Dept_name is mismatched Answer: d
c) Reference relation is not mentioned Explanation: Create procedure dept count
d) All of the mentioned proc(in dept name varchar(20), out d count
View Answer integer). Here in and out refers to input and
result of procedure.
Answer: a
Explanation: Return integer should be given 4.
after create function for this particular function.
Create procedure dept_count proc(in dept name
2. For the function created in Question 1, which varchar(20),
of the following is a proper select statement ? out d count integer)
a) begin
select count(*) into d count
SELECT dept name, budget from instructor
FROM instructor where instructor.dept name= dept count
WHERE dept COUNT() > 12; proc.dept name
end
b)
Which of the following is used to call the
SELECT dept name, budget procedure given above ?
FROM instructor a)
WHERE dept COUNT(dept name) > 12;
Declare d_count integer;
c)
b)

30
Declare d_count integer; Answer: c
call dept_count proc(’Physics’, d_count); Explanation: None.

c) 7. Which of the following is the correct format


for if statement?
Declare d_count integer; a)
call dept_count proc(’Physics’);
If boolean expression
d) then statement or compound statement
elseif boolean expression
Declare d_count; then statement or compound statement
call dept_count proc(’Physics’, d_count); else statement or compound statement
View Answer end if
Answer: b
Explanation: Here the ‘Physics’ is in variable b)
and d_count is out variable.
If boolean expression
then statement or compound statement
elsif boolean expression
5. The format for compound statement is then statement or compound statement
a) Begin ……. end else statement or compound statement
b) Begin atomic……. end end if
c) Begin ……. repeat
d) Both Begin ……. end and Begin atomic……. c)
end
View Answer If boolean expression
then statement or compound statement
Answer: d elif boolean expression
Explanation: A compound statement is of the then statement or compound statement
form begin . . . end, and it may contain multiple else statement or compound statement
SQL statements between the begin and the end if
end.A compound statement of the form begin
atomic . . . end ensures that all the statements d)
contained within it are executed as a single
transaction. If boolean expression
advertisement then statement or compound statement
else
6. statement or compound statement
else statement or compound statement
Repeat end if
sequence of statements; View Answer
__________________ Answer: a
end repeat Explanation: The conditional statements
supported by SQL include if-then-else
Fill in the correct option : statements by using this syntax. elif and elsif are
a) While Condition not allowed.
b) Until variable
c) Until boolean expression
d) Until 0
View Answer

31
8. A stored procedure in SQL is a___________ c) Functions
a) Block of functions d) None of the mentioned
b) Group of Transact-SQL statements compiled View Answer
into a single execution plan.
c) Group of distinct SQL statements. Answer: b
d) None of the mentioned Explanation: Triggers are automatically
View Answer generated when a particular operation takes
place.
Answer: b
Explanation: If it an atomic statement then the 2. Triggers are supported in
statements are in single transaction. a) Delete
b) Update
9. Temporary stored procedures are stored in c) Views
_________ database. d) All of the mentioned
a) Master View Answer
b) Model
c) User specific Answer: c
d) Tempdb Explanation: The triggers run after an insert,
View Answer update or delete on a table. They are not
supported for views.
Answer: d
Explanation: None. 3. The CREATE TRIGGER statement is used to
create the trigger. THE _____ clause specifies
10. Declare out of classroom seats condition the table name on which the trigger is to be
attached. The ______ specifies that this is an
DECLARE exit handler FOR OUT OF AFTER INSERT trigger.
classroom seats a) for insert, on
BEGIN b) On, for insert
SEQUENCE OF statements c) For, insert
END d) None of the mentioned
View Answer
The above statements are used for
a) Calling procedures Answer: b
b) Handling Exception Explanation: The triggers run after an insert,
c) Handling procedures update or delete on a table. They are not
d) All of the mentioned supported for views.
View Answer
4. What are the after triggers?
Answer: b a) Triggers generated after a particular operation
Explanation: The SQL procedural language also b) These triggers run after an insert, update or
supports the signaling of exception conditions, delete on a table
and declaring of handlers that can handle the c) These triggers run after an insert, views,
exception, as in this code. update or delete on a table
d) All of the mentioned
1. A __________ is a special kind of a store View Answer
procedure that executes in response to certain
action on the table like insertion, deletion or Answer: b
updation of data. Explanation: AFTER TRIGGERS can be
a) Procedures classified further into three types as: AFTER
b) Triggers

32
INSERT Trigger, AFTER UPDATE Trigger, 9. Triggers ________ enabled or disabled
AFTER DELETE Trigger. a) Can be
b) Cannot be
5. The variables in the triggers are declared c) Ought to be
using d) Always
a) – View Answer
b) @
c) / Answer: a
d) /@ Explanation: Triggers can be manipulated.
View Answer
10. Which prefixes are available to Oracle
Answer: b triggers?
Explanation: Example : declare @empid int; a) : new only
where empid is the variable. b) : old only
c) Both :new and : old
6. The default extension for an Oracle SQL*Plus d) Neither :new nor : old
file is: View Answer
a) .txt
b) .pls Answer: c
c) .ora Explanation: None.
d) .sql
View Answer 1. Any recursive view must be defined as the
union of two subqueries: a _______ query that is
Answer: d nonrecursive and a __________ query.
Explanation: 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 View Answer
b) DURING
c) AFTER Answer: a
d) INSTEAD OF Explanation: First compute the base query and
View Answer add all the resultant tuples to the recursively
defined view relation.
Answer: b
Explanation: Example: During trigger is not 2. Ranking of queries is done by which of the
possible in any database. following?
advertisement a) Group by
b) Order by
8. What are the different in triggers? c) Having
a) Define, Create d) Both Group by and Order by
b) Drop, Comment View Answer
c) Insert, Update, Delete
d) All of the mentioned Answer: b
View Answer Explanation: Order by clause arranges the values
in ascending or descending order where a default
Answer: c is ascending order.
Explanation: Triggers are not possible for create,
drop. 3. In rank() function if one value is shared by
two tuples then

33
a) The rank order continues as counting numbers defined as (r −1)/(n−1).
b) The rank order continues by leaving one rank a) Ntil()
in the middle b) Cum_rank
c) The user specifies the order c) Percent_rank
d) The order does not change d) rank()
View Answer View Answer

Answer: b Answer: c
Explanation: Example. rank() over (order by Explanation: Percent rank of a tuple gives the
(GPA) desc). rank of the tuple as a fraction.

4. The __________ function that does not create 7. Inorder to simplify the null value confusion in
gaps in the ordering. the rank function we can specify
a) Intense_rank() a) Not Null
b) Continue_rank() b) Nulls last
c) Default_rank() c) Nulls first
d) Dense_rank() d) Either Nulls last or first
View Answer View Answer

Answer: d Answer: d
Explanation: For dense_rank() the tuples with Explanation: select ID, rank () over (order by
the second highest value all get rank 2, and GPA desc nulls last) as s rank from student
tuples with the third highest value get rank 3, grades;.
and so on.
8. Suppose we are given a view tot credits (year,
5. num credits) giving the total number of credits
taken by students in each year. The query that
SELECT ID, GPA computes averages over the 3 preceding tuples
FROM student grades in the specified sort order is
ORDER BY GPA a)
____________;
SELECT YEAR, avg(num credits)
Inorder to give only 10 rank on the whole we OVER (ORDER BY YEAR ROWS 3
should use preceding)
a) Limit 10 AS avg total credits
b) Upto 10 FROM tot credits;
c) Only 10
d) Max 10 b)
View Answer
advertisement
Answer: a
Explanation: However, the limit clause does not SELECT YEAR, avg(num credits)
support partitioning, so we cannot get the top n OVER (ORDER BY YEAR ROWS 3
within each partition without performing unbounded preceding)
ranking; further, if more than one student gets AS avg total credits
the same GPA, it is possible that one is included FROM tot credits;
in the top 10, while another is excluded.
c) All of the mentioned
6. If there are n tuples in the partition and the d) None of the mentioned
rank of the tuple is r, then its ________ is View Answer

34
Answer: a d) Dimensional
Explanation: Suppose that instead of going back View Answer
a fixed number of tuples, we want the window to
consist of all prior years we use rows unbounded Answer: a
preceding. Explanation: Given a relation used for data
analysis, we can identify some of its attributes as
9. The functions which construct histograms and measure attributes, since they measure some
use buckets for ranking is value, and can be aggregated upon.Dimension
a) Rank() attribute define the dimensions on which
b) Newtil() measure attributes, and summaries of measure
c) Ntil() attributes, are viewed.
d) None of the mentioned
View Answer 3. The generalization of cross-tab which is
represented visually is ____________ which is
Answer: c also called as data cube.
Explanation: For each tuple, ntile(n) then gives a) Two dimensional cube
the number of the bucket in which it is placed, b) Multidimensional cube
with bucket numbers starting with 1. c) N-dimensional cube
d) Cuboid
10. The command ________________ such View Answer
tables are available only within the transaction
executing the query and are dropped when the Answer: a
transaction finishes. Explanation: Each cell in the cube is identified
a) Create table for the values for the three dimensional
b) Create temporary table attributes.
c) Create view
d) Create label view 4. The process of viewing the cross-tab (Single
View Answer dimensional) with a fixed value of one attribute
is
Answer: b a) Slicing
Explanation: None. b) Dicing
c) Pivoting
1. OLAP stands for d) Both Slicing and Dicing
a) Online analytical processing View Answer
b) Online analysis processing
c) Online transaction processing Answer: a
d) Online aggregate processing Explanation: The slice operation selects one
View Answer particular dimension from a given cube and
provides a new sub-cube. Dice selects two or
Answer: a more dimensions from a given cube and
Explanation: OLAP is the manipulation of provides a new sub-cube.
information to support decision making.
5. The operation of moving from finer-
2. Data that can be modeled as dimension granularity data to a coarser granularity (by
attributes and measure attributes are called means of aggregation) is called a ________
_______ data. a) Rollup
a) Multidimensional b) Drill down
b) Singledimensional c) Dicing
c) Measured d) Pivoting
View Answer

35
Answer: a GROUP BY rollup(item name, color, clothes
Explanation: The opposite operation—that of SIZE);
moving fromcoarser-granularity data to finer-
granularity data—is called a drill down. How many grouping is possible in this rollup?
a) 8
6. In SQL the cross-tabs are created using b) 4
a) Slice c) 2
b) Dice d) 1
c) Pivot View Answer
d) All of the mentioned
View Answer Answer: b
Explanation: { (item name, color, clothes size),
Answer: a (item name, color), (item name), () }.
Explanation: Pivot (sum(quantity) for color in
(’dark’,’pastel’,’white’)). 10. Which one of the following is the right
syntax for DECODE?
7. a) DECODE (search, expression, result [, search,
result]… [, default])
{ (item name, color, clothes size), (item name, b) DECODE (expression, result [, search,
color), (item name, clothes size), (color, clothes result]… [, default], search)
size), (item name), (color), (clothes size), () } c) DECODE (search, result [, search, result]… [,
default], expression)
This can be achieved by using which of the d) DECODE (expression, search, result [,
following ? search, result]… [, default])
a) group by rollup View Answer
b) group by cubic
c) group by Answer: d
d) none of the mentioned Explanation: None
View Answer
1. Relational Algebra is a __________ query
Answer: d language that takes two relations as input and
Explanation: ‘Group by cube’ is used . produces another relation as an output of the
query.
8. What do data warehouses support? a) Relational
a) OLAP b) Structural
b) OLTP c) Procedural
c) OLAP and OLTP d) Fundamental
d) Operational databases View Answer
View Answer
Answer: c
Answer: a Explanation: This language has fundamental and
Explanation: None. other operations which are used on relations.
advertisement
2. Which of the following is a fundamental
9. operation in relational algebra?
a) Set intersection
SELECT item name, color, clothes SIZE, b) Natural join
SUM(quantity) c) Assignment
FROM sales d) None of the mentioned
View Answer

36
Answer: d Answer: d
Explanation: The fundamental operations are Explanation: Generalization Selection takes only
select, project, union, set difference, Cartesian one argument for operation.
product, and rename.
7. Which is a join condition contains an equality
3. Which of the following is used to denote the operator:
selection operation in relational algebra? a) Equijoins
a) Pi (Greek) b) Cartesian
b) Sigma (Greek) c) Natural
c) Lambda (Greek) d) Left
d) Omega (Greek) View Answer
View Answer
Answer: a
Answer: b Explanation: None.
Explanation: The select operation selects tuples advertisement
that satisfy a given predicate.
8. In precedence of set operators, the expression
4. For select operation the ________ appear in is evaluated from
the subscript and the ___________ argument a) Left to left
appears in the paranthesis after the sigma. b) Left to right
a) Predicates, relation c) Right to left
b) Relation, Predicates d) From user specification
c) Operation, Predicates View Answer
d) Relation, Operation
View Answer Answer: b
Explanation: The expression is evaluated from
Answer: a left to right according to the precedence.
Explanation: None.
9. Which of the following is not outer join?
5. The ___________ operation, denoted by −, a) Left outer join
allows us to find tuples that are in one relation b) Right outer join
but are not in another. c) Full outer join
a) Union d) All of the mentioned
b) Set-difference View Answer
c) Difference
d) Intersection Answer: d
View Answer Explanation: The FULL OUTER JOIN keyword
combines the result of both LEFT and RIGHT
Answer: b joins.
Explanation: The expression r − s produces a
relation containing those tuples in r but not in s. 10. The assignment operator is denoted by
a) ->
6. Which is a unary operation: b) <-
a) Selection operation c) =
b) Primitive operation d) ==
c) Projection operation View Answer
d) Generalized selection
View Answer Answer: b
Explanation: The result of the expression to the

37
right of the ← is assigned to the relation variable clauses in our tuple-relational-calculus
on the left of the ←. expression, connected by and (∧).

1. Find the ID, name, dept name, salary for 4. Which of the following symbol is used in the
instructors whose salary is greater than $80,000 . place of except?
a) {t | t ε instructor ∧ t[salary] > 80000} a) ^
b) Э t ∈ r (Q(t)) b) V
c) {t | Э s ε instructor (t[ID] = s[ID]∧ s[salary] > c) ¬
80000)} d) ~
d) None of the mentioned View Answer
View Answer
Answer: c
Answer: a Explanation: The query ¬P negates the value of
Explanation: This expression is in tuple P.
relational format.
5. “Find all students who have taken all courses
2. A query in the tuple relational calculus is offered in the Biology department.” The
expressed as: expressions that matches this sentence is :
a) {t | P() | t} a) Э t ε r (Q(t))
b) {P(t) | t } b) ∀ t ε r (Q(t))
c) {t | P(t)} c) ¬ t ε r (Q(t))
d) All of the mentioned d) ~ t ε r (Q(t))
View Answer View Answer

Answer: c Answer: b
Explanation: The tuple relational calculus, is a Explanation: ∀ is used denote “for all” in SQL.
nonprocedural query language. It describes the
desired information without giving a specific 6. Which of the following is the comparison
procedure for obtaining that information. operator in tuple relational calculus
a) ⇒
3. b) =
c) ε
{t | Э s ε instructor (t[name] = s[name] d) All of the mentioned
∧ Э u ε department (u[dept name] = s[dept View Answer
name]
∧ u[building] = “Watson”))} Answer: b
Explanation: The comparison operators are (<,
Which of the following best describes the query? ≤, =, =, >, ≥).
a) Finds the names of all instructors whose
department is in the Watson building 7. An expression in the domain relational
b) Finds the names of all department is in the calculus is of the form
Watson building a) {P(x1, x2, . . . , xn) | < x1, x2, . . . , xn > }
c) Finds the name of the dapartment whose b) {x1, x2, . . . , xn | < x1, x2, . . . , xn > }
instructor and building is Watson c) { x1, x2, . . . , xn | x1, x2, . . . , xn}
d) Returns the building name of all the d) {< x1, x2, . . . , xn > | P(x1, x2, . . . , xn)}
departments View Answer
View Answer
Answer: d
Answer: a Explanation: Here x1, x2, . . . , xn represent
Explanation: This query has two “there exists” domain variables. P represents a formula

38
composed of atoms, as was the case in the tuple b) Degree
relational calculus. c) Tuple
d) Domain
8. Find the names of all instructors in the View Answer
Physics department together with the course id
of all courses they teach: Answer: d
a) Explanation: None.

{< c > | Э s (< c, a, s, y, b, r, t >ε section 1. An ________ is a set of entities of the same
∧s = “Fall” ∧ y = “2009” type that share the same properties, or attributes.
∨Эu (< c, a, s, y, b, r, t >ε section a) Entity set
∧s = “Spring” ∧ y = “2010” b) Attribute set
c) Relation set
b) d) Entity model
View Answer
{< n, c > | Э i, a (< i, c, a, s, y > ε teaches
∧ Э d, s (< i, n, d, s > ε instructor ∧ d = Answer: a
“Physics”))} Explanation: An entity is a “thing” or “object” in
the real world that is distinguishable from all
c) other objects.

{< n > | Э i, d, s (< i, n, d, s > ε instructor ∧ s > 2. Entity is a _________


80000)} a) Object of relation
b) Present working model
d) c) Thing in real world
d) Model of relation
View Answer
{< i, n, d, s > | < i, n, d, s > ε instructor ∧ s >
80000}
Answer: c
View Answer
Answer: b Explanation: For example, each person in a
Explanation: None. university is an entity.

3. The descriptive property possessed by each


entity set is _________
a) Entity
9. In domain relaional calculus “there exist” can
be expressed as b) Attribute
a) (P1(x)) c) Relation
b) (P1(x)) Э x d) Model
c) V x (P1(x)) View Answer
d) Э x (P1(x))
View Answer Answer: b
Explanation: Possible attributes of the instructor
Answer: d entity set are ID, name, dept name, and salary.
Explanation:Э is used to denote “some” values
in relational calculus. 4. The function that an entity plays in a
advertisement relationship is called that entity’s
_____________
10. A set of possible data values is called a) Participation
a) Attribute b) Position
c) Role

39
d) Instance d) All of the mentioned
View Answer View Answer

Answer: c Answer: a
Explanation: A relationship is an association Explanation: Name and Date_of_birth cannot
among several entities. hold more than 1 value.

5. The attribute name could be structured as an 9. Which of the following is a single valued
attribute consisting of first name, middle initial, attribute
and last name. This type of attribute is called a) Register_number
a) Simple attribute b) Address
b) Composite attribute c) SUBJECT_TAKEN
c) Multivalued attribute d) Reference
d) Derived attribute View Answer
View Answer
Answer: a
Answer: b Explanation: None.
Explanation: Composite attributes can be
divided into subparts (that is, other attributes). 10. In a relation between the entities the type
and condition of the relation should be specified.
6. The attribute AGE is calculated from That is called as______attribute.
DATE_OF_BIRTH. The attribute AGE is a) Desciptive
a) Single valued b) Derived
b) Multi valued c) Recursive
c) Composite d) Relative
d) Derived View Answer
View Answer
Answer: a
Answer: d Explanation: Consider the entity sets student and
Explanation: The value for this type of attribute section, which participate in a relationship set
can be derived from the values of other related takes. We may wish to store a descriptive
attributes or entities. attribute grade with the relationship to record the
grade that a student got in the class.
7. Not applicable condition can be represented in
relation entry as 1. _____________ express the number of
a) NA entities to which another entity can be associated
b) 0 via a relationship set.
c) NULL a) Mapping Cardinality
d) Blank Space b) Relational Cardinality
View Answer c) Participation Constraints
d) None of the mentioned
Answer: c View Answer
Explanation: NULL always represents that the
value is not present. Answer: a
Explanation: Mapping cardinality is also called
8. Which of the following can be a multivalued as cardinality ratio.
attribute?
a) Phone_number 2. An entity in A is associated with at most one
b) Name entity in B, and an entity in B is associated with
c) Date_of_birth at most one entity in A.This is called as

40
a) One-to-many Answer: b
b) One-to-one Explanation: Only particular value satisfying the
c) Many-to-many constraints are entered in the column.
d) Many-to-one
View Answer 6. Which of the following can be addressed by
enforcing a referential integrity constraint?
Answer: b a) All phone numbers must include the area code
Explanation: Here one entity in one set is related b) Certain fields are required (such as the email
to one one entity in other set. address, or phone number) before the record is
accepted
3. An entity in A is associated with at most one c) Information on the customer must be known
entity in B. An entity in B, however, can be before anything can be sold to that customer
associated with any number (zero or more) of d) Then entering an order quantity, the user must
entities in A. input a number and not some text (i.e., 12 rather
a) One-to-many than ‘a dozen’)
b) One-to-one View Answer
c) Many-to-many
d) Many-to-one Answer: c
View Answer Explanation: None.

Answer: d 7. ______ is a special type of integrity constraint


Explanation: Here more than one entity in one that relates two relations & maintains
set is related to one one entity in other set. consistency across the relations.
a) Entity Integrity Constraints
4. Data integrity constraints are used to: b) Referential Integrity Constraints
a) Control who is allowed access to the data c) Domain Integrity Constraints
b) Ensure that duplicate records are not entered d) Domain Constraints
into the table View Answer
c) Improve the quality of data entered for a
specific property Answer: b
d) Prevent users from changing the values stored Explanation: None.
in the table advertisement
View Answer
8. Which one of the following uniquely
Answer: c identifies the elements in the relation?
Explanation: The data entered will be in a a) Secondary Key
particular cell (i.e., table column). b) Primary key
c) Foreign key
5. Establishing limits on allowable property d) Composite key
values, and specifying a set of acceptable, View Answer
predefined options that can be assigned to a
property are examples of: Answer: b
a) Attributes Explanation: Primary key checks for not null
b) Data integrity constraints and uniqueness constraint.
c) Method constraints
d) Referential integrity constraints 9. Drop Table cannot be used to drop a table
View Answer referenced by a _________ constraint.
a) Local Key
b) Primary Key
c) Composite Key

41
d) Foreign Key d) Primary key
View Answer View Answer

Answer: d Answer: a
Explanation: Foreign key is used when primary Explanation: The first part of the rectangle,
key of one relation is used in another relation. contains the name of the entity set. The second
part contains the names of all the attributes of
10. ____________ is preferred method for the entity set.
enforcing data integrity
a) Constraints 4. Consider a directed line(->) from the
b) Stored Procedure relationship set advisor to both entity sets
c) Triggers instructor and student. This indicates _________
d) Cursors cardinality
View Answer a) One to many
b) One to one
Answer: a c) Many to many
Explanation: Constraints are specified to restrict d) Many to one
entries in the relation. View Answer

1. Which of the following gives a logical Answer: b


structure of the database graphically? Explanation: This indicates that an instructor
a) Entity-relationship diagram may advise at most one student, and a student
b) Entity diagram may have at most one advisor.
c) Database diagram
d) Architectural representation 5. We indicate roles in E-R diagrams by labeling
View Answer the lines that connect ___________ to
__________
Answer: a a) Diamond , diamond
Explanation: E-R diagrams are simple and b) Rectangle, diamond
clear—qualities that may well account in large c) Rectangle, rectangle
part for the widespread use of the E-R model. d) Diamond, rectangle
View Answer
2. The entity relationship set is represented in E-
R diagram as Answer: d
a) Double diamonds Explanation: Diamond represents a relationship
b) Undivided rectangles set and rectangle represents a entity set.
c) Dashed lines
d) Diamond 6. An entity set that does not have sufficient
View Answer attributes to form a primary key is termed a
__________
Answer: d a) Strong entity set
Explanation: Dashed lines link attributes of a b) Variant set
relationship set to the relationship set. c) Weak entity set
d) Variable set
3. The Rectangles divided into two parts View Answer
represents
a) Entity set Answer: c
b) Relationship set Explanation: An entity set that has a primary key
c) Attributes of a relationship set is termed a strong entity set.

42
7. For a weak entity set to be meaningful, it must Answer: b
be associated with another entity set, called the Explanation: The environment of database is
a) Identifying set said to be an instance. A database instance or an
b) Owner set ‘instance’ is made up of the background
c) Neighbour set processes needed by the database.
d) Strong entity set
View Answer 1. Which one of the following can be treated as a
primary key in teaches relation?
Answer: a a) Id
Explanation: Every weak entity must be b) Semester
associated with an identifying entity; that is, the c) Sec_id
weak entity set is said to be existence dependent d) Year
on the identifying entity set. The identifying View Answer
entity set is said to own the weak entity set that
it identifies. It is also called as owner entity set. Answer: a
advertisement Explanation: Here Id is the only attribute that
has to have a unique entry.
8. Weak entity set is represented as
a) Underline 2. The primary key in the section relation is
b) Double line a) Course_id
c) Double diamond b) Sec_id
d) Double rectangle c) Both Course_id and Sec_id
View Answer d) All the attributes
View Answer
Answer: c
Explanation: An entity set that has a primary key Answer: c
is termed a strong entity set. Explanation: Both the entries has unique entry.

9. If you were collecting and storing information 3.


about your music collection, an album would be
considered a(n) _____ SELECT * FROM teaches WHERE Sec_id =
a) Relation 'CS-101';
b) Entity
c) Instance Which of the following Id is selected for the
d) Attribute following query?
View Answer a) 1003
b) 1001
Answer: b c) None
Explanation: An entity set is a logical container d) Error message appears
for instances of an entity type and instances of View Answer
any type derived from that entity type.
Answer: d
10. What term is used to refer to a specific Explanation: The value CS-101 matches the
record in your music database; for instance; Course_id but not Id.
information stored about a specific album?
a) Relation 4.
b) Instance
c) Table SELECT Id, Course_id, Building FROM
d) Column SECTION s AND teaches t WHERE
View Answer t.year=2009;

43
Which of the following Id are displayed? Answer: d
a) 1003 Explanation: It should be replaced by Year
b) 1001 Building varchar (15).
c) Both 1003 and 1001
d) Error message appears 7. The relation with primary key can be created
View Answer using
a) Create table instructor (Id, Name)
Answer: c b) Create table instructor (Id, Name, primary
Explanation: Two rows are select in the above key(name))
query. c) Create table instructor (Id, Name, primary key
(Id))
5. The query which selects the Course_id ‘CS- d) Create table instructor ( Id unique, Name )
101’ from the section relation is View Answer
a) Select Course_id from section where Building
= ‘Richard’; Answer: c
b) Select Course_id from section where Year = Explanation: The value Name cannot be a
‘2009’; primary key.
c) Select Course_id from teaches where
Building = ‘Packyard’; 8. How can the values in the relation teaches be
d) Select Course_id from section where Sec_id deleted?
= ‘3’; a) Drop table teaches;
View Answer b) Delete from teaches;
c) Purge table teaches;
Answer: b d) Delete from teaches where Id =’Null’;
Explanation: The year ‘2009’ should be selected View Answer
from the section relation.
Answer: b
6. Explanation: Delete table cleans the entry from
the table.
advertisement
9. In the above teaches relation ” Select * from
CREATE TABLE SECTION teaches where Year = ‘2010’” displays how
(Course_id VARCHAR (8), many rows?
Sec_id VARCHAR (8), a) 2
Semester VARCHAR (6), b) 4
YEAR NUMERIC (4,0), c) 5
Building NUMERIC (15), d) 1
PRIMARY KEY (course id, sec id, semester, View Answer
YEAR),
FOREIGN KEY (course id) REFERENCES Answer: a
course); Explanation: There are two tuples with the year
is 2009.
Which of the following has an error in the above
create table for the relation section 10. The relation changes can be got back using
a) Primary key (course id, sec id, semester, year) ________ command
b) Foreign key (course id) references course a) Flashback
c) Year numeric (4,0) b) Purge
d) Building numeric (15) c) Delete
View Answer d) Getback
View Answer

44
Answer: a involved in a relationship?
Explanation: Purge deletes the table and delete a) Minimum cardinality
cleans the table entry. b) Maximum cardinality
c) ERD
1. Let us consider phone_number ,which can d) Greater Entity Count
take single or several values . Treating View Answer
phone_numberas an _________ permits
instructors to have several phone numbers Answer: b
(including zero) associated with them. Explanation: In SQL (Structured Query
a) Entity Language), the term cardinality refers to the
b) Attribute uniqueness of data values contained in a
c) Relation particular column (attribute) of a database table.
d) Value
View Answer 5. In E-R diagram generalization is represented
by
Answer: a a) Ellipse
Explanation: Treating a phone as an attribute b) Dashed ellipse
phone_number implies that instructors have c) Rectangle
precisely one phone number each. d) Triangle
View Answer
2. The total participation by entities is
represented in E-R diagram as Answer: d
a) Dashed line Explanation: Ellipse represents attributes,
b) Double line rectangle represents entity.
c) Double rectangle
d) Circle 6. What is a relationship called when it is
View Answer maintained between two entities?
a) Unary
Answer: b b) Binary
Explanation: It is used to represent the relation c) Ternary
between several attributes. d) Quaternary
View Answer
3. Given the basic ER and relational models,
which of the following is INCORRECT? Answer: b
a) An attribute of an entity can have more than Explanation: Binary word usually represents two
one value attributes.
b) An attribute of an entity can be composite
c) In a row of a relational table, an attribute can 7. Which of the following is a low level
have more than one value operator?
d) In a row of a relational table, an attribute can a) Insert
have exactly one value or a NULL value b) Update
View Answer c) Delete
d) Directory
Answer: c View Answer
Explanation: It is possible to have several values
for a single attribute provide it is a multi-valued Answer: d
attribute. Explanation: Directory is a low level to word on
in file system.
4. Which of the following indicates the advertisement
maximum number of entities that can be

45
8. Key to represent relationship between tables Answer: b
is called Explanation: The process of designating
a) Primary key subgroupings within an entity set is called
b) Secondary Key specialization.
c) Foreign Key
d) None of the mentioned 2. Which relationship is used to represent a
View Answer specialization entity?
a) ISA
Answer: c b) AIS
Explanation: Primary key of one relation used as c) ONIS
an attribute in another relation is called foreign d) WHOIS
key. View Answer

9. A window into a portion of a database is Answer: a


a) Schema Explanation: In terms of an E-R diagram,
b) View specialization is depicted by a hollow arrow-
c) Query head pointing from the specialized entity to the
d) Data dictionary other entity.
View Answer
3. The refinement from an initial entity set into
Answer: b successive levels of entity subgroupings
Explanation: View is a logical portion of a represents a ________ design process in which
database which is needed by some users. distinctions are made explicit.
a) Hierarchy
10. A primary key is combined with a foreign b) Bottom-up
key creates c) Top-down
a) Parent-Child relation ship between the tables d) Radical
that connect them View Answer
b) Many to many relationship between the tables
that connect them Answer: c
c) Network model between the tables that Explanation: The design process may also
connect them proceed in a bottom-up manner, in which
d) None of the mentioned multiple entity sets are synthesized into a higher-
View Answer level entity set on the basis of common features.

Answer: a 4. There are similarities between the instructor


Explanation: Using the two relationships mother entity set and the secretary entity set in the sense
and father provides us a record of a child’s that they have several attributes that are
mother, even if we are not aware of the father’s conceptually the same across the two entity sets:
identity; a null value would be required if the namely, the identifier, name, and salary
ternary relationship parent is used. Using binary attributes. This process is called
relationship sets is preferable in this case. a) Commonality
b) Specialization
1. The entity set person is classified as student c) Generalization
and employee. This process is called _________ d) Similarity
a) Generalization View Answer
b) Specialization
c) Inheritance Answer: c
d) Constraint generalization Explanation: Generalization is used to
View Answer

46
emphasize the similarities among lower-level advertisement
entity sets and to hide the differences.
8. The completeness constraint may be one of
5. If an entity set is a lower-level entity set in the following: Total generalization or
more than one ISA relationship, then the entity specialization, Partial generalization or
set has specialization. Which is the default?
a) Hierarchy a) Total
b) Multilevel inheritance b) Partial
c) Single inheritance c) Should be specified
d) Multiple inheritance d) Cannot be determined
View Answer View Answer

Answer: d Answer: b
Explanation: The attributes of the higher-level Explanation: Partial generalization or
entity sets are said to be inherited by the lower- specialization – Some higher-level entities may
level entity sets. not belong to any lower-level entity set.

6. A _____________ constraint requires that an 9. Functional dependencies are a generalization


entity belong to no more than one lower-level of
entity set. a) Key dependencies
a) Disjointness b) Relation dependencies
b) Uniqueness c) Database dependencies
c) Special d) None of the mentioned
d) Relational View Answer
View Answer
Answer: a
Answer: a Explanation: The subclasses are combined to
Explanation: For example, student entity can form the superclass.
satisfy only one condition for the student type
attribute; an entity can be either a graduate 10. Which of the following is another name for a
student or an undergraduate student, but cannot weak entity?
be both. a) Child
b) Owner
7. Consider the employee work-team example, c) Dominant
and assume that certain employees participate in d) All of the mentioned
more than one work team. A given employee View Answer
may therefore appear in more than one of the
team entity sets that are lower level entity sets of Answer: a
employee. Thus, the generalization is Explanation: A parent may be called as a strong
_____________ entity.
a) Overlapping
b) Disjointness 1. In the __________ normal form, a composite
c) Uniqueness attribute is converted to individual attributes.
d) Relational a) First
View Answer b) Second
c) Third
Answer: a d) Fourth
Explanation: In overlapping generalizations, the View Answer
same entity may belong to more than one lower-
level entity set within a single generalization.

47
Answer: a b) Key revisited
Explanation: The first normal form is used to c) Superset key
eliminate the duplicate information. d) None of the mentioned
View Answer
2. A table on the many side of a one to many or
many to many relationship must: Answer: a
a) Be in Second Normal Form (2NF) Explanation: Key is the basic element needed for
b) Be in Third Normal Form (3NF) the constraints.
c) Have a single attribute key
d) Have a composite key 6. Which is a bottom-up approach to database
View Answer design that design by examining the relationship
between attributes:
Answer: d a) Functional dependency
Explanation: The relation in second normal form b) Database modeling
is also in first normal form and no partial c) Normalization
dependencies on any column in primary key. d) Decomposition
View Answer
3. Tables in second normal form (2NF):
a) Eliminate all hidden dependencies Answer: c
b) Eliminate the possibility of a insertion Explanation: Normalisation is the process of
anomalies removing redundancy and unwanted data.
c) Have a composite key
d) Have all non key fields depend on the whole 7. Which forms simplifies and ensures that there
primary key are minimal data aggregates and repetitive
View Answer groups:
a) 1NF
Answer: a b) 2NF
Explanation: The relation in second normal form c) 3NF
is also in first normal form and no partial d) All of the mentioned
dependencies on any column in primary key. View Answer

4. Which-one ofthe following statements about Answer: c


normal forms is FALSE? Explanation: The first normal form is used to
a) BCNF is stricter than 3 NF eliminate the duplicate information.
b) Lossless, dependency -preserving
decomposition into 3 NF is always possible 8. Which forms has a relation that possesses data
c) Loss less, dependency – preserving about an individual entity:
decomposition into BCNF is always possible a) 2NF
d) Any relation with two attributes is BCNF b) 3NF
View Answer c) 4NF
d) 5NF
Answer: c View Answer
Explanation: We say that the decomposition is a
lossless decomposition if there is no loss of Answer: c
information by replacing r (R) with two relation Explanation: A Table is in 4NF if and only if,
schemas r1(R1) andr2(R2). for every one of its non-trivial multivalued
dependencies X \twoheadrightarrow Y, X is a
5. Functional Dependencies are the types of superkey—that is, X is either a candidate key or
constraints that are based on______ a superset thereof.
a) Key

48
9. Which forms are based on the concept of other composite key then the relation is not in
functional dependency: BCNF, hence it has to be decomposed.).
a) 1NF
b) 2NF 2. What are the desirable properties of a
c) 3NF decomposition
d) 4NF a) Partition constraint
View Answer b) Dependency preservation
c) Redundancy
Answer: c d) Security
Explanation: The table is in 3NF if every non- View Answer
prime attribute of R is non-transitively
dependent (i.e. directly dependent) on every Answer: b
superkey of R. Explanation: Lossless join and dependency
preserving are the two goals of the
10. decomposition.

Empdt1(empcode, name, street, city, state, 3. R (A,B,C,D) is a relation. Which of the


pincode). following does not have a lossless join
advertisement dependency preserving BCNF decomposition?
a) A->B, B->CD
For any pincode, there is only one city and state. b) A->B, B->C, C->D
Also, for given street, city and state, there is just c) AB->C, C->AD
one pincode. In normalization terms, empdt1 is a d) A->BCD
relation in View Answer
a) 1 NF only
b) 2 NF and hence also in 1 NF Answer: d
c) 3NF and hence also in 2NF and 1NF Explanation: This relation gives a relation
d) BCNF and hence also in 3NF, 2NF and 1NF without any loss in the values.
View Answer
4.
Answer: b
Explanation: The relation in second normal form Class (course id, title, dept name, credits, sec id,
is also in first normal form and no partial semester, YEAR, building, room NUMBER,
dependencies on any column in primary key. capacity, TIME slot id)
The SET OF functional dependencies that we
1. A relation is in ____________ if an attribute require TO hold ON class are:
of a composite key is dependent on an attribute course id->title, dept name, credits
of other composite key. building, room number->capacity
a) 2NF course id, sec id, semester, year->building, room
b) 3NF NUMBER, TIME slot id
c) BCNF A candidate KEY FOR this schema IS {course
d) 1NF id, sec id, semester, YEAR}
View Answer
Consider the above conditions. Which of the
Answer: b following relation holds?
Explanation: A relation is in 3 NF if an attribute a) Course id-> title, dept name, credits
of a composite key is dependent on an attribute b) Title-> dept name, credits
of other composite key. (If an attribute of a c) Dept name-> credits
composite key is dependent on an attribute of d) Cannot be determined
View Answer

49
Answer: a 8. Relation R with an associated set of functional
Explanation: Here course id is not a superkey. dependencies, F, is decomposed into BCNF. The
Thus, class is not in BCNF. redundancy (arising out of functional
dependencies) in the resulting set of relations is
5. The algorithm that takes a set of dependencies a) Zero
and adds one schema at a time, instead of b) More than zero but less than that of an
decomposing the initial schema repeatedly is equivalent 3NF decomposition
a) BCNF algorithm c) Proportional to the size of F+
b) 2NF algorithm d) Indeterminate
c) 3NF synthesis algorithm View Answer
d) 1NF algorithm
View Answer Answer: b
Explanation: Redundancy in BCNF is low when
Answer: c compared to 3NF. For more details on BCNF.
Explanation: The result is not uniquely defined,
since a set of functional dependencies can have 9. A table has fields F1, F2, F3, F4, and F5, with
more than one canonical cover, and, further, in the following functional dependencies:
some cases, the result of the algorithm depends
on the order in which it considers the F1->F3
dependencies in Fc. F2->F4
(F1,F2)->F5
6. The functional dependency can be tested
easily on the materialized view, using the in terms of normalization, this table is in
constraints ____________. a) 1NF
a) Primary key b) 2NF
b) Null c) 3NF
c) Unique d) None of the mentioned
d) Both Null and Unique View Answer
View Answer
Answer: a
Answer: d Explanation: Since the primary key is not given
Explanation: Primary key contains both unique we have to derive the primary key of the table.
and not null constraints. Using the closure set of attributes we get the
primary key as (F1, F2). From functional
7. Which normal form is considered adequate dependencies, “F1->F3, F2->F4”, we can see
for normal relational database design? that there is partial functional dependency
a) 2NF therefore it is not in 1NF. Hence the table is in
b) 5NF 1NF.
c) 4NF advertisement
d) 3NF
View Answer 10. Let R(A,B,C,D,E,P,G) be a relational
schema in which the following FDs are known
Answer: d to hold:
Explanation: A relational database table is often
described as “normalized” if it is in the Third AB->CD
Normal Form because most of the 3NF tables DE->P
are free of insertion, update, and deletion C->E
anomalies. P->C
B->G

50
The relation schema R is rule out the existence of certain tuples. Instead,
a) in BCNF they require that other tuples of a certain form be
b) in 3NF, but not in BCNF present in the relation.
c) in 2NF, but not in 3NF
d) not in 2NF 4. Which of the normal form is based on
View Answer multivalued dependencies?
a) First
Answer: d b) Second
Explanation: From the closure set of attributes c) Third
we can see that the key for the relation is AB. d) Fourth
The FD B->G is a partial dependency, hence it is View Answer
not in 2NF.
Answer: d
1. The normal form which satisfies multivalued Explanation: Multivalued dependencies, do not
dependencies and which is in BCNF is rule out the existence of certain tuples. Instead,
a) 4 NF they require that other tuples of a certain form be
b) 3 NF present in the relation.
c) 2 NF
d) All of the mentioned 5. Which forms has a relation that possesses data
View Answer about an individual entity?
a) 2NF
Answer: a b) 3NF
Explanation: Fourth normal form is more c) 4NF
restrictive than BCNF. d) 5NF
View Answer
2. Which of the following is a tuple-generating
dependencies? Answer: c
a) Functional dependency Explanation: A Table is in 4NF if and only if,
b) Equality-generating dependencies for every one of its non-trivial multivalued
c) Multivalued dependencies dependencies X \twoheadrightarrow Y, X is a
d) Non-functional dependency superkey—that is, X is either a candidate key or
View Answer a superset thereof.

Answer: c 6. If a multivalued dependency holds and is not


Explanation: Multivalued dependencies, do not implied by the corresponding functional
rule out the existence of certain tuples. Instead, dependency, it usually arises from one of the
they require that other tuples of a certain form be following sources.
present in the relation. a) A many-to-many relationship set
b) A multivalued attribute of an entity set
3. The main task carried out in the __________ c) A one-to-many relationship set
is to remove repeating attributes to separate d) Both A many-to-many relationship set and A
tables. multivalued attribute of an entity set
a) First Normal Form View Answer
b) Second Normal Form
c) Third Normal Form Answer: d
d) Fourth Normal Form Explanation: For a many-to-many relationship
View Answer set each related entity set has its own schema
and there is an additional schema for the
Answer: a relationship set. For a multivalued attribute, a
Explanation: Multivalued dependencies, do not

51
separate schema is created consisting of that c) No partial FDs exist
attribute and the primary key of the entity set. d) No partial MVDs exist
View Answer
7. Which of the following has each related entity
set has its own schema and there is an additional Answer: c
schema for the relationship set? Explanation: If a multivalued dependency holds
a) A many-to-many relationship set and is not implied by the corresponding
b) A multivalued attribute of an entity set functional dependency, it usually arises from
c) A one-to-many relationship set this source.
d) None of the mentioned
View Answer 1. _____________ can help us detect poor E-R
design.
Answer: a a) Database Design Process
Explanation: If a multivalued dependency holds b) E-R Design Process
and is not implied by the corresponding c) Relational scheme
functional dependency, it usually arises from d) Functional dependencies
this source. View Answer
advertisement
Answer: d
8. In which of the following, a separate schema Explanation: For eg.,Suppose an instructor entity
is created consisting of that attribute and the set had attributes dept name and dept address,
primary key of the entity set. and there is a functional dependency dept name -
a) A many-to-many relationship set > dept address.
b) A multivalued attribute of an entity set
c) A one-to-many relationship set 2. If a multivalued dependency holds and is not
d) None of the mentioned implied by the corresponding functional
View Answer dependency, it usually arises from one of the
following sources.
Answer: b a) A many-to-many relationship set
Explanation: If a multivalued dependency holds b) A multivalued attribute of an entity set
and is not implied by the corresponding c) A one-to-many relationship set
functional dependency, it usually arises from d) Both A many-to-many relationship set and A
this source. multivalued attribute of an entity set
View Answer
9. Fifth Normal form is concerned with
a) Functional dependency Answer: d
b) Multivalued dependency Explanation: For a many-to-many relationship
c) Join dependency set each related entity set has its own schema
d) Domain-key and there is an additional schema for the
View Answer relationship set. For a multivalued attribute, a
separate schema is created consisting of that
Answer: c attribute and the primary key of the entity set.
Explanation: If a multivalued dependency holds
and is not implied by the corresponding 3. Which of the following has each related entity
functional dependency, it usually arises from set has its own schema and there is an additional
this source. schema for the relationship set.
a) A many-to-many relationship set
10. In 2NF b) A multivalued attribute of an entity set
a) No functional dependencies (FDs) exist c) A one-to-many relationship set
b) No multivalued dependencies (MVDs) exist

52
d) All of the mentioned 7. Designers use which of the following to tune
View Answer the performance of systems to support time-
critical operations?
Answer: a a) Denormalization
Explanation: If a multivalued dependency holds b) Redundant optimization
and is not implied by the corresponding c) Optimization
functional dependency, it usually arises from d) Realization
this source. View Answer

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


is created consisting of that attribute and the Explanation: The process of taking a normalized
primary key of the entity set. schema and making it nonnormalized is called
a) A many-to-many relationship set denormalization.
b) A multivalued attribute of an entity set
c) A one-to-many relationship set 8. In the schema (dept name, size) we have
d) All of the mentioned relations total inst 2007, total inst 2008. Which
View Answer dependency have lead to this relation ?
a) Dept name, year->size
Answer: b b) Year->size
Explanation: If a multivalued dependency holds c) Dept name->size
and is not implied by the corresponding d) Size->year
functional dependency, it usually arises from View Answer
this source.
Answer: a
5. Suppose the user finds the usage of room Explanation: The process of taking a normalized
number and phone number in a relational schema and making it nonnormalized is called
schema there is confusion.This is reduced by denormalization.
a) Unique-role assumption
b) Unique-key assignment 9. Relation dept year(dept name, total inst 2007,
c) Role intergral assignment total inst 2008, total inst 2009). Here the only
d) None of the mentioned functional dependencies are from dept name to
View Answer the other attributes. This relation is in
a) Fourth NF
Answer: a b) BCNF
Explanation: A desirable feature of a database c) Third NF
design is the unique-role assumption, which d) Second NF
means that each attribute name has a unique View Answer
meaning in the database.
Answer: b
6. What is the best way to represent the Explanation: BCNF has only one normal form.
attributes in a large database?
a) Relational-and 10. Thus a _______ of course data gives the
b) Concatenation values of all attributes, such as title and
c) Dot representation department, of all courses at a particular point in
d) All of the mentioned time.
View Answer a) Instance
b) Snapshot
Answer: b c) Both Instance and Snapshot
Explanation: Example inst sec and student sec. d) All of the mentioned
View Answer

53
Answer: b 3. Information architecture influences:
Explanation: We use the term snapshot of data a) Answer choice
to mean the value of the data at a particular point b) Site structure
in time. c) Labeling
advertisement d) Navigation design
View Answer
11. Representations such as the in the dept year
relation, with one column for each value of an Answer: b
attribute, are called _______ they are widely Explanation: The actions in GUI are usually
used in spreadsheets and reports and in data performed through direct manipulation of the
analysis tools. graphical elements.
a) Cross-tabs
b) Snapshot 4. Also known as schematics, a way of
c) Both Cross-tabs and Snapshot illustrating the layout of an individual webpage
d) All of the mentioned is a:
View Answer a) Wireframe
b) Sitemap
Answer: a c) Card sorting
Explanation: SQL includes features to convert d) Blueprint
data from a normal relational representation to a View Answer
crosstab.
Answer: a
1. An approach to website design with the Explanation: An application programming
emphasis on converting visitors to outcomes interface specifies how some software
required by the owner is referred to as: components should interact with each other.
a) Web usability
b) Persuasion 5. A graphical or text depiction of the
c) Web accessibility relationship between different groups of content
d) None of the mentioned on a website is referred to as a:
View Answer a) Wireframe
b) Blueprint
Answer: b c) Sitemap
Explanation: In computing, graphical user d) Card sorting
interface is a type of user interface that allows View Answer
users to interact with electronic devices.
Answer: c
2. A method of modelling and describing user Explanation: An application programming
tasks for an interactive application is referred to interface specifies how some software
as: components should interact with each other.
a) Customer journey
b) Primary persona 6. Blueprints are intended to:
c) Use case a) Prototype of the screen layout showing
d) Web design persona navigation and main design elements
View Answer b) Show the grouping of pages and user journeys
c) Indicate the structure of a site during site
Answer: c design and as a user feature
Explanation: The actions in GUI are usually d) Prototype typical customer journeys or
performed through direct manipulation of the clickstreams through a website
graphical elements. View Answer

54
Answer: c interface is a type of user interface that allows
Explanation: A blueprint is a reproduction of a users to interact with electronic devices.
technical drawing, documenting an architecture
or an engineering design, using a contact print 10. Which of the following is a description of
process. information organization schemes?
a) Minimising the number of clicks needed to
7. Storyboards are intended to: access relevant content
a) Indicate the structure of a site during site b) Providing an overall design to a site
design and as a user feature consistent with the positioning of the products
b) Prototype of the screen layout showing and services
navigation and main design elements c) The menu options chosen to group and
c) Integrate consistently available components categorize information
on the webpage (e.g. navigation, search boxes) d) Providing specific content and services
d) Prototype typical customer journeys or click appropriate to different audience members
streams through a website View Answer
View Answer
Answer: c
Answer: d Explanation: In computing, graphical user
Explanation: An application programming interface is a type of user interface that allows
interface specifies how some software users to interact with electronic devices.
components should interact with each other.
advertisement 1. Which of the following is a valid uniform
resource locator?
8. Which of the following occupies boot record a) http://www.acm.org/sigmod
of hard and floppy disks and activated during b) www.google.com
computer startup? c) www.ann.in
a) Worm d) http:/www.acm.org/sigmod/
b) Boot sector virus View Answer
c) Macro virus
d) Virus Answer: a
View Answer Explanation: A uniform resource locator (URL)
is a globally unique name for each document
Answer: b that can be accessed on the Web.
Explanation: A blueprint is a reproduction of a
technical drawing, documenting an architecture 2. http://www.google.com/search?q=silberschatz
or an engineering design, using a contact print In the above URL which one is the argument
process. which is used for processing of the URL?
a) google
9. A graphical or text depiction of the b) google.com
relationship between different groups of content c) search
on a website is a: d) q=silberschatz
a) Page template View Answer
b) Wireframe
c) Site map Answer: d
d) Cascading style sheet (CSS) Explanation: Argument is always placed after ?
View Answer symbol.

Answer: c 3. HTTP defines two ways in which values


Explanation: In computing, graphical user entered by a user at the browser can be sent to
the Web server. The _____ method encodes the

55
values as part of the URL. b) History
a) Post c) Remainder
b) Get d) None of the mentioned
c) Read View Answer
d) Argument
View Answer Answer: a
Explanation: A cookie is simply a small piece of
Answer: b text containing identifying information and with
Explanation: For example, if the Google search an associated name.
page used a form with an input parameter
named q with the get method, and the user typed 7. Which of the following is not true about
in the string “silberschatz” and submitted the HTML ?
form, the browser would request the following a) <meta>…</meta>
URL from the Web server: b) <meta…./>
http://www.google.com/search?q=silberschatz. c) <metadata>…</metadata>
d) <metadata name=”” />
4. A __________ is a program running on the View Answer
server machine, which accepts requests from a
Web browser and sends back results in the form Answer: b
of HTML documents. Explanation: Meta data is the data about data
a) HTML which is included in the meta data tag.
b) HTTP advertisement
c) Web Server
d) Web browser 8. Html code contains:
View Answer a) Tags
b) Attributes
Answer: c c) Elements
Explanation: The browser and Web server d) All of the mentioned
communicate via HTTP. Web servers provide View Answer
powerful features, beyond the simple transfer of
documents. Answer: d
Explanation: <> are tags,size is a attribute.
5. The application program typically
communicates with a database server, through 9. Html document must always be saved with:
___________ or other protocols, in order to get a) .html
or store data. b) .htm
a) JDBC c) .doc
b) ODBC d) Both .html & .htm
c) All of the mentioned View Answer
d) None of the mentioned
View Answer Answer: d
Explanation: .doc is used only for the word
Answer: c document format.
Explanation: The common gateway interface
(CGI) standard defines how the Web server 10. How many levels of headings are in html:
communicates with application programs. a) 2
b) 7
6. This extra information is usually maintained c) 6
in the form of a _________ at the client. d) 4
a) Cookie View Answer

56
Answer: c d) Type 4 only
Explanation: The heading levels are View Answer
h1,h2,h3,h4,h5,h6.
Answer: c
1. The Java __________ specification defines an Explanation: In a Type 3 driver, a three-tier
application programming interface for approach is used to accessing databases. The
communication between the Web server and the JDBC clients use standard network sockets to
application program. communicate with an middleware application
a) Servlet server. In a Type 4 driver, a pure Java-based
b) Server driver that communicates directly with vendor’s
c) Program database through socket connection.
d) Randomize
View Answer 5. What MySQL property is used to create a
surrogate key in MySQL?
Answer: a a) UNIQUE
Explanation: Servlets are commonly used to b) SEQUENCE
generate dynamic responses to HTTP requests. c) AUTO_INCREMENT
d) None of the mentioned
2. The doGet() method in the example extracts View Answer
values of the parameter’s type and number by
using __________ Answer: c
a) request.getParameter() Explanation: A surrogate key in a database is a
b) request.setParameter() unique identifier for either an entity in the
c) responce.getParameter() modeled world or an object in the database.
d) responce.getAttribute()
View Answer 6. A JSP is transformed into a(n):
a) Java applet
Answer: a b) Java servlet
Explanation: These methods uses these values to c) Either 1 or 2 above
run a query against a database. d) Neither 1 nor 2 above
View Answer
3. How many JDBC driver types does Sun
define? Answer: b
a) One Explanation: Servlets are commonly used to
b) Two generate dynamic responses to HTTP requests.
c) Three
d) Four 7. Which JDBC driver Type(s) is(are) the
View Answer JDBC-ODBC bridge?
a) Type 1
Answer: d b) Type 2
Explanation: c) Type 3
JBDB.DriverManager.getConnection() is used to d) Type 4
get the connection to the database. View Answer

4. Which JDBC driver Type(s) can be used in Answer: a


either applet or servlet code? Explanation: In a Type 1 driver, a JDBC bridge
a) Both Type 1 and Type 2 is used to access ODBC drivers installed on each
b) Both Type 1 and Type 3 client machine.
c) Both Type 3 and Type 4 advertisement

57
8. What programming language(s) or scripting Answer: a
language(s) does Java Server Pages (JSP) Explanation: Presentation is abstracted from
support? dialogue and application.
a) VBScript only
b) Jscript only 2. Which of the unit operation is used in Model
c) Java only view controller?
d) All of the mentioned a) Is a Decomposition
View Answer b) Part Whole Decomposition
c) All of the mentioned
Answer: c d) None of the mentioned
Explanation: JSP primarily uses Java for certain View Answer
codes.
Answer: b
9. What is bytecode? Explanation: Part whole decomposition is
a) Machine-specific code applied to MVC.
b) Java code
c) Machine-independent code 3. Memory address refers to the successive
d) None of the mentioned memory words and the machine is called as
View Answer _______________
a) word addressable
Answer: c b) byte addressable
Explanation: Java bytecode is the form of c) bit addressable
instructions that the Java virtual machine d) Terra byte addressable
executes. Each bytecode opcode is one byte in View Answer
length, although some require parameters,
resulting in some multi-byte instructions. Answer: a
Explanation: Part whole decomposition is
10. Where is metadata stored in MySQL? applied to MVC.
a) In the MySQL database metadata
b) In the MySQL database metasql 4. Which layer deals which deals with user
c) In the MySQL database mysql interaction is called _____________ layer.
d) None of the mentioned a) Business logic
View Answer b) Presentation
c) User interaction
Answer: c d) Data access
Explanation: Metadata contains data about other View Answer
data which is given in the <meta>…</meta>
tags. Answer: b
Explanation: The single application may have
1. Which of the following is true for Seeheim several different versions of this layer,
model? corresponding to distinct kinds of interfaces
a) Presentation is abstracted from dialogue and such as Web browsers, and user interfaces of
Application mobile phones, which have much smaller
b) Presentation and Dialogue is abstracted from screens.
Application
c) Presentation and Application is abstracted 5. The _____________ layer, which provides a
from Dialogue high-level view of data and actions on data.
d) None of the mentioned a) Business logic
View Answer b) Presentation
c) User interaction

58
d) Data access Answer: a
View Answer Explanation: Presentation and Application are
the functions that any system with a user
Answer: a interface must provide.
Explanation: The single application may have
several different versions of this layer, 9. Which of the following is the main task
corresponding to distinct kinds of interfaces accomplished by the user?
such as Web browsers, and user interfaces of a) Compose a document
mobile phones, which have much smaller b) Create a spread sheet
screens. c) Send mail
d) All of the mentioned
6. The ______________ layer, which provides View Answer
the interface between the business-logic layer
and the underlying database. Answer: d
a) Business logic Explanation: All of the mentioned are the main
b) Presentation task accomplished by the user.
c) User interaction
d) Data access 10. What are the portability concerns founded in
View Answer Seeheim model?
a) Replacing the presentation toolkit
Answer: d b) Replacing the application toolkit
Explanation: Many applications use an object- c) Replacing the dialogue toolkit
oriented language to code the business-logic d) Replacing the presentation & application
layer, and use an object-oriented model of data, toolkit
while the underlying database is a relational View Answer
database.
Answer: d
7. The _____________ system is widely used Explanation: The portability concerns founded
for mapping from Java objects to relations. in Seeheim model are- Replacing the
a) Hibernate presentation toolkit and Replacing the
b) Object oriented application toolkit.
c) Objective
d) None of the mentioned 1. Which schema object instructs Oracle to
View Answer connect to a remotely access an object of a
database?
Answer: a a) Sequence
Explanation: In Hibernate, the mapping from b) Remote link
each Java class to one or more relations is c) Database link
specified in a mapping file. d) Data link
advertisement View Answer

8. Which among the following are the functions Answer: d


that any system with a user interface must Explanation: A database link (DBlink) is a
provide? definition of how to establish a connection from
a) Presentation one Oracle database to another.
b) Dialogue
c) All of the mentioned 2. DML changes are
d) None of the mentioned a) Insert
View Answer b) Update
c) Create

59
d) Both Insert and Update b) INSERT queries
View Answer c) GROUP BY queries
d) HAVING queries
Answer: d View Answer
Explanation: Create is a DDL operation.
Answer: a
3. Which of the following object types below Explanation: SELECT
cannot be replicated? column_name,column_name
a) Data FROM table_name
b) Trigger ORDER BY column_name,column_name
c) View ASC|DESC;.
d) Sequence
View Answer 7. Which of the following rule below are
categories of an index?
Answer: d a) Column and Functional
Explanation: Sequence is a series of items which b) Multiple Column and functional
is like a unique index. c) Column, Multiple Column and functional
d) None of the mentioned
4. How to force a log switch? View Answer
a) By using ALTER SYSTEM LOG
b) By using ALTER SYSTEM SWITCH Answer: a
LOGFILE Explanation: The CREATE INDEX statement is
c) By using ALTER SYSTEM SWITCH LOGS used to create indexes in tables.
d) By using ALTER SYS LOGFILES
View Answer 8. What is the purpose of SMON background
process?
Answer: b a) Performs crash recovery when a failed
Explanation: ALTER SYSTEM ARCHIVE instance starts up again
LOG CURRENT is the best practice for b) Performs recovery when a user process fails
production backup scripts with RMAN. . c) Writes redo log entries to disk
d) None of the mentioned
5. In the following query, which expression is View Answer
evaluated first?
Answer: a
SELECT id_number, (quantity - 100 / 0.15 - 35 Explanation: SMON (System MONitor) is an
* 20) FROM inventory Oracle background process created when you
start a database instance.
a) 100 / 0.15 advertisement
b) quantity – 100
c) 35*20 9. Which of the following queries are legal?
d) 0.15-35 a) SELECT deptno, count(deptno) FROM emp
View Answer GROUP BY ename;
b) SELECT deptno, count(deptno), job FROM
Answer: a emp GROUP BY deptno;
Explanation: According to the precedence of c) SELECT deptno, avg(sal) FROM emp;
expression as in BODMAS the expression d) SELECT deptno, avg(sal) FROM emp
evaluated. GROUP BY deptno;
View Answer
6. The ORDER BY clause can only be used in
a) SELECT queries

60
Answer: d will not be able to decrypt and understand the
Explanation: For aggregate functions group by message.
clause is necessary.
3. Which of the following is not a property of
10. Which of the following queries displays the good encryption technique?
sum of all employee salaries for those a) Relatively simple for authorized users to
employees not making commission, for each encrypt and decrypt data
job, including only those sums greater than b) Decryption key is extremely difficult for an
2500? intruder to determine
a) select job, sum(sal) from emp where sum(sal) c) Encryption depends on a parameter of the
> 2500 and comm is null; algorithm called the encryption key
b) select job, sum(sal) from emp where comm is d) None of the mentioned
null group by job having sum(sal) > 2500; View Answer
c) select job, sum(sal) from emp where sum(sal)
> 2500 and comm is null group by job; Answer: d
d) select job, sum(sal) from emp group by job Explanation: Here a, b and c are the properties
having sum(sal) > 2500 and comm is not null; have to be present in a good design of an
View Answer encryption technique.

Answer: b 4. In which of the following encryption key is


Explanation: For aggregate functions group by used to encrypt and decrypt the data?
clause is necessary. a) Public key
b) Private key
1. ___________ is widely used today for c) Symmetric key
protecting data in transit in a variety of d) Asymmetric key
applications such as data transfer on the Internet, View Answer
and on cellular phone networks.
a) Encryption Answer: c
b) Data mining Explanation: In public-key (also known as
c) Internet Security asymmetric-key) encryption techniques, there
d) Architectural security are two different keys, the public key and the
View Answer private key, used to encrypt and decrypt the
data.
Answer: a
Explanation: Encryption is also used to carry out 5. Encryption of small values, such as identifiers
other tasks, such as authentication. or names, is made complicated by the possibility
of __________
2. In a database where the encryption is applied a) Dictionary attacks
the data is cannot be handled by the b) Database attacks
unauthorised user without c) Minor attacks
a) Encryption key d) Random attacks
b) Decryption key View Answer
c) Primary key
d) Authorised key Answer: a
View Answer Explanation: This happens when particularly if
the encryption key is publicly available.
Answer: b
Explanation: Even if the message is intercepted 6. Which one of the following uses a 128bit
by an enemy, the enemy, not knowing the key, round key to encrypt the data using XOR and
use it in reverse to decrypt it?

61
a) Round key algorithm information (the back door), but scarcely
b) Public key algorithm without this information. The information for the
c) Advanced Encryption Standard back door is contained in the private Key.
d) Asymmetric key algorithm
View Answer 9. Which is the largest disadvantage of
symmetric Encryption?
Answer: c a) More complex and therefore more time-
Explanation: The standard is based on the consuming calculations
Rijndael algorithm. b) Problem of the secure transmission of the
Secret Key
7. Which of the following requires no password c) Less secure encryption function
travel across the internet? d) Isn’t used any more
a) Readable system View Answer
b) Manipulation system
c) Challenge–response system Answer: b
d) Response system Explanation: As there is only one key in the
View Answer symmetrical encryption, this must be known by
both sender and recipient and this key is
Answer: c sufficient to decrypt the secret message.
Explanation: The database system sends a Therefore it must be exchanged between sender
challenge string to the user. The user encrypts and receiver in such a manner that an
the challenge string using a secret password as unauthorized person can in no case take
encryption key and then returns the result. The possession of it.
database system can verify the authenticity of
the user by decrypting the string with the same 10. Which is the principle of the encryption
secret password and checking the result with the using a key?
original challenge string. a) The key indicates which function is used for
advertisement encryption. Thereby it is more difficult to
decrypt an intercepted message as the function is
8. Assymmetric Encryption: Why can a message unknown
encrypted with the Public Key only be decrypted b) The key contains the secret function for
with the receiver’s appropriate Private Key? encryption including parameters. Only a
a) Not true, the message can also be decrypted password can activate the key
with the Public Key c) All functions are public, only the key is
b) A so called “one way function with back secret. It contains the parameters used for the
door” is applied for the encryption encryption resp. decryption
c) The Public Key contains a special function d) The key prevents the user of having to
which is used to encrypt the message and which reinstall the software at each change in
can only be reversed by the appropriate Private technology or in the functions for encryption
Key View Answer
d) The encrypted message contains the function
for decryption which identifies the Private Key Answer: b
View Answer Explanation: The encoding of a message is
calculated by an algorithm. If always the same
Answer: b algorithm would be used, it would be easy to
Explanation: An one-way function is a function crack intercepted messages. However, it isn’t
which a computer can calculate quickly, but possible to invent a new algorithm whenever the
whose reversal would last months or years. An old one was cracked, therefore the possibility to
one-way function with back door can be parameterize algorithms is needed and this is the
reversed with the help of a couple of additional assignment of the key.

62
1. Which of the following is a physical storage storage capacity for a given cost, and is widely
media? used for data storage in devices such as cameras,
a) Tape Storage music players, and cell phones.
b) Optical Storage
c) Flash memory 5. __________ is increasingly being used in
d) All of the mentioned server systems to improve performance by
View Answer caching frequently used data, since it provides
faster access than disk, with larger storage
Answer: d capacity than main memory.
Explanation: The storage media are classified by a) Flash memory
the speed with which data can be accessed, by b) Disk
the cost per unit of data to buy the medium, and c) Main memory
by the medium’s reliability. d) Secondary memory
View Answer
2. The _________ is the fastest and most costly
form of storage, which is relatively small; its use Answer: a
is managed by the computer system hardware. Explanation: Flash memory is of two types –
a) Cache NAND and NOR.
b) Disk
c) Main memory 6. Which is the cheapest memory device in
d) Flash memory terms of costs/ bit?
View Answer a) Semiconductor memory
b) Magnetic disks
Answer: a c) Compact disks
Explanation: Cache storage is easy to access d) Magnetic tapes
because it is closer to the processor. View Answer

3. Which of the following stores several Answer: c


gigabytes of data but usually lost when power Explanation: Compact disk is used for easy
failure? storage at lower cost.
a) Flash memory
b) Disk 7. The primary medium for the long-term online
c) Main memory storage of data is the __________ where the
d) Secondary memory entire database is stored on magnetic disk.
View Answer a) Semiconductor memory
b) Magnetic disks
Answer: c c) Compact disks
Explanation: The contents of main memory are d) Magnetic tapes
usually lost if a power failure or system crash View Answer
occurs.
Answer: b
4. The flash memory storage used are Explanation: The system must move the data
a) NOR Flash from disk to main memory so that they can be
b) OR Flash accessed.
c) AND Flash advertisement
d) All of the mentioned
View Answer 8. Optical disk _______ systems contain a few
drives and numerous disks that can be loaded
Answer: a into one of the drives automatically (by a robot
Explanation: NAND flash has a much higher arm) on demand.

63
a) Tape Storage Answer: d
b) Jukebox Explanation: Each side of a platter of a disk has
c) Flash memory a read–write head that moves across the platter
d) All of the mentioned to access different tracks.
View Answer
2. A __________ is the smallest unit of
Answer: b information that can be read from or written to
Explanation: The most popular form of optical the disk.
disks are CD and DVD. a) Track
b) Spindle
9. There are “record-once” versions of the c) Sector
compact disk and digital video disk, which can d) Platter
be written only once; such disks are also called View Answer
__________ disks.
a) Write-once, read-many (WORM) Answer: c
b) CD-R Explanation: The disk surface is logically
c) DVD-W divided into tracks, which are subdivided into
d) CD-ROM sectors.
View Answer
3. The disk platters mounted on a spindle and
Answer: a the heads mounted on a disk arm are together
Explanation: There are also “multiple-write” known as ___________
versions of compact disk (called CD-RW) and a) Read-disk assemblies
digital video disk (DVD-RW, DVD+RW, and b) Head–disk assemblies
DVD-RAM), which can be written multiple c) Head-write assemblies
times. d) Read-read assemblies
View Answer
10. Tape storage is referred to as __________
storage. Answer: b
a) Direct-access Explanation: Each side of a platter of a disk has
b) Random-access a read–write head that moves across the platter
c) Sequential-access to access different tracks.
d) All of the mentioned
View Answer 4. The disk controller uses ________ at each
sector to ensure that the data is not corrupted on
Answer: c data retrieval.
Explanation: Tape storage is used primarily for a) Checksum
backup and archival data. b) Unit drive
c) Read disk
1. In magnetic disk ________ stores information d) Readsum
on a sector magnetically as reversals of the View Answer
direction of magnetization of the magnetic
material. Answer: a
a) Read–write head Explanation: A disk controller interfaces
b) Read-assemble head between the computer system and the actual
c) Head–disk assemblies hardware of the disk drive.
d) Disk arm
View Answer 5. _________ is the time from when a read or
write request is issued to when data transfer
begins.

64
a) Access time Answer: d
b) Average seek time Explanation: Rotational speeds of disks today
c) Seek time range from 5400 rotations per minute (90
d) Rotational latency time rotations per second) up to 15,000 rotations per
View Answer minute (250 rotations per second), or,
equivalently, 4 milliseconds to 11.1 milliseconds
Answer: a per rotation.
Explanation: To access (that is, to read or write)
data on a given sector of a disk, the arm first 9. In Flash memory, the erase operation can be
must move so that it is positioned over the performed on a number of pages, called an
correct track, and then must wait for the sector _______ at once, and takes about 1 to 2
to appear under it as the disk rotates. milliseconds.
a) Delete block
6. The time for repositioning the arm is called b) Erase block
the ________ and it increases with the distance c) Flash block
that the arm must move. d) Read block
a) Access time View Answer
b) Average seek time
c) Seek time Answer: b
d) Rotational latency time Explanation: The size of an erase block (often
View Answer referred to as just “block” in flash literature) is
usually significantly larger than the block size of
Answer: c the storage system.
Explanation: Typical seek times range from 2 to
30 milliseconds, depending on how far the track 10. Hybrid disk drives are hard-disk systems that
is from the initial arm position. combine magnetic storage with a smaller
amount of flash memory, which is used as a
7. _________ is around one-half of the cache for frequently accessed data.
maximum seek time. a) Hybrid drivers
a) Access time b) Disk drivers
b) Average seek time c) Hybrid disk drivers
c) Seek time d) All of the mentioned
d) Rotational latency time View Answer
View Answer
Answer: b
Answer: b Explanation: Frequently accessed data that are
Explanation: Average seek times currently range rarely updated are ideal for caching in flash
between 4 and 10 milliseconds, depending on memory.
the disk model.
advertisement 1. Which level of RAID refers to disk mirroring
with block striping?
8. Once the head has reached the desired track, a) RAID level 1
the time spent waiting for the sector to be b) RAID level 2
accessed to appear under the head is called the c) RAID level 0
_______________ d) RAID level 3
a) Access time View Answer
b) Average seek time
c) Seek time Answer: a
d) Rotational latency time Explanation: RAID level 1 refers to disk
View Answer mirroring with block striping.

65
2. Optical disk technology uses be used with arrays of disks, to give the
a) Helical scanning appearance of a single large, reliable disk.
b) DAT
c) A laser beam 6. Where performance and reliability are both
d) RAID important, RAID level ____ is used.
View Answer a) 0
b) 1
Answer: d c) 2
Explanation: Redundant Array of Inexpensive d) 0+1
Disks. View Answer

3. With multiple disks, we can improve the Answer: d


transfer rate as well by ___________ data across Explanation: Mirroring without striping can also
multiple disks. be used with arrays of disks, to give the
a) Striping appearance of a single large, reliable disk.
b) Dividing
c) Mirroring 7. ______________ partitions data and parity
d) Dividing among all N+1 disks, instead of storing data in
View Answer N-disks and parity in one disk.
a) Block interleaved parity
Answer: a b) Block interleaved distributed parity
Explanation: Data striping consists of splitting c) Bit parity
the bits of each byte across multiple disks; such d) Bit interleaved parity
striping is called bitlevel striping. View Answer

4. Which one of the following is a Stripping Answer: b


technique? Explanation: In level 5, all disks can participate
a) Byte level stripping in satisfying read requests, unlike RAID level 4,
b) Raid level stripping where the parity disk cannot participate, so level
c) Disk level stripping 5 increases the total number of requests that can
d) Block level stripping be met in a given amount of time.
View Answer advertisement

Answer: d 8. Hardware RAID implementations permit


Explanation: Block-level striping stripes blocks _________ that is, faulty disks can be removed
across multiple disks. It treats the array of disks and replaced by new ones without turning power
as a single large disk, and it gives blocks logical off.
numbers. a) Scrapping
b) Swapping
5. The RAID level which mirroring is done c) Hot swapping
along with stripping is d) None of the mentioned
a) RAID 1+0 View Answer
b) RAID 0
c) RAID 2 Answer: c
d) Both RAID 1+0 and RAID 0 Explanation: Hot
View Answer swapping reduces the mean time to repair since
replacement of a disk does not have to wait until
Answer: d a time when the system can be shut down.
Explanation: Mirroring without striping can also

66
9. ___________ is popular for applications such d) Nodes
as storage of log files in a database system since View Answer
it offers the best write performance.
a) RAID level 1 Answer: a
b) RAID level 2 Explanation: A unit of storage that can store one
c) RAID level 0 or more records in a hash file organization is
d) RAID level 3 denoted as buckets.
View Answer
3. The file organization which allows us to read
Answer: a records that would satisfy the join condition by
Explanation: RAID level 1 refers to disk using one block read is
mirroring with block striping. a) Heap file organization
b) Sequential file organization
10. ______________ which increases the c) Clustering file organization
number of I/O operations needed to write a d) Hash file organization
single logical block, pays a significant time View Answer
penalty in terms of write performance.
a) RAID level 1 Answer: c
b) RAID level 2 Explanation: All systems in the cluster share a
c) RAID level 5 common file structure via NFS, but not all disks
d) RAID level 3 are mounted on all other systems.
View Answer
4. What are the correct features of a distributed
Answer: a database?
Explanation: In level 5, all disks can participate a) Is always connected to the internet
in satisfying read requests, unlike RAID level 4, b) Always requires more than three machines
where the parity disk cannot participate, so level c) Users see the data in one global schema.
5 increases the total number of requests that can d) Have to specify the physical location of the
be met in a given amount of time. data when an update is done
View Answer
1. Which level of RAID refers to disk mirroring
with block striping? Answer: c
a) RAID level 1 Explanation: Users see the data in one global
b) RAID level 2 schema.
c) RAID level 0
d) RAID level 3 5. Each tablespace in an Oracle database
View Answer consists of one or more files called
a) Files
Answer: a b) name space
Explanation: RAID (redundant array of c) datafiles
independent disks) is a way of storing the same d) PFILE
data in different places (thus, redundantly) on View Answer
multiple hard disks.
Answer: c
2. A unit of storage that can store one or more Explanation: A data file is a computer file which
records in a hash file organization is denoted as stores data to use by a computer application or
a) Buckets system.
b) Disk pages
c) Blocks 6. The management information system (MIS)
structure with one main computer system is

67
called a Answer: c
a) Hierarchical MIS structure Explanation: CODASYL is an acronym for
b) Distributed MIS structure “Conference on Data Systems Languages”.
c) Centralized MIS structure
d) Decentralized MIS structure 10. The highest level in the hierarchy of data
View Answer organization is called
a) Data bank
Answer: c b) Data base
Explanation: Structure of MIS may be c) Data file
understood by looking at the physical d) Data record
components of the information system in an View Answer
organization.
Answer: b
7. A top-to-bottom relationship among the items Explanation: Database is a collection of all
in a database is established by a tables which contains the data in form of fields.
a) Hierarchical schema
b) Network schema 1. If a piece of data is stored in two places in the
c) Relational schema database, then
d) All of the mentioned a) Storage space is wasted
View Answer b) Changing the data in one spot will cause data
inconsistency
Answer: a c) In can be more easily accessed
Explanation: A hierarchical database model is a d) Storage space is wasted & Changing the data
data model in which the data is organized into a in one spot will cause data inconsistency
tree-like structure. The structure allows View Answer
representing information using parent/child
relationships. Answer: d
advertisement Explanation: The database is always consistent
and so there is no duplication.
8. Choose the RDBMS which supports full
fledged client server application development 2. An audit trail ___________
a) dBase V a) Is used to make backup copies
b) Oracle 7.1 b) Is the recorded history of operations
c) FoxPro 2.1 performed on a file
d) Ingress c) Can be used to restore lost information
View Answer d) None of the mentioned
View Answer
Answer: b
Explanation: RDBMS is Relational Database Answer: b
Management System. Explanation: This is more useful for all recovery
actions.
9. One approach to standardization storing of
data? 3. Large collection of files are called
a) MIS ____________
b) Structured programming a) Fields
c) CODASYL specification b) Records
d) None of the mentioned c) Database
View Answer d) Sectors
View Answer

68
Answer: c d) None of the mentioned
Explanation: The operator tree has a tree like View Answer
format where the evaluation starts from root of
the tree . Answer: b
Explanation: All the data are stored in form of
4. Which of the following hardware component memory in the disk.
is the most important to the operation of a advertisement
database management system?
a) High resolution video display 8. The information about data in a database is
b) Printer called _______
c) High speed, large capacity disk a) Metadata
d) Mouse b) Hyper data
View Answer c) Tera data
d) None of the mentioned
Answer: c View Answer
Explanation: All the data are stored in form of
memory in the disk. Answer: a
Explanation: Metadata is information about a
5. Which of the following is not true of the data.
traditional approach to information processing
a) There is common sharing of data among the 9. A data dictionary is a special file that
various applications contains?
b) It is file oriented a) The names of all fields in all files
c) Programs are dependent on the file b) The data types of all fields in all files
d) It is inflexible c) The widths of all fields in all files
View Answer d) All of the mentioned
View Answer
Answer: a
Explanation: All the data are stored in form of Answer: d
memory in the disk. Explanation: The data dictionary is structured in
tables and views, just like other database data.
6. Which of these is not a feature of Hierarchical
model? 10. The DBMS acts as an interface between
a) Organizes the data in tree-like structure what two components of an enterprise-class
b) Parent node can have any number of child database system?
nodes a) Database application and the database
c) Root node does not have any parent b) Data and the database
d) Child node can have any number of parent c) The user and the database application
nodes d) Database application and SQL
View Answer View Answer

Answer: d Answer: a
Explanation: The data are traversed using Explanation: Database application is the
several algorithms. interface with the user to access the database.

7. Which of these data models is an extension of 1. A relational database system needs to


the relational data model? maintain data about the relations, such as the
a) Object-oriented data model schema of the relations. This is called
b) Object-relational data model a) Metadata
c) Semi structured data model b) Catalog

69
c) Log 5. A tablespace is further broken down into
d) Dictionary ________
View Answer a) Tablespace
b) Segments
Answer: a c) Extents
Explanation: Each side of a platter of a disk has d) Blocks
a read–write head that moves across the platter View Answer
to access different tracks.
Answer: b
2. Relational schemas and other metadata about Explanation: Segment names are used in create
relations are stored in a structure called the table and create index commands to place tables
____________ or indexes on specific database devices.
a) Metadata
b) Catalog 6. __________ is a contiguous group of blocks
c) Log allocated for use as part of a table, index, and so
d) Data Dictionary forth.
View Answer a) Tablespace
b) Segment
Answer: d c) Extent
Explanation: Data dictionary is also called as d) Block
system catalog. View Answer

3. ___________ is the collection of memory Answer: c


structures and Oracle background processes that Explanation: An extent is a set of contiguous
operates against an Oracle database. blocks allocated in a database.
a) Database
b) Instance 7. ________ is the smallest unit of allocation in
c) Tablespace an Oracle database.
d) Segment a) Database
View Answer b) Instance
c) Tablespace
Answer: b d) Database Block
Explanation: Instance is a snapshot of database View Answer
at any point of time.
Answer: d
4. A ________ is a logical grouping of database Explanation: Data block is a form of database
objects, usually to facilitate security, space allocation.
performance, or the availability of database advertisement
objects such as tables and indexes.
a) Tablespace 8. An Oracle __________ is a set of tables and
b) Segments views that are used as a read-only reference
c) Extents about the database.
d) Blocks a) Database dictionary
View Answer b) Dictionary table
c) Data dictionary
Answer: a d) Dictionary
Explanation: A tablespace is a storage location View Answer
where the actual data underlying database
objects can be kept.

70
Answer: c c) Savepoint
Explanation: Data dictionary is also called as d) Deadlock
system catalog. View Answer

9. A data dictionary is created when a Answer: b


__________ created. Explanation: Rollback is used to rollback to the
a) Instance point before lock is obtained.
b) Segment
c) Database 3. What are the ways of dealing with deadlock?
d) Dictionary a) Deadlock prevention
View Answer b) Deadlock recovery
c) Deadlock detection
Answer: c d) All of the mentioned
Explanation: Data dictionary is also called as View Answer
system catalog.
Answer: d
10. An Oracle object type has two parts the Explanation: Deadlock prevention is also called
_________ and__________ as deadlock recovery. Prevention is commonly
a) Instance and body used if the probability that the system would
b) Segment and blocks enter a deadlock state is relatively high;
c) Specification and body otherwise, detection and recovery are more
d) Body and segment efficient.
View Answer
4. When transaction Ti requests a data item
Answer: c currently held by Tj, Ti is allowed to wait only if
Explanation: Segment names are used in create it has a timestamp smaller than that of Tj (that is,
table and create index commands to place tables Ti is older than Tj). Otherwise, Ti is rolled back
or indexes on specific database devices. An (dies). This is
extent is a set of contiguous blocks allocated in a a) Wait-die
database. b) Wait-wound
c) Wound-wait
1. A system is in a ______ state if there exists a d) Wait
set of transactions such that every transaction in View Answer
the set is waiting for another transaction in the
set. Answer: a
a) Idle Explanation: The wait–die scheme is a non-
b) Waiting preemptive technique.
c) Deadlock
d) Ready 5. When transaction Ti requests a data item
View Answer currently held by Tj, Ti is allowed to wait only if
it has a timestamp larger than that of Tj (that is,
Answer: c Ti is younger than Tj ). Otherwise, Tj is rolled
Explanation: When one data item is waiting for back (Tj is wounded by Ti). This is
another data item in a transaction then system is a) Wait-die
in deadlock. b) Wait-wound
c) Wound-wait
2. The deadlock state can be changed back to d) Wait
stable state by using _____________ statement. View Answer
a) Commit
b) Rollback

71
Answer: c before it completes its designated task
Explanation: The wound–wait scheme is a b) How many data items the transaction has used
preemptive technique. It is a counterpart to the c) How many more data items the transaction
wait–die scheme. needs for it to complete
d) All of the mentioned
6. The situation where the lock waits only for a View Answer
specified amount of time for another lock to be
released is Answer: d
a) Lock timeout Explanation: We should roll back those
b) Wait-wound transactions that will incur the minimum cost.
c) Timeout
d) Wait 10. __________ rollback requires the system to
View Answer maintain additional information about the state
of all the running transactions.
Answer: a a) Total
Explanation: The timeout scheme is particularly b) Partial
easy to implement, and works well if c) Time
transactions are short and if longwaits are likely d) Commit
to be due to deadlocks. View Answer

7. The deadlock in a set of a transaction can be Answer: b


determined by Explanation: In total rollback abort the
a) Read-only graph transaction and then restart it.
b) Wait graph
c) Wait-for graph
d) All of the mentioned
View Answer

Answer: a
Explanation: Each transaction involved in the
cycle is said to be deadlocked.
advertisement

8. A deadlock exists in the system if and only if


the wait-for graph contains a ___________
a) Cycle
b) Direction
c) Bi-direction
d) Rotation
View Answer

Answer: a
Explanation: Each transaction involved in the
cycle is said to be deadlocked.

9. Selecting the victim to be rollbacked to the


previous state is determined by the minimum
cost. The factors determining cost of rollback is
a) How long the transaction has computed, and
how much longer the transaction will compute

72

Vous aimerez peut-être aussi