Unique User ID Expansion in Databases
Unique User ID Expansion in Databases
Database and Database Schema Explanation: Attribute is a specific domain in the relation
which has entries of all tuples.
This set of Database Multiple Choice Questions &
Answers (MCQs) focuses on “Relational Database and 5. For each attribute of a relation, there is a set of
Database Schema”. permitted values, called the ________ of that attribute.
a) Domain
1. A relational database consists of a collection of
b) Relation
a) Tables
c) Set
b) Fields
d) Schema
c) Records
View Answer
d) Keys
View Answer Answer: a
Explanation: The values of the attribute should be
Answer: a
present in the domain. Domain is a set of values
Explanation: Fields are the column of the relation or
permitted.
tables. Records are each row in a relation. Keys are the
constraints in a relation. Subscribe Now: DBMS Newsletter | Important Subjects
Newsletters
2. A ________ in a table represents a relationship
among a set of values. 6. Database __________ which is the logical design of
a) Column the database, and the database _______ which is a
b) Key snapshot of the data in the database at a given instant
c) Row in time.
d) Entry a) Instance, Schema
View Answer b) Relation, Schema
c) Relation, Domain
Answer: c
d) Schema, Instance
Explanation: Column has only one set of values. Keys are
View Answer
constraints and row is one whole set of attributes. Entry
is just a piece of data. Answer: d
Explanation: Instance is an instance of time and schema
3. The term _______ is used to refer to a row.
is a representation.
a) Attribute
b) Tuple 7. Course(course_id,sec_id,semester)
c) Field Here the course_id,sec_id and semester are
d) Instance __________ and course is a _________
View Answer a) Relations, Attribute
b) Attributes, Relation
Answer: b
c) Tuple, Relation
Explanation: Tuple is one entry of the relation with
d) Tuple, Attributes
several attributes which are fields.
View Answer
advertisement
Answer: b
4. The term attribute refers to a ___________ of a table. Explanation: The relation course has a set of attributes
a) Record course_id,sec_id,semester .
b) Column
8. Department (dept name, building, budget) and
c) Tuple
Employee (employee_id, name, dept name, salary)
d) Key
Here the dept_name attribute appears in both the
View Answer
relations. Here using common attributes in relation
Page 1 of 139
schema is one way of relating ___________ relations. 2. Consider attributes ID, CITY and NAME. Which one of
a) Attributes of common this can be considered as a super key?
b) Tuple of common a) NAME
c) Tuple of distinct b) ID
d) Attributes of distinct c) CITY
View Answer d) CITY, ID
View Answer
Answer: c
Explanation: Here the relations are connected by the Answer: b
common attributes. Explanation: Here the id is the only attribute which can
be taken as a key. Other attributes are not uniquely
9. A domain is atomic if elements of the domain are
identified.
considered to be ____________ units.
a) Different 3. The subset of a super key is a candidate key under
b) Indivisbile what condition?
c) Constant a) No proper subset is a super key
d) Divisible b) All subsets are super keys
View Answer c) Subset is a super key
d) Each subset is a super key
Answer: b
View Answer
Explanation: None.
Answer: a
10. The tuples of the relations can be of ________ order.
Explanation: The subset of a set cannot be the same set.
a) Any
Candidate key is a set from a super key which cannot be
b) Same
the whole of the super set.
c) Sorted
d) Constant advertisement
View Answer
4. A _____ is a property of the entire relation, rather
Answer: a than of the individual tuples in which each tuple is
Explanation: The values only count. The order of the unique.
tuples does not matter. a) Rows
b) Key
Database Questions and Answers – Keys
c) Attribute
This set of Database Multiple Choice Questions & d) Fields
Answers (MCQs) focuses on “Keys”. View Answer
6. Which one of the following cannot be taken as a 10. A _________ integrity constraint requires that the
primary key? values appearing in specified attributes of any tuple in
a) Id the referencing relation also appear in specified
b) Register number attributes of at least one tuple in the referenced
c) Dept_id relation.
d) Street a) Referential
View Answer b) Referencing
c) Specific
Answer: d
d) Primary
Explanation: Street is the only attribute which can occur
View Answer
more than once.
Answer: a
7. An attribute in a relation is a foreign key if the
Explanation: A relation, say r1, may include among its
_______ key from one relation is used as an attribute in
attributes the primary key of another relation, say r2.
that relation.
This attribute is called a foreign key from r1, referencing
a) Candidate
r2. The relation r1 is also called the referencing relation
b) Primary
of the foreign key dependency, and r2 is called the
c) Super
referenced relation of the foreign key.
d) Sub
View Answer atabase Questions and Answers – Relational Query
Operations and Relational Operators
Answer: b
Explanation: The primary key has to be referred in the This set of Database MCQs focuses on “Relational Query
other relation to form a foreign key in that relation. Operations and Relational Operators”.
8. The relation with the attribute which is the primary 1. Using which language can a user request information
key is referenced in another relation. The relation which from a database?
has the attribute as a primary key is called a) Query
______________ b) Relational
a) Referential relation c) Structural
b) Referencing relation d) Compiler
c) Referenced relation View Answer
d) Referred relation
Answer: a
View Answer
Explanation: Query language is a method through which
Answer: c the database entries can be accessed.
Explanation: None.
2. Student(ID, name, dept name, tot_cred)
9. The ______ is the one in which the primary key of In this query which attributes form the primary key?
one relation is used as a normal attribute in another a) Name
relation. b) Dept
a) Referential relation c) Tot_cred
b) Referencing relation d) ID
c) Referenced relation View Answer
Page 3 of 139
Answer: d c) Product
Explanation: The attributes name, dept and tot_cred can d) Intersect
have same values unlike ID. View Answer
advertisement Answer: c
Explanation: Select is used to view the tuples of the
4. The_____ operation allows the combining of two
relation with or without some constraints.
relations by merging pairs of tuples, one from each
relation, into a single tuple. 8. The _______ operator takes the results of two queries
a) Select and returns only rows that appear in both result sets.
b) Join a) Union
c) Union b) Intersect
d) Intersection c) Difference
View Answer d) Projection
View Answer
Answer: b
Explanation: Join finds the common tuple in the Answer: b
relations and combines it. Explanation: The union operator gives the result which
is the union of two queries and difference is the one
5. The result which operation contains all pairs of tuples
where query which is not a part of second query.
from the two relations, regardless of whether their
attribute values match. 9. A ________ is a pictorial depiction of the schema of a
a) Join database that shows the relations in the database, their
b) Cartesian product attributes, and primary keys and foreign keys.
c) Intersection a) Schema diagram
d) Set difference b) Relational algebra
View Answer c) Database diagram
d) Schema flow
Answer: b
View Answer
Explanation: Cartesian product is the multiplication of
all the values in the attributes. Answer: a
Explanation: None.
Sanfoundry Certification Contest of the Month is Live.
100+ Subjects. Participate Now! 10. The _________ provides a set of operations that
take one or more relations as input and return a relation
6. The _______operation performs a set union of two
as an output.
“similarly structured” tables
a) Schematic representation
a) Union
b) Relational algebra
b) Join
c) Scheme diagram
Page 4 of 139
d) Relation flow d) Integrity constraint
View Answer View Answer
Answer: b Answer: b
Explanation: None. Explanation: Data Definition language is the language
which performs all the operation in defining structure of
Database Questions and Answers – SQL Basics and SQL
relation.
Data Definition
Subscribe Now: DBMS Newsletter | Important Subjects
This set of Database Multiple Choice Questions &
Newsletters
Answers (MCQs) focuses on “SQL Basics and SQL Data
Definition”. 4.
1. Which one of the following is used to define the SELECT * FROM employee
structure of the relation, deleting relations and relating
What type of statement is this?
schemas?
a) DML
a) DML(Data Manipulation Langauge)
b) DDL
b) DDL(Data Definition Langauge)
c) View
c) Query
d) Integrity constraint
d) Relational Schema
View Answer
View Answer
Answer: a
Answer: b
Explanation: Select operation just shows the required
Explanation: Data Definition language is the language
fields of the relation. So it forms a DML.
which performs all the operation in defining structure of
relation. 5. The basic data type char(n) is a _____ length
character string and varchar(n) is _____ length
2. Which one of the following provides the ability to
character.
query information from the database and to insert
a) Fixed, equal
tuples into, delete tuples from, and modify tuples in the
b) Equal, variable
database?
c) Fixed, variable
a) DML(Data Manipulation Langauge)
d) Variable, equal
b) DDL(Data Definition Langauge)
View Answer
c) Query
d) Relational Schema Answer: c
View Answer Explanation: Varchar changes its length accordingly
whereas char has a specific length which has to be filled
Answer: a
by either letters or spaces.
Explanation: DML performs the change in the values of
the relation. 6. An attribute A of datatype varchar(20) has the value
“Avi”. The attribute B of datatype char(20) has value
3.
”Reed”. Here attribute A has ____ spaces and attribute B
advertisement has ____ spaces.
a) 3, 20
CREATE TABLE employee (name VARCHAR, id INTEGER)
b) 20, 4
What type of statement is this? c) 20, 20
a) DML d) 3, 4
b) DDL View Answer
c) View
Answer: a
Explanation: Varchar changes its length accordingly
Page 5 of 139
whereas char has a specific length which has to be filled Answer: a
by either letters or spaces. Explanation: Integrity constraint has to be maintained in
the entries of the relation.
7. To remove a relation from an SQL database, we use
the ______ command. Database Questions and Answers – SQL Queries
a) Delete
This set of Database Multiple Choice Questions &
b) Purge
Answers (MCQs) focuses on “SQL Queries”.
c) Remove
d) Drop table 1.
View Answer
Answer: d Name
Explanation: Drop table deletes the whole structure of
the relation .purge removes the table which cannot be Annie
obtained again.
8. Bob
DELETE FROM r; //r - relation
Page 6 of 139
Answer: c 6. This Query can be replaced by which one of the
Explanation: Distinct keyword selects only the entries following?
that are unique.
SELECT name, course_id
Sanfoundry Certification Contest of the Month is Live.
FROM instructor, teaches
100+ Subjects. Participate Now!
WHERE instructor_ID= teaches_ID;
3. The ______ clause allows us to select only those rows
in the result relation of the ____ clause that satisfy a a) Select name,course_id from teaches,instructor where
specified predicate. instructor_id=course_id;
a) Where, from b) Select name, course_id from instructor natural join
b) From, select 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 particular Explanation: Join clause joins two tables by matching
condition. From gives the relation which involves the the common column.
operation.
7.
4. The query given below will not give an error. Which
one of the following has to be replaced to get the SELECT * FROM employee WHERE salary>10000 AND
desired output? dept_id=101;
SELECT ID, name, dept name, salary * 1.1 Which of the following fields are displayed as output?
a) Salary, dept_id
WHERE instructor; b) Employee
c) Salary
a) Salary*1.1
d) All the field of employee relation
b) ID
View Answer
c) Where
d) Instructor Answer: d
View Answer Explanation: Here * is used to select all the fields of the
relation.
Answer: c
Explanation: Where selects the rows on a particular 8.
condition. From gives the relation which involves the
operation. Since Instructor is a relation it has to have Employee_id
from clause.
a) 1009, 1001, 1018 Which keyword must be used here to rename the field
b) 1009, 1018 name?
c) 1001 a) From
d) 1018 b) Rename
View Answer c) As
d) Join
Answer: d
View Answer
Explanation: Greater than symbol does not include the
given value unlike >=. Answer: c
Explanation: As keyword is used to rename.
9. Which of the following statements contains an error?
a) Select * from emp where empid = 10003; advertisement
b) Select empid from emp where empid = 10006;
2.
c) Select empid from emp;
d) Select empid where empid = 1009 and lastname = SELECT * FROM employee WHERE dept_name="Comp
‘GELLER’; Sci";
View Answer
In the SQL given above there is an error . Identify the
Answer: d error.
Explanation: This query do not have from clause which a) Dept_name
specifies the relation from which the values has to be b) Employee
selected. c) “Comp Sci”
d) From
10. In the given query which of the keyword has to be
View Answer
inserted?
Answer: c
INSERT INTO employee _____ (1002,Joey,2000);
Explanation: For any string operations single quoted(‘)
a) Table must be used to enclose.
b) Values
Sanfoundry Certification Contest of the Month is Live.
c) Relation
100+ Subjects. Participate Now!
d) Field
View Answer 3.
Answer: b SELECT emp_name
Explanation: Value keyword has to be used to insert the
values into the table. FROM department
Sanfoundry Global Education & Learning Series – WHERE dept_name LIKE ’ _____ Computer Science’;
Database Management Syste Which one of the following has to be added into the
Database Questions and Answers – Basic SQL blank to select the dept_name which has Computer
Operations Science as its ending string?
a) %
This set of Database Multiple Choice Questions & b) _
Answers (MCQs) focuses on “Basic SQL Operations”. c) ||
d) $
1.
View Answer
SELECT name ____ instructor name, course id
Answer: a
FROM instructor, teaches Explanation: The % character matches any substring.
Page 8 of 139
4. ’_ _ _ ’ matches any string of ______ three characters. 7.
’_ _ _ %’ matches any string of at ______ three
SELECT name
characters.
a) Atleast, Exactly FROM instructor
b) Exactly, Atleast
c) Atleast, All WHERE salary <= 100000 AND salary >= 90000;
d) All, Exactly This query can be replaced by which of the following ?
View Answer a)
Answer: b SELECT name
Explanation: None.
FROM instructor
5.
WHERE salary BETWEEN 90000 AND 100000;
SELECT name
b)
FROM instructor
SELECT name
WHERE dept name = ’Physics’
FROM employee
ORDER BY name;
WHERE salary <= 90000 AND salary>=100000;
By default, the order by clause lists items in ______
order. c)
a) Descending SELECT name
b) Any
c) Same FROM employee
d) Ascending
WHERE salary BETWEEN 90000 AND 100000;
View Answer
d)
Answer: d
Explanation: Specification of descending order is SELECT name
essential but it not for ascending.
FROM instructor
6.
WHERE salary BETWEEN 100000 AND 90000;
SELECT *
View Answer
FROM instructor
Answer: a
ORDER BY salary ____, name ___; Explanation: SQL includes a between comparison
operator to simplify where clauses that specify that a
To display the salary from greater to smaller and name
value be less than or equal to some value and greater
in ascending order which of the following options
than or equal to some other value.
should be used?
a) Ascending, Descending
b) Asc, Desc
c) Desc, Asc
8.
d) Descending, Ascending
View Answer SELECT instructor.*
Answer: c FROM instructor, teaches
Explanation: None.
WHERE [Link]= [Link];
Page 9 of 139
This query does which of the following operation? 2. The intersection operator is used to get the _____
a) All attributes of instructor and teaches are selected tuples.
b) All attributes of instructor are selected on the given a) Different
condition b) Common
c) All attributes of teaches are selected on given c) All
condition d) Repeating
d) Only the some attributes from instructed and teaches View Answer
are selected
Answer: b
View Answer
Explanation: Intersection operator ignores unique tuples
Answer: b and takes only common ones.
Explanation: The asterisk symbol “ * ” can be usedin the
3. The union operation automatically __________ unlike
select clause to denote “all attributes.”
the select clause.
9. In SQL the spaces at the end of the string are a) Adds tuples
removed by _______ function. b) Eliminates unique tuples
a) Upper c) Adds common tuples
b) String d) Eliminates duplicate
c) Trim View Answer
d) Lower
Answer: d
View Answer
Explanation: None.
Answer: c
advertisement
Explanation: The syntax of trim is Trim(s); where s-
string. 4. If we want to retain all duplicates, we must write
________ in place of union.
10. _____ operator is used for appending two strings.
a) Union all
a) &
b) Union some
b) %
c) Intersect all
c) ||
d) Intersect some
d) _
View Answer
View Answer
Answer: a
Answer: c
Explanation: Union all will combine all the tuples
Explanation: || is the concatenation operator.
including duplicates.
5.
Database Questions and Answers – Set Operations
Sanfoundry Certification Contest of the Month is Live.
This set of Database Multiple Choice Questions & 100+ Subjects. Participate Now!
Answers (MCQs) focuses on “Set Operations”.
(SELECT course id
1. The union operation is represented by
FROM SECTION
a) ∩
b) U WHERE semester = ’Fall’ AND YEAR= 2009)
c) –
d) * EXCEPT
View Answer (SELECT course id
Answer: b FROM SECTION
Explanation: Union operator combines the relations.
Page 10 of 139
WHERE semester = ’Spring’ AND YEAR= 2010); Answer: c
Explanation: Having is used to provide additional
This query displays
aggregate filtration to the query.
a) Only tuples from second part
b) Only tuples from the first part which has the tuples 9. _________ joins are SQL server default
from second part a) Outer
c) Tuples from both the parts b) Inner
d) Tuples from first part which do not have second part c) Equi
View Answer d) None of the mentioned
View Answer
Answer: d
Explanation: Except keyword is used to ignore the Answer: b
values. Explanation: It is optional to give the inner keyword with
the join as it is default.
6. For like predicate which of the following is true.
10. The _____________ is essentially used to search for
i) % matches zero OF more characters.
patterns in target string.
ii) _ matches exactly one CHARACTER. a) Like Predicate
b) Null Predicate
a) i-only c) In Predicate
b) ii-only d) Out Predicate
c) i & ii View Answer
d) None of the mentioned
View Answer Answer: a
Explanation: Like predicate matches the string in the
Answer: c given pattern.
Explanation: The % wildcard matches zero or more
characters, while the _ wildcard matches exactly one Database Questions and Answers – Null Values
character. Together, they offer flexibility and precision in Operations
pattern matching within the like predicate.
This set of Database Multiple Choice Questions &
7. The number of attributes in relation is called as its Answers (MCQs) focuses on “Null Values Operations”.
a) Cardinality
1. A _____ indicates an absent value that may exist but
b) Degree
be unknown or that may not exist at all.
c) Tuples
a) Empty tuple
d) Entity
b) New value
View Answer
c) Null value
Answer: b d) Old value
Explanation: None. View Answer
Page 11 of 139
d) Empty space Answer: b
View Answer Explanation: Not null constraint removes the tuples of
null values.
Answer: c
Explanation: Null is used to represent the absence of a 6. Using the ______ clause retains only one copy of such
value. identical tuples.
a) Null
3. The predicate in a where clause can involve Boolean
b) Unique
operations such as and. The result of true and unknown
c) Not null
is_______ false and unknown is _____ while unknown
d) Distinct
and unknown is _____
View Answer
a) Unknown, unknown, false
b) True, false, unknown Answer: d
c) True, unknown, unknown Explanation: Unique is a constraint.
d) Unknown, false, unknown
7.
View Answer
CREATE TABLE employee (id INTEGER,name
Answer: d
VARCHAR(20),salary NOT NULL);
Explanation: None.
INSERT INTO employee VALUES (1005,Rach,0);
advertisement
INSERT INTO employee VALUES (1007,Ross, );
4.
INSERT INTO employee VALUES (1002,Joey,335);
SELECT name
Some of these insert statements will produce an error.
FROM instructor
Identify the statement.
WHERE salary IS NOT NULL; a) Insert into employee values (1005,Rach,0);
b) Insert into employee values (1002,Joey,335);
Selects
c) Insert into employee values (1007,Ross, );
a) Tuples with null value d) None of the mentioned
b) Tuples with no null values View Answer
c) Tuples with any salary
Answer: c
d) All of the mentioned
Explanation: Not null constraint is specified which
View Answer
means sone value (can include 0 also) should be given.
Answer: b
8. The primary key must be
Explanation: Not null constraint removes the tpules of
a) Unique
null values.
b) Not null
Sanfoundry Certification Contest of the Month is Live. c) Both Unique and Not null
100+ Subjects. Participate Now! d) Either Unique or Not null
View Answer
5. In an employee table to include the attributes whose
value always have some value which of the following Answer: c
constraint must be used? Explanation: Primary key must satisfy unique and not
a) Null null condition for sure.
b) Not null
9. You attempt to query the database with this
c) Unique
command:
d) Distinct
View Answer SELECT nvl (100 / quantity, NONE)
Page 12 of 139
FROM inventory; Which of the following should be used to find the mean
of the salary ?
Why does this statement cause an error when
a) Mean(salary)
QUANTITY values are null?
b) Avg(salary)
a) The expression attempts to divide by a null value
c) Sum(salary)
b) The data types in the conversion function are
d) Count(salary)
incompatible
View Answer
c) The character string none should be enclosed in single
quotes (‘ ‘) Answer: b
d) A null value used in an expression cannot be Explanation: Avg() is used to find the mean of the
converted to an actual value values.
View Answer
advertisement
Answer: a
3.
Explanation: The expression attempts to divide by a null
value is erroneous in sql. Note: Join free Sanfoundry classes
at Telegram or Youtube
10. The result of _____unknown is unknown.
a) Xor SELECT COUNT (____ ID)
b) Or
c) And FROM teaches
d) Not WHERE semester = ’Spring’ AND YEAR = 2010;
View Answer
If we do want to eliminate duplicates, we use the
Answer: d keyword ______in the aggregate expression.
Explanation: Since unknown does not hold any value the a) Distinct
value cannot have a reverse value. b) Count
Database Questions and Answers – Aggregate c) Avg
Functions and Nested Subqueries – 1 d) Primary key
View Answer
This set of Database Multiple Choice Questions &
Answers (MCQs) focuses on “Aggregate Functions and Answer: a
Nested Subqueries – 1”. Explanation: Distinct keyword is used to select only
unique items from the relation.
1. Aggregate functions are functions that take a
___________ as input and return a single value. 4. All aggregate functions except _____ ignore null
a) Collection of values values in their input collection.
b) Single value a) Count(attribute)
c) Aggregate value b) Count(*)
d) Both Collection of values & Single value c) Avg
View Answer d) Sum
View Answer
Answer: a
Explanation: None. Answer: b
Explanation: * is used to select all values including null.
2.
5. A Boolean data type that can take values true, false,
SELECT __________ and________
a) 1
FROM instructor
b) 0
WHERE dept name= ’Comp. Sci.’; c) Null
Page 13 of 139
d) Unknown SELECT COUNT (DISTINCT ID)
View Answer
FROM takes
Answer: d
WHERE (course id, sec id, semester, YEAR) IN (SELECT
Explanation: Unknown values do not take null value but
course id, sec id, semester, YEAR
it is not known.
FROM teaches
6. The ____ connective tests for set membership, where
the set is a collection of values produced by a select WHERE [Link]= 10101);
clause. The ____ connective tests for the absence of set
membership. View Answer
a) Or, in Answer: a
b) Not in, in Explanation: None.
c) In, not in
d) In, or
View Answer
Page 14 of 139
FROM instructor SELECT dept_name, ID, avg (salary)
c) GROUP BY dept_name;
Page 15 of 139
Sanfoundry Certification Contest of the Month is Live. In the query given above which one of the following is a
100+ Subjects. Participate Now! temporary relation?
a) Budget
4. The ________ keyword is used to access attributes of
b) Department
preceding tables or subqueries in the from clause.
c) Value
a) In
d) Max_budget
b) Lateral
View Answer
c) Having
d) With Answer: d
View Answer Explanation: With clause creates a temporary relation.
Database Questions and Answers – Modification of INSERT INTO course (course id, title, dept name,
Database credits)
This set of Database Multiple Choice Questions & VALUES (’CS-437’, ’DATABASE Systems’, ’Comp. Sci.’, 4);
Answers (MCQs) focuses on “Modification of Database”.
b)
1. A Delete command operates on ______ relation.
INSERT INTO instructor
a) One
b) Two SELECT ID, name, dept name, 18000
c) Several
d) Null FROM student
View Answer WHERE dept name = ’Music’ AND tot cred > 144;
Answer: a c)
Explanation: Delete can delete from only one table at a
time. INSERT INTO course VALUES (’CS-437’, ’DATABASE
Systems’, ’Comp. Sci.’, 4);
2.
d) Not possible
Delete from r where P; View Answer
The above command Answer: b
a) Deletes a particular tuple from the relation Explanation: Using select statement in insert will include
b) Deletes the relation rows which are the result of the selection.
c) Clears all entries from the relation
d) All of the mentioned 5. Which of the following deletes all tuples in the
View Answer instructor relation for those instructors associated with
a department located in the Watson building which is in
Answer: a department relation.
Explanation: Here P gives the condition for deleting a)
specific rows.
DELETE FROM instructor
advertisement
WHERE dept_name IN 'Watson';
3. Which one of the following deletes all the entries but
keeps the structure of the relation. b)
a) Delete from r where P; DELETE FROM department
b) Delete from instructor where dept name= ’Finance’;
c) Delete from instructor where salary between 13000 WHERE building='Watson';
and 15000;
c)
d) Delete from instructor;
View Answer DELETE FROM instructor
Answer: d o
Explanation: Types are inner join, left outer join, right • Internship
outer join, full join, cross join.
o
8. Which join refers to join records from the right table
that have no matching key in the left table are include in o
the result set:
• Training
a) Left outer join
b) Right outer join • Videos
c) Full outer join
o
d) Half outer join
View Answer o
Answer: b o
Explanation: RIGHT OUTER JOIN: Return all rows from
• Books
the right table and the matched rows from the left
table. • Contact
9. The operation which is not considered a basic Database Questions and Answers – Views
operation of relational algebra is
a) Join This set of Database Multiple Choice Questions &
b) Selection Answers (MCQs) focuses on “Views”.
c) Union 1. Which of the following creates a virtual relation for
storing the query?
Page 20 of 139
a) Function d) View is deleted after specified time
b) View View Answer
c) Procedure
Answer: b
d) None of the mentioned
Explanation: None.
View Answer
5. Updating the value of the view
Answer: b
a) Will affect the relation from which it is defined
Explanation: Any such relation that is not part of the
b) Will not change the view definition
logical model, but is made visible to a user as a virtual
c) Will not affect the relation from which it is defined
relation, is called a view.
d) Cannot determine
2. Which of the following is the syntax for views where v View Answer
is view name?
Answer: a
a) Create view v as “query name”;
Explanation: None.
b) Create “query expression” as view;
c) Create view v as “query expression”; 6. SQL view is said to be updatable (that is, inserts,
d) Create view “query expression”; updates or deletes can be applied on the view) if which
View Answer of the following conditions are satisfied by the query
defining the view?
Answer: c
a) The from clause has only one database relation
Explanation: <query expression> is any legal query
b) The query does not have a group by or having clause
expression. The view name is represented by v.
c) The select clause contains only attribute names of the
3. relation and does not have any expressions, aggregates,
or distinct specification
advertisement
d) All of the mentioned
SELECT course_id View Answer
Page 21 of 139
SELECT ID, name, building
ID Name Dept_name
FROM department;
3. In order to undo the work of transaction after last 6. In order to maintain the consistency during
commit which one should be used? transactions, database provides
a) View a) Commit
b) Commit b) Atomic
c) Rollback c) Flashback
d) Flashback d) Retain
View Answer View Answer
Answer: c Answer: b
Explanation: Rollback work causes the current Explanation: By atomic, either all the effects of the
transaction to be rolled back; that is, it undoes all the transaction are reflected in the database, or none are
updates performed by the SQL statements in the (after rollback).
transaction.
7. Transaction processing is associated with everything
advertisement below except
a) Conforming an action or triggering a response
4. Consider the following action:
b) Producing detail summary or exception report
TRANSACTION..... c) Recording a business activity
d) Maintaining a data
Commit; View Answer
ROLLBACK; Answer: a
What does Rollback do? Explanation: None.
a) Undoes the transactions before commit
Page 23 of 139
8. A transaction completes its execution is said to be 2. Which of the following is not an integrity 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 commits. Explanation: Positive is a value and not a constraint.
10. ______ will undo all statements up to commit? INSERT INTO Employee VALUES(1002,Rita,Sales,20000);
a) Transaction What will be the result of the query?
b) Flashback a) All statements executed
c) Rollback b) Error in create statement
d) Abort c) Error in insert into Employee
View Answer values(1006,Ted,Finance, );
Answer: c d) Error in insert into Employee
Explanation: Flashback will undo all the statements and values(1008,Ross,Sales,20000);
Abort will terminate the operation. View Answer
Page 24 of 139
d) Alter(budget<0) Answer: c
View Answer Explanation: An assertion is a predicate expressing a
condition we wish the database to always satisfy.
Answer: a
Explanation: A common use of the check clause is to 8. Which of the following is the right syntax for the
ensure that attribute values satisfy specified conditions, assertion?
in effect creating a powerful type system. a) Create assertion ‘assertion-name’ check ‘predicate’;
b) Create assertion check ‘predicate’ ‘assertion-name’;
5. Foreign key is the one in which the ________ of one
c) Create assertions ‘predicates’;
relation is referenced in another relation.
d) All of the mentioned
a) Foreign key
View Answer
b) Primary key
c) References Answer: a
d) Check constraint Explanation: None.
View Answer
9. Data integrity constraints are used to:
Answer: b a) Control who is allowed access to the data
Explanation: The foreign-key declaration specifies that b) Ensure that duplicate records are not entered into the
for each course tuple, the department name specified in table
the tuple must exist in the department relation. c) Improve the quality of data entered for a specific
property (i.e., table column)
6.
d) Prevent users from changing the values stored in the
CREATE TABLE course table
View Answer
(...
Answer: c
FOREIGN KEY (dept name) REFERENCES department Explanation: None.
. . . ); 10. Which of the following can be addressed by
Which of the following is used to delete the entries in enforcing a referential integrity constraint?
the referenced table when the tuple is deleted in course a) All phone numbers must include the area code
table? b) Certain fields are required (such as the email address,
a) Delete or phone number) before the record is accepted
b) Delete cascade c) Information on the customer must be known before
c) Set null anything can be sold to that customer
d) All of the mentioned d) When entering an order quantity, the user must input
View Answer a number and not some text (i.e., 12 rather than ‘a
dozen’)
Answer: b View Answer
Explanation: The delete “cascades” to the course
relation, deletes the tuple that refers to the department Answer: c
that was deleted. Explanation: The information can be referred to and
obtained.
7. Domain constraints, functional dependency and
referential integrity are special forms of _________
a) Foreign key
b) Primary key
c) Assertion
d) Referential constraint
Database Questions and Answers – SQL Data Types and
View Answer
Schemas
Page 25 of 139
This set of Database Multiple Choice Questions & c) Binary
Answers (MCQs) focuses on “SQL Data Types and d) Image
Schemas”. View Answer
Page 27 of 139
3. Which of the following is used to provide privilege to 6. Which of the following is true regarding views?
only a particular attribute? a) The user who creates a view cannot be given update
a) Grant select on employee to Amit authorization on a view without having update
b) Grant update(budget) on department to Raj authorization on the relations used to define the view
c) Grant update(budget,salary,Rate) on department to b) The user who creates a view cannot be given update
Raj authorization on a view without having update
d) Grant delete to Amit authorization on the relations used to define the view
View Answer c) If a user creates a view on which no authorization can
be granted, the system will allow the view creation
Answer: b
request
Explanation: This grant statement gives user Raj update
d) A user who creates a view receives all privileges on
authorization on the budget attribute of the department
that view
relation.
View Answer
4. Which of the following statement is used to remove
Answer: c
the privilege from the user Amir?
Explanation: A user who creates a view does not
a) Remove update on department from Amir
necessarily receive all privileges on that view.
b) Revoke update on employee from Amir
c) Delete select on department from Raj 7. If we wish to grant a privilege and to allow the
d) Grant update on employee from Amir recipient to pass the privilege on to other users, we
View Answer append the __________ clause to the appropriate grant
command.
Answer: b
a) With grant
Explanation: revoke on from ;
b) Grant user
5. Which of the following is used to provide delete c) Grant pass privelege
authorization to instructor? d) With grant option
a) View Answer
Answer: a Answer: c
Explanation:? is used as a placeholder whose value can Explanation: The SQL can be terminated by ; to
be provided later. terminate the sentence.
7. Which of the following is used as the embedded SQL 10. Which of the following is used to access large
in COBOL? objects from a database ?
a) EXEC SQL <embedded SQL statement >; a) setBlob()
b) EXEC SQL <embedded SQL statement > END-EXEC b) getBlob()
c) EXEC SQL <embedded SQL statement > c) getClob()
d) EXEC SQL <embedded SQL statement > END EXEC; d) all of the mentioned
View Answer View Answer
Answer: b Answer: d
Explanation: EXEC SQL <embedded SQL statement >; is Explanation: None.
normally in C.
Page 31 of 139
d) All of the mentioned 2. An entity in A is associated with at most one entity in
View Answer B, and an entity in B is associated with at most one
entity in [Link] is called as
Answer: a
a) One-to-many
Explanation: Name and Date_of_birth cannot hold more
b) One-to-one
than 1 value.
c) Many-to-many
9. Which of the following is a single valued attribute d) Many-to-one
a) Register_number View Answer
b) Address
Answer: b
c) SUBJECT_TAKEN
Explanation: Here one entity in one set is related to one
d) Reference
one entity in other set.
View Answer
3. An entity in A is associated with at most one entity in
Answer: a
B. An entity in B, however, can be associated with any
Explanation: None.
number (zero or more) of entities in A.
10. In a relation between the entities the type and a) One-to-many
condition of the relation should be specified. That is b) One-to-one
called as______attribute. c) Many-to-many
a) Desciptive d) Many-to-one
b) Derived View Answer
c) Recursive
Answer: d
d) Relative
Explanation: Here more than one entity in one set is
View Answer
related to one one entity in other set.
Answer: a
advertisement
Explanation: Consider the entity sets student and
section, which participate in a relationship set takes. We 4. Data integrity constraints are used to:
may wish to store a descriptive attribute grade with the a) Control who is allowed access to the data
relationship to record the grade that a student got in the b) Ensure that duplicate records are not entered into the
class. table
c) Improve the quality of data entered for a specific
Database Questions and Answers – Constraints
property
This set of Database Multiple Choice Questions & d) Prevent users from changing the values stored in the
Answers (MCQs) focuses on “Constraints”. table
View Answer
1. _____________ express the number of entities to
which another entity can be associated via a Answer: c
relationship set. Explanation: The data entered will be in a particular cell
a) Mapping Cardinality (i.e., table column).
b) Relational Cardinality
5. Establishing limits on allowable property values, and
c) Participation Constraints
specifying a set of acceptable, predefined options that
d) None of the mentioned
can be assigned to a property are examples of:
View Answer
a) Attributes
Answer: a b) Data integrity constraints
Explanation: Mapping cardinality is also called as c) Method constraints
cardinality ratio. d) Referential integrity constraints
View Answer
Page 32 of 139
Answer: b d) Foreign Key
Explanation: Only particular value satisfying the View Answer
constraints are entered in the column.
Answer: d
Subscribe Now: DBMS Newsletter | Important Subjects Explanation: Foreign key is used when primary key of
Newsletters one relation is used in another relation.
6. Which of the following can be addressed by enforcing 10. ____________ is preferred method for enforcing
a referential integrity constraint? data integrity
a) All phone numbers must include the area code a) Constraints
b) Certain fields are required (such as the email address, b) Stored Procedure
or phone number) before the record is accepted c) Triggers
c) Information on the customer must be known before d) Cursors
anything can be sold to that customer View Answer
d) Then entering an order quantity, the user must input
Answer: a
a number and not some text (i.e., 12 rather than ‘a
Explanation: Constraints are specified to restrict entries
dozen’)
in the relation.
View Answer
Database Questions and Answers – Entity-Relationship
Answer: c
Diagrams
Explanation: None.
This set of Database Multiple Choice Questions &
7. ______ is a special type of integrity constraint that
Answers (MCQs) focuses on “Entity-Relationship
relates two relations & maintains consistency across the
Diagrams”.
relations.
a) Entity Integrity Constraints 1. Which of the following gives a logical structure of the
b) Referential Integrity Constraints database graphically?
c) Domain Integrity Constraints a) Entity-relationship diagram
d) Domain Constraints b) Entity diagram
View Answer c) Database diagram
d) Architectural representation
Answer: b
View Answer
Explanation: None.
Answer: a
8. Which one of the following uniquely identifies the
Explanation: E-R diagrams are simple and clear—
elements in the relation?
qualities that may well account in large part for the
a) Secondary Key
widespread use of the E-R model.
b) Primary key
c) Foreign key 2. The entity relationship set is represented in E-R
d) Composite key diagram as
View Answer a) Double diamonds
b) Undivided rectangles
Answer: b
c) Dashed lines
Explanation: Primary key checks for not null and
d) Diamond
uniqueness constraint.
View Answer
9. Drop Table cannot be used to drop a table referenced
Answer: d
by a _________ constraint.
Explanation: Dashed lines link attributes of a
a) Local Key
relationship set to the relationship set.
b) Primary Key
c) Composite Key
Page 33 of 139
3. The Rectangles divided into two parts represents Answer: c
a) Entity set Explanation: An entity set that has a primary key is
b) Relationship set termed a strong entity set.
c) Attributes of a relationship set
7. For a weak entity set to be meaningful, it must be
d) Primary key
associated with another entity set, called the
View Answer
a) Identifying set
Answer: a b) Owner set
Explanation: The first part of the rectangle, contains the c) Neighbour set
name of the entity set. The second part contains the d) Strong entity set
names of all the attributes of the entity set. View Answer
advertisement Answer: a
Explanation: Every weak entity must be associated with
4. Consider a directed line(->) from the relationship set
an identifying entity; that is, the weak entity set is said
advisor to both entity sets instructor and student. This
to be existence dependent on the identifying entity set.
indicates _________ cardinality
The identifying entity set is said to own the weak entity
a) One to many
set that it identifies. It is also called as owner entity set.
b) One to one
c) Many to many 8. Weak entity set is represented as
d) Many to one a) Underline
View Answer b) Double line
c) Double diamond
Answer: b
d) Double rectangle
Explanation: This indicates that an instructor may advise
View Answer
at most one student, and a student may have at most
one advisor. Answer: d
Explanation: Weak entity set is represented as a double
5. We indicate roles in E-R diagrams by labeling the lines
rectangle in entity relationship diagram.
that connect ___________ to __________
a) Diamond , diamond 9. If you were collecting and storing information about
b) Rectangle, diamond your music collection, an album would be considered
c) Rectangle, rectangle a(n) _____
d) Diamond, rectangle a) Relation
View Answer b) Entity
c) Instance
Answer: d
d) Attribute
Explanation: Diamond represents a relationship set and
View Answer
rectangle represents a entity set.
Answer: b
Sanfoundry Certification Contest of the Month is Live.
Explanation: An entity set is a logical container for
100+ Subjects. Participate Now!
instances of an entity type and instances of any type
6. An entity set that does not have sufficient attributes derived from that entity type.
to form a primary key is termed a __________
10. What term is used to refer to a specific record in
a) Strong entity set
your music database; for instance; information stored
b) Variant set
about a specific album?
c) Weak entity set
a) Relation
d) Variable set
b) Instance
View Answer
c) Table
Page 34 of 139
d) Column an instance. A database instance or an ‘instance’ is
View Answer made up of the background processes needed by the
database.
Answer: b
Explanation: The environment of database is said to be
Page 35 of 139
Database Questions and Answers – Reduction to Relational
Schemas
This set of Database Problems focuses on “Reduction to Relational Schemas”.
Consider the following relational schemas and answer the questions below
1. Which one of the following can be treated as a primary key in teaches relation?
a) Id
b) Semester
c) Sec_id
d) Year
View Answer
Page 36 of 139
Answer: a
Explanation: Here Id is the only attribute that has to have a unique entry.
advertisement
3.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
4.
SELECT Id, Course_id, Building FROM SECTION s AND teaches t WHERE [Link]=2009;
Which of the following Id are displayed?
a) 1003
b) 1001
c) Both 1003 and 1001
d) Error message appears
View Answer
Answer: c
Explanation: Two rows are select in the above query.
5. The query which selects the Course_id ‘CS-101’ from the section relation is
a) Select Course_id from section where Building = ‘Richard’;
b) Select Course_id from section where Year = ‘2009’;
c) Select Course_id from teaches where Building = ‘Packyard’;
Page 37 of 139
d) Select Course_id from section where Sec_id = ‘3’;
View Answer
Answer: b
Explanation: The year ‘2009’ should be selected from the section relation.
6.
9. In the above teaches relation ” Select * from teaches where Year = ‘2010’” displays how many
rows?
a) 2
Page 38 of 139
b) 4
c) 5
d) 1
View Answer
Answer: a
Explanation: There are two tuples with the year is 2009.
10. The relation changes can be got back using ________ command.
a) Flashback
b) Purge
c) Delete
d) Getback
View Answer
Answer: a
Explanation: Purge deletes the table and delete cleans the table entry.
Database Questions and Answers – Entity-Relationship 3. Given the basic ER and relational models, which of
Design Issues the following is INCORRECT?
a) An attribute of an entity can have more than one
This set of Database online test focuses on “Entity-
value
Relationship Design Issues”.
b) An attribute of an entity can be composite
1. Let us consider phone_number ,which can take single c) In a row of a relational table, an attribute can have
or several values . Treating phone_numberas an more than one value
_________ permits instructors to have several phone d) In a row of a relational table, an attribute can have
numbers (including zero) associated with them. exactly one value or a NULL value
a) Entity View Answer
b) Attribute
Answer: c
c) Relation
Explanation: It is possible to have several values for a
d) Value
single attribute provide it is a multi-valued attribute.
View Answer
advertisement
Answer: a
Explanation: Treating a phone as an 4. Which of the following indicates the maximum
attribute phone_number implies that instructors have number of entities that can be involved in a
precisely one phone number each. relationship?
a) Minimum cardinality
2. The total participation by entities is represented in E-
b) Maximum cardinality
R diagram as
c) ERD
a) Dashed line
d) Greater Entity Count
b) Double line
View Answer
c) Double rectangle
d) Circle Answer: b
View Answer Explanation: In SQL (Structured Query Language), the
term cardinality refers to the uniqueness of data values
Answer: b
contained in a particular column (attribute) of a
Explanation: It is used to represent the relation between
database table.
several attributes.
Page 39 of 139
5. In E-R diagram generalization is represented by c) Query
a) Ellipse d) Data dictionary
b) Dashed ellipse View Answer
c) Rectangle
Answer: b
d) Triangle
Explanation: View is a logical portion of a database
View Answer
which is needed by some users.
Answer: d
10. A primary key is combined with a foreign key creates
Explanation: Ellipse represents attributes, rectangle
a) Parent-Child relation ship between the tables that
represents entity.
connect them
Sanfoundry Certification Contest of the Month is Live. b) Many to many relationship between the tables that
100+ Subjects. Participate Now! connect them
c) Network model between the tables that connect
6. What is a relationship called when it is maintained
them
between two entities?
d) None of the mentioned
a) Unary
View Answer
b) Binary
c) Ternary Answer: a
d) Quaternary Explanation: Using the two relationships mother and
View Answer father provides us a record of a child’s mother, even if
we are not aware of the father’s identity; a null value
Answer: b
would be required if the ternary relationship parent is
Explanation: Binary word usually represents two
used. Using binary relationship sets is preferable in this
attributes.
case.
7. Which of the following is a low level operator?
Database Questions and Answers – Extended E-R
a) Insert
Features
b) Update
c) Delete This set of Database Multiple Choice Questions &
d) Directory Answers (MCQs) focuses on “Extended E-R Features”.
View Answer
1. The entity set person is classified as student and
Answer: d employee. This process is called _________
Explanation: Directory is a low level to word on in file a) Generalization
system. b) Specialization
c) Inheritance
8. Key to represent relationship between tables is called
d) Constraint generalization
a) Primary key
View Answer
b) Secondary Key
c) Foreign Key Answer: b
d) None of the mentioned Explanation: The process of designating subgroupings
View Answer within an entity set is called specialization.
advertisement
1. Which is the main relation which is used in the university database which is referenced by all other
relation of the university?
a) Teaches
b) Course
c) Department
d) Section
View Answer
Answer: c
Explanation: Department is the only relation which forms the main part of the university database.
2. The department relation has the an entry budget whose type has to be replaced by
a) Varchar (20)
b) Varchar2 (20)
c) Numeric (12,2)
d) Numeric
View Answer
Answer: c
Explanation: Department is the only relation which forms the main part of the university database.
3. In the course relation, the title field should throw an error in case of any missing title. The
command to be added in title is
a) Unique
b) Not null
c) 0
d) Null
View Answer
Answer: b
Explanation: By specifying not null the value cannot be left blank.
Page 43 of 139
4. In the above DDL command the foreign key entries are got by using the keyword
a) References
b) Key reference
c) Relating
d) None of the mentioned
View Answer
Answer: a
Explanation: References (table_name) give the prior table name for the entry.
(100202,Drake,Biology,30000)
7. Which of the following can be used as a primary key entry of the instructor relation.
a) DEPT_NAME
b) NAME
c) ID
d) All of the mentioned
View Answer
Answer: c
Explanation: The value ID can only be primary key unlike dept_name which is used as a foreign key.
Page 44 of 139
d) Course_id,sec_id,room_number
View Answer
Answer: a
Explanation: Course_id is the only field which is present in the course relation.
9. In order to include an attribute Name to the teaches relation which of the following command is
used?
a) Alter table teaches include Name;
b) Alter table teaches add Name;
c) Alter table teaches add Name varchar;
d) Alter table teaches add Name varchar(20);
View Answer
Answer: d
Explanation: The form of the alter table command is
alter table r add AD;
where r is the name of an existing relation, A is the name of the attribute to be added, and D is the
type of the added attribute.
10. To replace the relation section with some other relation the initial step to be carried out is
a) Delete section;
b) Drop section;
c) Delete from section;
d) Replace section new_table ;
View Answer
Answer: b
Explanation: Droping the table drops all the references to that table.
Page 45 of 139
Course_id Title Dept_name Credits
1. Which of the following command is used to display the departments of the instructor relation?
a) Select * from instructor where Dept_name = Finance;
b) Select * from instructor ;
c) Select dept_name from instructor;
d) Select dept_name for instructor where Name=Jackson;
View Answer
Answer: c
Explanation: Only one field is necessary for the query and where clause is not needed for the
selection.
advertisement
2. How can we select the elements which have common Dept_name in both the relation ?
a) Select * from instructor i , course c where i.Dept_name=c.Dept_name;
b) Select Dept name from instructor ,Course ;
c) Select * from instructor i , course c ;
d) Select Dept_name from instructor where Dept_name = NULL;
View Answer
Answer: a
Explanation: Here only the common elements are displayed .
Page 46 of 139
4. Suppose the Authority want to include a new instructor for the title Neuroscience what command
should be inserted ?
a) Insert into instructor values(12111,Emma,NeuroScience,200000);
b) Insert into course values(12111,Introduction,NeuroScience,2);
c)
5. If a person all the people in Music department gets fired which of the following has to be
performed on the instructor relation ?
a) Delete Dept_name=Music in instructor;
b) Delete from instructor where Dept_name=Music;
c) Remove Dept_name= Music
d) All of the mentioned
View Answer
Answer: b
Explanation: Delete from table_name where condition .
6.
What will be displayed as the value of name for the above query?
a) Hayley
b) Jackson
c) Hayley and Crick
d) Crick
View Answer
Answer: d
Explanation: Only the greatest salary in [Link] dept is selected for the query.
7.
SELECT Name
FROM instructor
WHERE salary > SOME (SELECT salary FROM instructor WHERE dept_name = '[Link].');
Page 47 of 139
How many rows are selected ?
a) 3
b) 4
c) 2
d) 1
View Answer
Answer: d
Explanation: This displays the names of instructors with salary greater than that of some (at least
one) instructor in the Biology department .
SELECT Name
FROM instructor
WHERE Name LIKE ’A%;
b)
SELECT Name
FROM course
WHERE Name LIKE ’A%;
c)
SELECT Dept_name
FROM instructor
WHERE Name LIKE ’A%;
d)
SELECT Name
FROM instructor
WHERE Dept_name LIKE ’A%;
View Answer
Answer: a
Explanation: % is used to indicate that some characters may appear .
Page 48 of 139
d) Count,Dist
View Answer
Answer: a
Explanation: Count (distinct ID) is the correct usage.
10. Which function is used to identify the title with Least scope?
a) Min(Credits)
b) Max(Credits)
c) Min(title)
d) Min(Salary)
View Answer
Answer: a
Explanation: Max is used to find the highest element and Min is used to find the lowest element.
Page 49 of 139
Database Questions and Answers – Atomic Domains It eliminates all redundancy that can be discovered
based on functional dependencies.
This set of Database Multiple Choice Questions &
Answers (MCQs) focuses on “Atomic Domains”. Subscribe Now: DBMS Newsletter | Important Subjects
Newsletters
1. A domain is ______ if elements of the domain are
considered to be indivisible units. 4. Which one is based on multi-valued dependency:
a) Atomic a) First
b) Subatomic b) Second
c) Substructure c) Third
d) Subset d) Fourth
View Answer View Answer
Answer: a Answer: d
Explanation: A set of names is an example of a Explanation: One of the more desirable normal forms
nonatomic value. that we can obtain is Boyce–Codd normal form (BCNF).
It eliminates all redundancy that can be discovered
2. Identify the composite attributes
based on functional dependencies.
a) Salary
b) Credits 5. If a relation is in BCNF, then it is also in
c) Section_id a) 1 NF
d) None of the mentioned b) 2 NF
View Answer c) 3 NF
d) All of the mentioned
Answer: d
View Answer
Explanation: Composite attributes, such as an attribute
address with component attributes street, city, state, Answer: d
and zip have nonatomic domains. Explanation: Third normal form (3NF) relaxes this
constraint slightly by allowing certain nontrivial
3. Consider the relation given below and ind the
functionaldependencieswhose left side is not a
maximum normal form applicable to them
superkey.
advertisement
6. If every non-key attribute is functionally dependent
i. R(A, B) WITH productions { A --> B } primary key, then the relation will be in
a) First normal form
ii. R(A, B) WITH productions { B --> A } b) Second normal form
iii. R(A, B) WITH productions {A —> B, B --> A } c) Third form
d) Fourth normal form
iv. R(A, B, C) WITH productions {A -->B, B --> A, AB --> C View Answer
}
Answer: b
a) i, ii and iii are in 3NF and iv is in BCNF Explanation: Third normal form (3NF) relaxes this
b) i and ii are in BCNF and iii and iv are in 3NF constraint slightly by allowing certain nontrivial
c) All are in 3NF functionaldependencieswhose left side is not a
d) All are in BCNF superkey.
View Answer
7. If an attribute of a composite key is dependent on an
Answer: d attribute of the other composite key, a normalization
Explanation: One of the more desirable normal forms called _____ is needed.
that we can obtain is Boyce–Codd normal form (BCNF). a) DKNF
b) BCNF
Page 50 of 139
c) Fourth b) Second
d) Third c) Third
View Answer d) Fourth
View Answer
Answer: b
Explanation: BCNF eliminates all redundancy that can be Answer: a
discovered based on functional dependencies. Explanation: The first normal form is used to eliminate
the duplicate information.
8. The term for information that describes what type of
data is available in a database is: 2. A table on the many side of a one to many or many to
a) Data dictionary many relationship must:
b) data repository a) Be in Second Normal Form (2NF)
c) Index data b) Be in Third Normal Form (3NF)
d) Metadata c) Have a single attribute key
View Answer d) Have a composite key
View Answer
Answer: d
Explanation: Meta data is generally data about a data. Answer: d
Explanation: The relation in second normal form is also
9. A data type that creates unique numbers for key
in first normal form and no partial dependencies on any
columns in Microsoft Access is:
column in primary key.
a) Autonumber
b) Boolean 3. Tables in second normal form (2NF):
c) Sequential key a) Eliminate all hidden dependencies
d) Sequential number b) Eliminate the possibility of a insertion anomalies
View Answer c) Have a composite key
d) Have all non key fields depend on the whole primary
Answer: a
key
Explanation: This can be taken as a primary key.
View Answer
10. A dependency exist between two columns when
Answer: a
a) Together they constitute a composite key for the
Explanation: The relation in second normal form is also
table
in first normal form and no partial dependencies on any
b) Knowing the value in one column determines the
column in primary key.
value stored in another column
c) The table is in 3NF advertisement
d) Together they constitute a foreign key
4. Which-one ofthe following statements about normal
View Answer
forms is FALSE?
Answer: a a) BCNF is stricter than 3 NF
Explanation: Given a set F of functional dependencies b) Lossless, dependency -preserving decomposition into
on a schema, we can prove that certain other functional 3 NF is always possible
dependencies also hold on the schema. c) Loss less, dependency – preserving decomposition
into BCNF is always possible
Database Questions & Answers – Normal Forms
d) Any relation with two attributes is BCNF
This set of Database Multiple Choice Questions & View Answer
Answers (MCQs) focuses on “Normal Forms”.
Answer: c
1. In the __________ normal form, a composite Explanation: We say that the decomposition is a lossless
attribute is converted to individual attributes. decomposition if there is no loss of information by
a) First
Page 51 of 139
replacing r (R) with two relation schemas r1(R1) Answer: c
andr2(R2). Explanation: A Table is in 4NF if and only if, for every one
of its non-trivial multivalued dependencies X
5. Functional Dependencies are the types of constraints
\twoheadrightarrow Y, X is a superkey—that is, X is
that are based on______
either a candidate key or a superset thereof.
a) Key
b) Key revisited 9. Which forms are based on the concept of functional
c) Superset key dependency:
d) None of the mentioned a) 1NF
View Answer b) 2NF
c) 3NF
Answer: a
d) 4NF
Explanation: Key is the basic element needed for the
View Answer
constraints.
Answer: c
Subscribe Now: DBMS Newsletter | Important Subjects
Explanation: The table is in 3NF if every non-prime
Newsletters
attribute of R is non-transitively dependent (i.e. directly
6. Which is a bottom-up approach to database design dependent) on every superkey of R.
that design by examining the relationship between
10.
attributes:
a) Functional dependency Empdt1(empcode, name, street, city, state, pincode).
b) Database modeling
For any pincode, there is only one city and state. Also,
c) Normalization
for given street, city and state, there is just one pincode.
d) Decomposition
In normalization terms, empdt1 is a relation in
View Answer
a) 1 NF only
Answer: c b) 2 NF and hence also in 1 NF
Explanation: Normalisation is the process of removing c) 3NF and hence also in 2NF and 1NF
redundancy and unwanted data. d) BCNF and hence also in 3NF, 2NF and 1NF
View Answer
7. Which forms simplifies and ensures that there are
minimal data aggregates and repetitive groups: Answer: b
a) 1NF Explanation: The relation in second normal form is also
b) 2NF in first normal form and no partial dependencies on any
c) 3NF column in primary key.
d) All of the mentioned
Database Questions and Answers – Functional-
View Answer
Dependency Theory
Answer: c
This set of Database Multiple Choice Questions &
Explanation: The first normal form is used to eliminate
Answers (MCQs) focuses on “Functional-Dependency
the duplicate information.
Theory”.
8. Which forms has a relation that possesses data about
1. We can use the following three rules to find logically
an individual entity:
implied functional dependencies. This collection of rules
a) 2NF
is called
b) 3NF
a) Axioms
c) 4NF
b) Armstrong’s axioms
d) 5NF
c) Armstrong
View Answer
Page 52 of 139
d) Closure d) Both Lossy and Lossy-join decomposition
View Answer View Answer
Answer: b Answer: d
Explanation: By applying these rules repeatedly, we can Explanation: Lossy-join decomposition is the
find all of F+, given F. decomposition used here .
2. Which of the following is not Armstrong’s Axiom? 5. There are two functional dependencies with the same
a) Reflexivity rule set of attributes on the left side of the arrow:
b) Transitivity rule A->BC
c) Pseudotransitivity rule A->B
d) Augmentation rule This can be combined as
View Answer a) A->BC
b) A->B
Answer: c
c) B->C
Explanation: It is possible to use Armstrong’s axioms to
d) None of the mentioned
prove that Pseudotransitivity rule is sound.
View Answer
3. The relation
Answer: a
employee(ID,name,street,Credit,street,city,salary) is
Explanation: This can be computed as the canonical
decomposed into
cover.
advertisement
6. Consider a relation R(A,B,C,D,E) with the following
employee1 (ID, name) functional dependencies:
4. Inst_dept (ID, name, salary, dept name, building, 7. Suppose we wish to find the ID’s of the employees
budget) is decomposed into that are managed by people who are managed by the
employee with ID 123. Here are two possible queries:
instructor (ID, name, dept name, salary)
[Link] [Link]
department (dept name, building, budget)
FROM Emps ee, Emps ff
This comes under
a) Lossy-join decomposition WHERE [Link] = [Link] AND [Link] = 123;
b) Lossy decomposition
[Link] empID
c) Lossless-join decomposition
FROM Emps
Page 53 of 139
WHERE mgrID IN Answer: d
Explanation: The value of m must lie between the min
(SELECT empID FROM Emps WHERE mgrID = 123);
value of r and s and 0.
Which, if any, of the two queries above will correctly (in
10. Suppose relation R(A,B,C,D,E) has the following
SQL2) get the desired set of employee ID’s?
functional dependencies:
a) Both I and II
b) I only A -> B
c) II only
B -> C
d) Neither I nor I
View Answer BC -> A
Answer: a A -> D
Explanation: The query can be satisfied by any of the
two options. E -> A
Page 54 of 139
2. What are the desirable properties of a decomposition Answer: a
a) Partition constraint Explanation: Here course id is not a superkey. Thus, class
b) Dependency preservation is not in BCNF.
c) Redundancy
Subscribe Now: DBMS Newsletter | Important Subjects
d) Security
Newsletters
View Answer
5. The algorithm that takes a set of dependencies and
Answer: b
adds one schema at a time, instead of decomposing the
Explanation: Lossless join and dependency preserving
initial schema repeatedly is
are the two goals of the decomposition.
a) BCNF algorithm
3. R (A,B,C,D) is a relation. Which of the following does b) 2NF algorithm
not have a lossless join dependency preserving BCNF c) 3NF synthesis algorithm
decomposition? d) 1NF algorithm
a) A->B, B->CD View Answer
b) A->B, B->C, C->D
Answer: c
c) AB->C, C->AD
Explanation: The result is not uniquely defined, since a
d) A->BCD
set of functional dependencies can have more than one
View Answer
canonical cover, and, further, in some cases, the result
Answer: d of the algorithm depends on the order in which it
Explanation: This relation gives a relation without any considers the dependencies in Fc.
loss in the values.
6. The functional dependency can be tested easily on
advertisement the materialized view, using the constraints
____________.
4.
a) Primary key
Class (course id, title, dept name, credits, sec id, b) Null
semester, YEAR, building, room NUMBER, capacity, c) Unique
TIME slot id) d) Both Null and Unique
View Answer
The SET OF functional dependencies that we require TO
hold ON class are: Answer: d
Explanation: Primary key contains both unique and not
course id->title, dept name, credits null constraints.
building, room number->capacity 7. Which normal form is considered adequate for
course id, sec id, semester, year->building, room normal relational database design?
NUMBER, TIME slot id a) 2NF
b) 5NF
A candidate KEY FOR this schema IS {course id, sec id, c) 4NF
semester, YEAR} d) 3NF
Consider the above conditions. Which of the following View Answer
relation holds? Answer: d
a) Course id-> title, dept name, credits Explanation: A relational database table is often
b) Title-> dept name, credits described as “normalized” if it is in the Third Normal
c) Dept name-> credits Form because most of the 3NF tables are free of
d) Cannot be determined insertion, update, and deletion anomalies.
View Answer
Page 55 of 139
8. Relation R with an associated set of functional b) in 3NF, but not in BCNF
dependencies, F, is decomposed into BCNF. The c) in 2NF, but not in 3NF
redundancy (arising out of functional dependencies) in d) not in 2NF
the resulting set of relations is View Answer
a) Zero
Answer: d
b) More than zero but less than that of an equivalent
Explanation: From the closure set of attributes we can
3NF decomposition
see that the key for the relation is AB. The FD B->G is a
c) Proportional to the size of F+
partial dependency, hence it is not in 2NF.
d) Indeterminate
View Answer Database Questions and Answers – Multivalued
Dependencies
Answer: b
Explanation: Redundancy in BCNF is low when This set of Database online quiz focuses on “Using
compared to 3NF. For more details on BCNF. Multivalued Dependencies”.
9. A table has fields F1, F2, F3, F4, and F5, with the 1. The normal form which satisfies multivalued
following functional dependencies: dependencies and which is in BCNF is
a) 4 NF
F1->F3
b) 3 NF
F2->F4 c) 2 NF
d) All of the mentioned
(F1,F2)->F5
View Answer
in terms of normalization, this table is in
Answer: a
a) 1NF
Explanation: Fourth normal form is more restrictive than
b) 2NF
BCNF.
c) 3NF
d) None of the mentioned 2. Which of the following is a tuple-generating
View Answer dependencies?
a) Functional dependency
Answer: a
b) Equality-generating dependencies
Explanation: Since the primary key is not given we have
c) Multivalued dependencies
to derive the primary key of the table. Using the closure
d) Non-functional dependency
set of attributes we get the primary key as (F1, F2). From
View Answer
functional dependencies, “F1->F3, F2->F4”, we can see
that there is partial functional dependency therefore it Answer: c
is not in 1NF. Hence the table is in 1NF. Explanation: Multivalued dependencies, do not rule out
the existence of certain tuples. Instead, they require
10. Let R(A,B,C,D,E,P,G) be a relational schema in which
that other tuples of a certain form be present in the
the following FDs are known to hold:
relation.
AB->CD
3. The main task carried out in the __________ is to
DE->P remove repeating attributes to separate tables.
a) First Normal Form
C->E b) Second Normal Form
P->C c) Third Normal Form
d) Fourth Normal Form
B->G View Answer
The relation schema R is
a) in BCNF
Page 56 of 139
Answer: a related entity set has its own schema and there is an
Explanation: Multivalued dependencies, do not rule out additional schema for the relationship set. For a
the existence of certain tuples. Instead, they require multivalued attribute, a separate schema is created
that other tuples of a certain form be present in the consisting of that attribute and the primary key of the
relation. entity set.
advertisement 7. Which of the following has each related entity set has
its own schema and there is an additional schema for
4. Which of the normal form is based on multivalued
the relationship set?
dependencies?
a) A many-to-many relationship set
a) First
b) A multivalued attribute of an entity set
b) Second
c) A one-to-many relationship set
c) Third
d) None of the mentioned
d) Fourth
View Answer
View Answer
Answer: a
Answer: d
Explanation: If a multivalued dependency holds and is
Explanation: Multivalued dependencies, do not rule out
not implied by the corresponding functional
the existence of certain tuples. Instead, they require
dependency, it usually arises from this source.
that other tuples of a certain form be present in the
relation. 8. In which of the following, a separate schema is
created consisting of that attribute and the primary key
5. Which forms has a relation that possesses data about
of the entity set.
an individual entity?
a) A many-to-many relationship set
a) 2NF
b) A multivalued attribute of an entity set
b) 3NF
c) A one-to-many relationship set
c) 4NF
d) None of the mentioned
d) 5NF
View Answer
View Answer
Answer: b
Answer: c
Explanation: If a multivalued dependency holds and is
Explanation: A Table is in 4NF if and only if, for every one
not implied by the corresponding functional
of its non-trivial multivalued dependencies X
dependency, it usually arises from this source.
\twoheadrightarrow Y, X is a superkey—that is, X is
either a candidate key or a superset thereof. 9. Fifth Normal form is concerned with
a) Functional dependency
Note: Join free Sanfoundry classes
b) Multivalued dependency
at Telegram or Youtube
c) Join dependency
6. If a multivalued dependency holds and is not implied d) Domain-key
by the corresponding functional dependency, it usually View Answer
arises from one of the following sources.
Answer: c
a) A many-to-many relationship set
Explanation: If a multivalued dependency holds and is
b) A multivalued attribute of an entity set
not implied by the corresponding functional
c) A one-to-many relationship set
dependency, it usually arises from this source.
d) Both A many-to-many relationship set and A
multivalued attribute of an entity set 10. In 2NF
View Answer a) No functional dependencies (FDs) exist
b) No multivalued dependencies (MVDs) exist
Answer: d
c) No partial FDs exist
Explanation: For a many-to-many relationship set each
Page 57 of 139
d) No partial MVDs exist d) All of the mentioned
View Answer View Answer
Answer: c Answer: a
Explanation: If a multivalued dependency holds and is Explanation: If a multivalued dependency holds and is
not implied by the corresponding functional not implied by the corresponding functional
dependency, it usually arises from this source. dependency, it usually arises from this source.
Page 58 of 139
7. Designers use which of the following to tune the 11. Representations such as the in the dept year
performance of systems to support time-critical relation, with one column for each value of an attribute,
operations? are called _______ they are widely used in spreadsheets
a) Denormalization and reports and in data analysis tools.
b) Redundant optimization a) Cross-tabs
c) Optimization b) Snapshot
d) Realization c) Both Cross-tabs and Snapshot
View Answer d) All of the mentioned
View Answer
Answer: a
Explanation: The process of taking a normalized schema Answer: a
and making it nonnormalized is called denormalization. Explanation: SQL includes features to convert data from
a normal relational representation to a crosstab.
8. In the schema (dept name, size) we have
relations total inst 2007, total inst 2008. Which Database Questions and Answers – Application
dependency have lead to this relation ? Programs and User Interfaces
a) Dept name, year->size
This set of Database Assessment Questions and Answers
b) Year->size
focuses on “Application Programs and User Interfaces”.
c) Dept name->size
d) Size->year 1. An approach to website design with the emphasis on
View Answer converting visitors to outcomes required by the owner is
referred to as:
Answer: a
a) Web usability
Explanation: The process of taking a normalized schema
b) Persuasion
and making it nonnormalized is called denormalization.
c) Web accessibility
9. Relation dept year(dept name, total inst 2007, total d) None of the mentioned
inst 2008, total inst 2009). Here the only functional View Answer
dependencies are from dept name to the other
Answer: b
attributes. This relation is in
Explanation: In computing, graphical user interface is a
a) Fourth NF
type of user interface that allows users to interact with
b) BCNF
electronic devices.
c) Third NF
d) Second NF 2. A method of modelling and describing user tasks for
View Answer an interactive application is referred to as:
a) Customer journey
Answer: b
b) Primary persona
Explanation: BCNF has only one normal form.
c) Use case
10. Thus a _______ of course data gives the values of all d) Web design persona
attributes, such as title and department, of all courses at View Answer
a particular point in time.
Answer: c
a) Instance
Explanation: The actions in GUI are usually performed
b) Snapshot
through direct manipulation of the graphical elements.
c) Both Instance and Snapshot
d) All of the mentioned 3. Information architecture influences:
View Answer a) Answer choice
b) Site structure
Answer: b
c) Labeling
Explanation: We use the term snapshot of data to mean
the value of the data at a particular point in time.
Page 59 of 139
d) Navigation design drawing, documenting an architecture or an engineering
View Answer design, using a contact print process.
7. Which of the following is not true about HTML ? 1. The Java __________ specification defines an
a) <meta>…</meta> application programming interface for communication
b) <meta…./> between the Web server and the application program.
c) <metadata>…</metadata> a) Servlet
d) <metadata name=”” /> b) Server
View Answer c) Program
d) Randomize
Answer: b
View Answer
Explanation: Meta data is the data about data which is
included in the meta data tag. Answer: a
Explanation: Servlets are commonly used to generate
8. Html code contains:
dynamic responses to HTTP requests.
a) Tags
b) Attributes 2. The doGet() method in the example extracts values of
c) Elements the parameter’s type and number by using __________
d) All of the mentioned a) [Link]()
View Answer b) [Link]()
c) [Link]()
Answer: d
d) [Link]()
Explanation: <> are tags,size is a attribute.
View Answer
9. Html document must always be saved with:
Answer: a
a) .html
Explanation: These methods uses these values to run a
b) .htm
query against a database.
c) .doc
d) Both .html & .htm 3. How many JDBC driver types does Sun define?
View Answer a) One
b) Two
Answer: d
c) Three
Explanation: .doc is used only for the word document
d) Four
format.
View Answer
10. How many levels of headings are in html:
Answer: d
a) 2
Explanation: [Link]() is
b) 7
used to get the connection to the database.
c) 6
d) 4 advertisement
View Answer
4. Which JDBC driver Type(s) can be used in either
Answer: c applet or servlet code?
Explanation: The heading levels are h1,h2,h3,h4,h5,h6. a) Both Type 1 and Type 2
b) Both Type 1 and Type 3
c) Both Type 3 and Type 4
d) Type 4 only
View Answer
Answer: c
Database Questions and Answers – Servlets and JSP Explanation: In a Type 3 driver, a three-tier approach is
Page 62 of 139
used to accessing databases. The JDBC clients use d) All of the mentioned
standard network sockets to communicate with an View Answer
middleware application server. In a Type 4 driver, a pure
Answer: c
Java-based driver that communicates directly with
Explanation: JSP primarily uses Java for certain codes.
vendor’s database through socket connection.
9. What is bytecode?
5. What MySQL property is used to create a surrogate
a) Machine-specific code
key in MySQL?
b) Java code
a) UNIQUE
c) Machine-independent code
b) SEQUENCE
d) None of the mentioned
c) AUTO_INCREMENT
View Answer
d) None of the mentioned
View Answer Answer: c
Explanation: Java bytecode is the form of instructions
Answer: c
that the Java virtual machine executes. Each bytecode
Explanation: A surrogate key in a database is a unique
opcode is one byte in length, although some require
identifier for either an entity in the modeled world or an
parameters, resulting in some multi-byte instructions.
object in the database.
10. Where is metadata stored in MySQL?
Sanfoundry Certification Contest of the Month is Live.
a) In the MySQL database metadata
100+ Subjects. Participate Now!
b) In the MySQL database metasql
6. A JSP is transformed into a(n): c) In the MySQL database mysql
a) Java applet d) None of the mentioned
b) Java servlet View Answer
c) Either 1 or 2 above
Answer: c
d) Neither 1 nor 2 above
Explanation: Metadata contains data about other data
View Answer
which is given in the <meta>…</meta> tags.
Answer: b
Database Questions and Answers – Application
Explanation: Servlets are commonly used to generate
Architectures
dynamic responses to HTTP requests.
This set of Database Multiple Choice Questions &
7. Which JDBC driver Type(s) is(are) the JDBC-ODBC
Answers (MCQs) focuses on “Application Architectures”.
bridge?
a) Type 1 1. Which of the following is true for Seeheim model?
b) Type 2 a) Presentation is abstracted from dialogue and
c) Type 3 Application
d) Type 4 b) Presentation and Dialogue is abstracted from
View Answer Application
c) Presentation and Application is abstracted from
Answer: a
Dialogue
Explanation: In a Type 1 driver, a JDBC bridge is used to
d) None of the mentioned
access ODBC drivers installed on each client machine.
View Answer
8. What programming language(s) or scripting
Answer: a
language(s) does Java Server Pages (JSP) support?
Explanation: Presentation is abstracted from dialogue
a) VBScript only
and application.
b) Jscript only
c) Java only 2. Which of the unit operation is used in Model view
controller?
Page 63 of 139
a) Is a Decomposition interfaces of mobile phones, which have much smaller
b) Part Whole Decomposition screens.
c) All of the mentioned
Subscribe Now: DBMS Newsletter | Important Subjects
d) None of the mentioned
Newsletters
View Answer
6. The ______________ layer, which provides the
Answer: b
interface between the business-logic layer and the
Explanation: Part whole decomposition is applied to
underlying database.
MVC.
a) Business logic
3. Memory address refers to the successive memory b) Presentation
words and the machine is called as _______________ c) User interaction
a) word addressable d) Data access
b) byte addressable View Answer
c) bit addressable
Answer: d
d) Terra byte addressable
Explanation: Many applications use an object-oriented
View Answer
language to code the business-logic layer, and use an
Answer: a object-oriented model of data, while the underlying
Explanation: Part whole decomposition is applied to database is a relational database.
MVC.
7. The _____________ system is widely used for
advertisement mapping from Java objects to relations.
a) Hibernate
4. Which layer deals which deals with user interaction is
b) Object oriented
called _____________ layer.
c) Objective
a) Business logic
d) None of the mentioned
b) Presentation
View Answer
c) User interaction
d) Data access Answer: a
View Answer Explanation: In Hibernate, the mapping from each Java
class to one or more relations is specified in a mapping
Answer: b
file.
Explanation: The single application may have several
different versions of this layer, corresponding to distinct 8. Which among the following are the functions that any
kinds of interfaces such as Web browsers, and user system with a user interface must provide?
interfaces of mobile phones, which have much smaller a) Presentation
screens. b) Dialogue
c) All of the mentioned
5. The _____________ layer, which provides a high-level
d) None of the mentioned
view of data and actions on data.
View Answer
a) Business logic
b) Presentation Answer: a
c) User interaction Explanation: Presentation and Application are the
d) Data access functions that any system with a user interface must
View Answer provide.
Page 65 of 139
Answer: a group by job having sum(sal) > 2500;
Explanation: SELECT column_name,column_name c) select job, sum(sal) from emp where sum(sal) > 2500
FROM table_name and comm is null group by job;
ORDER BY column_name,column_name ASC|DESC;. d) select job, sum(sal) from emp group by job having
sum(sal) > 2500 and comm is not null;
7. Which of the following rule below are categories of
View Answer
an index?
a) Column and Functional Answer: b
b) Multiple Column and functional Explanation: For aggregate functions group by clause is
c) Column, Multiple Column and functional necessary.
d) None of the mentioned
View Answer
Database Questions and Answers – Application
Answer: a
Performance
Explanation: The CREATE INDEX statement is used to
create indexes in tables. This set of Database Multiple Choice Questions &
Answers (MCQs) focuses on “Application Performance”.
8. What is the purpose of SMON background process?
a) Performs crash recovery when a failed instance starts 1. The indirect change of the values of a variable in one
up again module by another module is called
b) Performs recovery when a user process fails a) Internal change
c) Writes redo log entries to disk b) Inter-module change
d) None of the mentioned c) Side effect
View Answer d) Side-module update
View Answer
Answer: a
Explanation: SMON (System MONitor) is an Oracle Answer: c
background process created when you start a database Explanation: The module of the search tree and the flow
instance. is directed by its values.
9. Which of the following queries are legal? 2. Which of the following data structure is not linear
a) SELECT deptno, count(deptno) FROM emp GROUP BY data structure?
ename; a) Arrays
b) SELECT deptno, count(deptno), job FROM emp b) Linked lists
GROUP BY deptno; c) Arrays & Linked lists
c) SELECT deptno, avg(sal) FROM emp; d) None of the mentioned
d) SELECT deptno, avg(sal) FROM emp GROUP BY View Answer
deptno;
View Answer Answer: d
Explanation: Both array and linked lists are in data
Answer: d structure concepts.
Explanation: For aggregate functions group by clause is
necessary. 3. Which of the following data structure is linear data
structure?
10. Which of the following queries displays the sum of a) Trees
all employee salaries for those employees not making b) Graphs
commission, for each job, including only those sums c) Arrays
greater than 2500? d) None of the mentioned
a) select job, sum(sal) from emp where sum(sal) > 2500 View Answer
and comm is null;
b) select job, sum(sal) from emp where comm is null
Page 66 of 139
Answer: c Answer: a
Explanation: Tree and graphs are not linear. Explanation: The operator tree has a tree like format
where the evaluation starts from root of the tree.
advertisement
8. Linked lists are best suited
4. Which of the following criterion is NOT written using
a) For relatively permanent collections of data
the proper syntax?
b) For the size of the structure and the data in the
a) “Haris”
structure are constantly changing
b) <500
c) All of the mentioned
c) NO VALUE
d) None of the mentioned
d) Between #1/1/2000# and #12/31/2000#
View Answer
View Answer
Answer: b
Answer: c
Explanation: A linked list is a data structure consisting of
Explanation: NO VALUE cannot be specified.
a group of nodes which together represent a sequence.
5. The operation of processing each element in the list is
9. Each array declaration need not give, implicitly or
known as
explicitly, the information about
a) Sorting
a) The name of array
b) Merging
b) The data type of array
c) Inserting
c) The first data from the set to be stored
d) Traversal
d) The index set of the array
View Answer
View Answer
Answer: d
Answer: c
Explanation: There are several types of traversals.
Explanation: The operator tree has a tree like format
Sanfoundry Certification Contest of the Month is Live. where the evaluation starts from root of the tree.
100+ Subjects. Participate Now!
10. The elements of an array are stored successively in
6. Finding the location of the element with a given value memory cells because
is: a) By this way computer can keep track only the address
a) Traversal of the first element and the addresses of other elements
b) Search can be calculated
c) Sort b) The architecture of computer memory does not allow
d) None of the mentioned arrays to store other than serially
View Answer c) All of the mentioned
d) None of the mentioned
Answer: b View Answer
Explanation: Search is performed by traversing through
the tree. Answer: a
Explanation: Memory is always allotted in order.
7. Arrays are best data structures
a) For relatively permanent collections of data Database Questions and Answers – Application
b) For the size of the structure and the data in the Security
structure are constantly changing
This set of Database Multiple Choice Questions &
c) All of the mentioned
Answers (MCQs) focuses on “Application Security”.
d) None of the mentioned
View Answer 1. In _________________ attacks, the attacker manages
to get an application to execute an SQL query created by
the attacker.
Page 67 of 139
a) SQL injection Answer: a
b) SQL Explanation: The two factors should not share a
c) Direct common vulnerability.
d) Application
5. Even with two-factor authentication, users may still
View Answer
be vulnerable to_____________attacks.
Answer: a a) Radiant
Explanation: Application security has to deal with b) Cross attack
several security threats and issues beyond those c) scripting
handled by SQL authorization. d) Man-in-the-middle
View Answer
2. A Web site that allows users to enter text, such as a
comment or a name, and then stores it and later display Answer: d
it to other users, is potentially vulnerable to a kind of Explanation: In such attacks, a user attempting to
attack called a ___________________ attack. connect to the application is diverted to a fake Web site,
a) Two-factor authentication which accepts the password from the user, and uses it
b) Cross-site request forgery immediately to authenticate to the original application.
c) Cross-site scripting
Sanfoundry Certification Contest of the Month is Live.
d) Cross-site scoring scripting
100+ Subjects. Participate Now!
View Answer
6. A single ______________ further allows the user to
Answer: c
be authenticated once, and multiple applications can
Explanation: In such an attack, a malicious user enters
then verify the user’s identity through an authentication
code written in a client-side scripting language such as
service without requiring reauthentication.
JavaScript or Flash instead of entering a valid name or
a) OpenID
comment.
b) Sign-on system
3. _________ is an attack which forces an end user to c) Security Assertion Markup Language (SAML)
execute unwanted actions on a web application in which d) Virtual Private Database (VPD)
he/she is currently authenticated. View Answer
a) Two-factor authentication
Answer: b
b) Cross-site request forgery
Explanation: Once the user logged in at one site, he
c) Cross-site scripting
does not have to enter his user name and password at
d) Cross-site scoring scripting
other sites that use the same single sign-on service.
View Answer
7. The ___________________ is a standard for
Answer: b
exchanging authentication and authorization
Explanation: Cross-site request forgery, also known as a
information between different security domains, to
one-click attack or session riding and abbreviated as
provide cross-organization single sign-on.
CSRF or XSRF.
a) OpenID
advertisement b) Sign-on system
c) Security Assertion Markup Language (SAML)
4. Many applications use _________________ where
d) Virtual Private Database (VPD)
two independent factors are used to identify a user.
View Answer
a) Two-factor authentication
b) Cross-site request forgery Answer: c
c) Cross-site scripting Explanation: The user’s password and other
d) Cross-site scoring scripting authentication factors are never revealed to the
View Answer application, and the user need not register explicitly
with the application.
Page 68 of 139
8. The __________ standard is an alternative for single 1. ___________ is widely used today for protecting data
sign-on across organizations, and has seen increasing in transit in a variety of applications such as data
acceptance in recent years. transfer on the Internet, and on cellular phone
a) OpenID networks.
b) Single-site system a) Encryption
c) Security Assertion Markup Language (SAML) b) Data mining
d) Virtual Private Database (VPD) c) Internet Security
View Answer d) Architectural security
View Answer
Answer: a
Explanation: The user’s password and other Answer: a
authentication factors are never revealed to the Explanation: Encryption is also used to carry out other
application, and the user need not register explicitly tasks, such as authentication.
with the application.
2. In a database where the encryption is applied the
9. _______________ allows a system administrator to data is cannot be handled by the unauthorised user
associate a function with a relation; the function returns without
a predicate that must be added to any query that uses a) Encryption key
the relation. b) Decryption key
a) OpenID c) Primary key
b) Single-site system d) Authorised key
c) Security Assertion Markup Language (SAML) View Answer
d) Virtual Private Database (VPD)
Answer: b
View Answer
Explanation: Even if the message is intercepted by an
Answer: d enemy, the enemy, not knowing the key, will not be able
Explanation: Some database systems provide to decrypt and understand the message.
mechanisms for fine-grained authorization.
3. Which of the following is not a property of good
10. VPD provides authorization at the level of specific encryption technique?
tuples, or rows, of a relation, and is therefore said to be a) Relatively simple for authorized users to encrypt and
a _____________ mechanism. decrypt data
a) Row-level authorization b) Decryption key is extremely difficult for an intruder to
b) Column-level authentication determine
c) Row-type authentication c) Encryption depends on a parameter of the algorithm
d) Authorization security called the encryption key
View Answer d) None of the mentioned
View Answer
Answer: a
Explanation: Oracle Virtual Private Database (VPD) Answer: d
allows a system administrator to associate a function Explanation: Here a, b and c are the properties have to
with a relation. be present in a good design of an encryption technique.
Page 69 of 139
d) Asymmetric key authenticity of the user by decrypting the string with
View Answer the same secret password and checking the result with
the original challenge string.
Answer: c
Explanation: In public-key (also known as asymmetric- 8. Assymmetric Encryption: Why can a message
key) encryption techniques, there are two different keys, encrypted with the Public Key only be decrypted with
the public key and the private key, used to encrypt and the receiver’s appropriate Private Key?
decrypt the data. a) Not true, the message can also be decrypted with the
Public Key
5. Encryption of small values, such as identifiers or
b) A so called “one way function with back door” is
names, is made complicated by the possibility of
applied for the encryption
__________
c) The Public Key contains a special function which is
a) Dictionary attacks
used to encrypt the message and which can only be
b) Database attacks
reversed by the appropriate Private Key
c) Minor attacks
d) The encrypted message contains the function for
d) Random attacks
decryption which identifies the Private Key
View Answer
View Answer
Answer: a
Answer: b
Explanation: This happens when particularly if the
Explanation: An one-way function is a function which a
encryption key is publicly available.
computer can calculate quickly, but whose reversal
Sanfoundry Certification Contest of the Month is Live. would last months or years. An one-way function with
100+ Subjects. Participate Now! back door can be reversed with the help of a couple of
additional information (the back door), but scarcely
6. Which one of the following uses a 128bit round key to without this information. The information for the back
encrypt the data using XOR and use it in reverse to door is contained in the private Key.
decrypt it?
a) Round key algorithm 9. Which is the largest disadvantage of symmetric
b) Public key algorithm Encryption?
c) Advanced Encryption Standard a) More complex and therefore more time-consuming
d) Asymmetric key algorithm calculations
View Answer b) Problem of the secure transmission of the Secret Key
c) Less secure encryption function
Answer: c d) Isn’t used any more
Explanation: The standard is based on the Rijndael View Answer
algorithm.
Answer: b
7. Which of the following requires no password travel Explanation: As there is only one key in the symmetrical
across the internet? encryption, this must be known by both sender and
a) Readable system recipient and this key is sufficient to decrypt the secret
b) Manipulation system message. Therefore it must be exchanged between
c) Challenge–response system sender and receiver in such a manner that an
d) Response system unauthorized person can in no case take possession of
View Answer it.
Answer: c 10. Which is the principle of the encryption using a key?
Explanation: The database system sends a challenge a) The key indicates which function is used for
string to the user. The user encrypts the challenge string encryption. Thereby it is more difficult to decrypt an
using a secret password as encryption key and then intercepted message as the function is unknown
returns the result. The database system can verify the b) The key contains the secret function for encryption
Page 70 of 139
including parameters. Only a password can activate the 3. Which of the following stores several gigabytes of
key data but usually lost when power failure?
c) All functions are public, only the key is secret. It a) Flash memory
contains the parameters used for the encryption resp. b) Disk
decryption c) Main memory
d) The key prevents the user of having to reinstall the d) Secondary memory
software at each change in technology or in the View Answer
functions for encryption
Answer: c
View Answer
Explanation: The contents of main memory are usually
Answer: b lost if a power failure or system crash occurs.
Explanation: The encoding of a message is calculated by
advertisement
an algorithm. If always the same algorithm would be
used, it would be easy to crack intercepted messages. 4. The flash memory storage used are
However, it isn’t possible to invent a new algorithm a) NOR Flash
whenever the old one was cracked, therefore the b) OR Flash
possibility to parameterize algorithms is needed and this c) AND Flash
is the assignment of the key. d) All of the mentioned
View Answer
Database Questions and Answers – Physical Storage
Media Answer: a
Explanation: NAND flash has a much higher storage
This set of Database Multiple Choice Questions &
capacity for a given cost, and is widely used for data
Answers (MCQs) focuses on “Physical Storage Media”.
storage in devices such as cameras, music players, and
1. Which of the following is a physical storage media? cell phones.
a) Tape Storage
5. __________ is increasingly being used in server
b) Optical Storage
systems to improve performance by caching frequently
c) Flash memory
used data, since it provides faster access than disk, with
d) All of the mentioned
larger storage capacity than main memory.
View Answer
a) Flash memory
Answer: d b) Disk
Explanation: The storage media are classified by the c) Main memory
speed with which data can be accessed, by the cost per d) Secondary memory
unit of data to buy the medium, and by the medium’s View Answer
reliability.
Answer: a
2. The _________ is the fastest and most costly form of Explanation: Flash memory is of two types – NAND and
storage, which is relatively small; its use is managed by NOR.
the computer system hardware.
Note: Join free Sanfoundry classes
a) Cache
at Telegram or Youtube
b) Disk
c) Main memory 6. Which is the cheapest memory device in terms of
d) Flash memory costs/ bit?
View Answer a) Semiconductor memory
b) Magnetic disks
Answer: a
c) Compact disks
Explanation: Cache storage is easy to access because it is
d) Magnetic tapes
closer to the processor.
View Answer
Page 71 of 139
Answer: c Answer: c
Explanation: Compact disk is used for easy storage at Explanation: Tape storage is used primarily for backup
lower cost. and archival data.
7. The primary medium for the long-term online storage Database Questions and Answers – Magnetic Disk and
of data is the __________ where the entire database is Flash Storage
stored on magnetic disk.
This set of Database Multiple Choice Questions &
a) Semiconductor memory
Answers (MCQs) focuses on “Magnetic Disk and Flash
b) Magnetic disks
Storage”.
c) Compact disks
d) Magnetic tapes 1. In magnetic disk ________ stores information on a
View Answer sector magnetically as reversals of the direction of
magnetization of the magnetic material.
Answer: b
a) Read–write head
Explanation: The system must move the data from disk
b) Read-assemble head
to main memory so that they can be accessed.
c) Head–disk assemblies
8. Optical disk _______ systems contain a few drives and d) Disk arm
numerous disks that can be loaded into one of the View Answer
drives automatically (by a robot arm) on demand.
Answer: d
a) Tape Storage
Explanation: Each side of a platter of a disk has a read–
b) Jukebox
write head that moves across the platter to access
c) Flash memory
different tracks.
d) All of the mentioned
View Answer 2. A __________ is the smallest unit of information that
can be read from or written to the disk.
Answer: b
a) Track
Explanation: The most popular form of optical disks are
b) Spindle
CD and DVD.
c) Sector
9. There are “record-once” versions of the compact disk d) Platter
and digital video disk, which can be written only once; View Answer
such disks are also called __________ disks.
Answer: c
a) Write-once, read-many (WORM)
Explanation: The disk surface is logically divided into
b) CD-R
tracks, which are subdivided into sectors.
c) DVD-W
d) CD-ROM 3. The disk platters mounted on a spindle and the heads
View Answer mounted on a disk arm are together known as
___________
Answer: a
a) Read-disk assemblies
Explanation: There are also “multiple-write” versions of
b) Head–disk assemblies
compact disk (called CD-RW) and digital video disk
c) Head-write assemblies
(DVD-RW, DVD+RW, and DVD-RAM), which can be
d) Read-read assemblies
written multiple times.
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 a read–
b) Random-access
write head that moves across the platter to access
c) Sequential-access
different tracks.
d) All of the mentioned
View Answer
Page 72 of 139
advertisement d) Rotational latency time
View Answer
4. The disk controller uses ________ at each sector to
ensure that the data is not corrupted on data retrieval. Answer: b
a) Checksum Explanation: Average seek times currently range
b) Unit drive between 4 and 10 milliseconds, depending on the disk
c) Read disk model.
d) Readsum
8. Once the head has reached the desired track, the
View Answer
time spent waiting for the sector to be accessed to
Answer: a appear under the head is called the _______________
Explanation: A disk controller interfaces between the a) Access time
computer system and the actual hardware of the disk b) Average seek time
drive. c) Seek time
d) Rotational latency time
5. _________ is the time from when a read or write
View Answer
request is issued to when data transfer begins.
a) Access time Answer: d
b) Average seek time Explanation: Rotational speeds of disks today range
c) Seek time from 5400 rotations per minute (90 rotations per
d) Rotational latency time second) up to 15,000 rotations per minute (250
View Answer rotations per second), or, equivalently, 4 milliseconds to
11.1 milliseconds per rotation.
Answer: a
Explanation: To access (that is, to read or write) data on 9. In Flash memory, the erase operation can be
a given sector of a disk, the arm first must move so that performed on a number of pages, called an _______ at
it is positioned over the correct track, and then must once, and takes about 1 to 2 milliseconds.
wait for the sector to appear under it as the disk rotates. a) Delete block
b) Erase block
Note: Join free Sanfoundry classes
c) Flash block
at Telegram or Youtube
d) Read block
6. The time for repositioning the arm is called the View Answer
________ and it increases with the distance that the
Answer: b
arm must move.
Explanation: The size of an erase block (often referred to
a) Access time
as just “block” in flash literature) is usually significantly
b) Average seek time
larger than the block size of the storage system.
c) Seek time
d) Rotational latency time 10. Hybrid disk drives are hard-disk systems that
View Answer combine magnetic storage with a smaller amount of
flash memory, which is used as a cache for frequently
Answer: c
accessed data.
Explanation: Typical seek times range from 2 to 30
a) Hybrid drivers
milliseconds, depending on how far the track is from the
b) Disk drivers
initial arm position.
c) Hybrid disk drivers
7. _________ is around one-half of the maximum seek d) All of the mentioned
time. View Answer
a) Access time
Answer: b
b) Average seek time
Explanation: Frequently accessed data that are rarely
c) Seek time
updated are ideal for caching in flash memory.
Page 73 of 139
Database Questions and Answers – RAID multiple disks. It treats the array of disks as a single
large disk, and it gives blocks logical numbers.
This set of Database Multiple Choice Questions &
Answers (MCQs) focuses on “RAID”. 5. The RAID level which mirroring is done along with
stripping is
1. Which level of RAID refers to disk mirroring with block
a) RAID 1+0
striping?
b) RAID 0
a) RAID level 1
c) RAID 2
b) RAID level 2
d) Both RAID 1+0 and RAID 0
c) RAID level 0
View Answer
d) RAID level 3
View Answer Answer: d
Explanation: Mirroring without striping can also be used
Answer: a
with arrays of disks, to give the appearance of a single
Explanation: RAID level 1 refers to disk mirroring with
large, reliable disk.
block striping.
Sanfoundry Certification Contest of the Month is Live.
2. Optical disk technology uses
100+ Subjects. Participate Now!
a) Helical scanning
b) DAT 6. Where performance and reliability are both
c) A laser beam important, RAID level ____ is used.
d) RAID a) 0
View Answer b) 1
c) 2
Answer: d
d) 0+1
Explanation: Redundant Array of Inexpensive Disks.
View Answer
3. With multiple disks, we can improve the transfer rate
Answer: d
as well by ___________ data across multiple disks.
Explanation: Mirroring without striping can also be used
a) Striping
with arrays of disks, to give the appearance of a single
b) Dividing
large, reliable disk.
c) Mirroring
d) Dividing 7. ______________ partitions data and parity among all
View Answer N+1 disks, instead of storing data in N-disks and parity in
one disk.
Answer: a
a) Block interleaved parity
Explanation: Data striping consists of splitting the bits of
b) Block interleaved distributed parity
each byte across multiple disks; such striping is called
c) Bit parity
bitlevel striping.
d) Bit interleaved parity
advertisement View Answer
7. The replacement of a bad block generally is not Database Questions and Answers – File Organisations
totally automatic because
This set of Database Multiple Choice Questions &
a) data in bad block cannot be replaced
Answers (MCQs) focuses on “File Organisations”.
b) data in bad block is usually lost
c) bad block does not contain any data 1. Which level of RAID refers to disk mirroring with block
d) none of the mentioned striping?
View Answer a) RAID level 1
b) RAID level 2
Answer: b
c) RAID level 0
Explanation: Physical database design is the process of
d) RAID level 3
selecting the data storage and data access
View Answer
characteristics of the database.
Answer: a
8. Which of the following is the oldest database model?
Explanation: RAID (redundant array of independent
a) Relational
disks) is a way of storing the same data in different
b) Hierarchical
places (thus, redundantly) on multiple hard disks.
c) Physical
Page 76 of 139
2. A unit of storage that can store one or more records Answer: c
in a hash file organization is denoted as Explanation: A data file is a computer file which stores
a) Buckets data to use by a computer application or system.
b) Disk pages
Note: Join free Sanfoundry classes
c) Blocks
at Telegram or Youtube
d) Nodes
View Answer 6. The management information system (MIS) structure
with one main computer system is called a
Answer: a
a) Hierarchical MIS structure
Explanation: A unit of storage that can store one or
b) Distributed MIS structure
more records in a hash file organization is denoted as
c) Centralized MIS structure
buckets.
d) Decentralized MIS structure
3. The file organization which allows us to read records View Answer
that would satisfy the join condition by using one block
Answer: c
read is
Explanation: Structure of MIS may be understood by
a) Heap file organization
looking at the physical components of the information
b) Sequential file organization
system in an organization.
c) Clustering file organization
d) Hash file organization 7. A top-to-bottom relationship among the items in a
View Answer database is established by a
a) Hierarchical schema
Answer: c
b) Network schema
Explanation: All systems in the cluster share a common
c) Relational schema
file structure via NFS, but not all disks are mounted on
d) All of the mentioned
all other systems.
View Answer
advertisement
Answer: a
4. What are the correct features of a distributed Explanation: A hierarchical database model is a data
database? model in which the data is organized into a tree-like
a) Is always connected to the internet structure. The structure allows representing information
b) Always requires more than three machines using parent/child relationships.
c) Users see the data in one global schema.
8. Choose the RDBMS which supports full fledged client
d) Have to specify the physical location of the data when
server application development
an update is done
a) dBase V
View Answer
b) Oracle 7.1
Answer: c c) FoxPro 2.1
Explanation: Users see the data in one global schema. d) Ingress
View Answer
5. Each tablespace in an Oracle database consists of one
or more files called Answer: b
a) Files Explanation: RDBMS is Relational Database
b) name space Management System.
c) datafiles
9. One approach to standardization storing of data?
d) PFILE
a) MIS
View Answer
b) Structured programming
c) CODASYL specification
Page 77 of 139
d) None of the mentioned 3. Large collection of files are called ____________
View Answer a) Fields
b) Records
Answer: c
c) Database
Explanation: CODASYL is an acronym for “Conference on
d) Sectors
Data Systems Languages”.
View Answer
10. The highest level in the hierarchy of data
Answer: c
organization is called
Explanation: The operator tree has a tree like format
a) Data bank
where the evaluation starts from root of the tree .
b) Data base
c) Data file advertisement
d) Data record
4. Which of the following hardware component is the
View Answer
most important to the operation of a database
Answer: b management system?
Explanation: Database is a collection of all tables which a) High resolution video display
contains the data in form of fields. b) Printer
c) High speed, large capacity disk
Database Questions and Answers – Organization of
d) Mouse
Records in Files
View Answer
This set of Database Questions and Answers for
Answer: c
Aptitude test focuses on “Organization of Records in
Explanation: All the data are stored in form of memory
Files”.
in the disk.
1. If a piece of data is stored in two places in the
5. Which of the following is not true of the traditional
database, then
approach to information processing
a) Storage space is wasted
a) There is common sharing of data among the various
b) Changing the data in one spot will cause data
applications
inconsistency
b) It is file oriented
c) In can be more easily accessed
c) Programs are dependent on the file
d) Storage space is wasted & Changing the data in one
d) It is inflexible
spot will cause data inconsistency
View Answer
View Answer
Answer: a
Answer: d
Explanation: All the data are stored in form of memory
Explanation: The database is always consistent and so
in the disk.
there is no duplication.
Subscribe Now: DBMS Newsletter | Important Subjects
2. An audit trail ___________
Newsletters
a) Is used to make backup copies
b) Is the recorded history of operations performed on a 6. Which of these is not a feature of Hierarchical model?
file a) Organizes the data in tree-like structure
c) Can be used to restore lost information b) Parent node can have any number of child nodes
d) None of the mentioned c) Root node does not have any parent
View Answer d) Child node can have any number of parent nodes
View Answer
Answer: b
Explanation: This is more useful for all recovery actions.
Page 78 of 139
Answer: d atabase Questions and Answers – Data-Dictionary
Explanation: The data are traversed using several Storage
algorithms.
This set of Database Multiple Choice Questions &
7. Which of these data models is an extension of the Answers (MCQs) focuses on “Data-Dictionary Storage”.
relational data model?
1. A relational database system needs to maintain data
a) Object-oriented data model
about the relations, such as the schema of the relations.
b) Object-relational data model
This is called
c) Semi structured data model
a) Metadata
d) None of the mentioned
b) Catalog
View Answer
c) Log
Answer: b d) Dictionary
Explanation: All the data are stored in form of memory View Answer
in the disk.
Answer: a
8. The information about data in a database is called Explanation: Each side of a platter of a disk has a read–
_______ write head that moves across the platter to access
a) Metadata different tracks.
b) Hyper data
2. Relational schemas and other metadata about
c) Tera data
relations are stored in a structure called the
d) None of the mentioned
____________
View Answer
a) Metadata
Answer: a b) Catalog
Explanation: Metadata is information about a data. c) Log
d) Data Dictionary
9. A data dictionary is a special file that contains?
View Answer
a) The names of all fields in all files
b) The data types of all fields in all files Answer: d
c) The widths of all fields in all files Explanation: Data dictionary is also called as system
d) All of the mentioned catalog.
View Answer
3. ___________ is the collection of memory structures
Answer: d and Oracle background processes that operates against
Explanation: The data dictionary is structured in tables an Oracle database.
and views, just like other database data. a) Database
b) Instance
10. The DBMS acts as an interface between what two
c) Tablespace
components of an enterprise-class database system?
d) Segment
a) Database application and the database
View Answer
b) Data and the database
c) The user and the database application Answer: b
d) Database application and SQL Explanation: Instance is a snapshot of database at any
View Answer point of time.
Answer: a advertisement
Explanation: Database application is the interface with
4. A ________ is a logical grouping of database objects,
the user to access the database.
usually to facilitate security, performance, or the
availability of database objects such as tables and
Page 79 of 139
indexes. 8. An Oracle __________ is a set of tables and views
a) Tablespace that are used as a read-only reference about the
b) Segments database.
c) Extents a) Database dictionary
d) Blocks b) Dictionary table
View Answer c) Data dictionary
d) Dictionary
Answer: a
View Answer
Explanation: A tablespace is a storage location where
the actual data underlying database objects can be kept. Answer: c
Explanation: Data dictionary is also called as system
5. A tablespace is further broken down into ________
catalog.
a) Tablespace
b) Segments 9. A data dictionary is created when a __________
c) Extents created.
d) Blocks a) Instance
View Answer b) Segment
c) Database
Answer: b
d) Dictionary
Explanation: Segment names are used in create table
View Answer
and create index commands to place tables or indexes
on specific database devices. Answer: c
Explanation: Data dictionary is also called as system
Sanfoundry Certification Contest of the Month is Live.
catalog.
100+ Subjects. Participate Now!
10. An Oracle object type has two parts the _________
6. __________ is a contiguous group of blocks allocated
and__________
for use as part of a table, index, and so forth.
a) Instance and body
a) Tablespace
b) Segment and blocks
b) Segment
c) Specification and body
c) Extent
d) Body and segment
d) Block
View Answer
View Answer
Answer: c
Answer: c
Explanation: Segment names are used in create table
Explanation: An extent is a set of contiguous blocks
and create index commands to place tables or indexes
allocated in a database.
on specific database devices. An extent is a set of
7. ________ is the smallest unit of allocation in an contiguous blocks allocated in a database.
Oracle database.
Database Questions and Answers – Database Buffer
a) Database
b) Instance This set of Database Multiple Choice Questions &
c) Tablespace Answers (MCQs) focuses on “Database Buffer”.
d) Database Block
1. The _______ is that part of main memory available
View Answer
for storage of copies of disk blocks.
Answer: d a) Buffer
Explanation: Data block is a form of database space b) Catalog
allocation. c) Storage
d) Secondary storage
View Answer
Page 80 of 139
Answer: a b) Forced
Explanation: There is always a copy kept on disk of every c) Buffer
block, but the copy on disk may be a version of the d) All of the mentioned
block older than the version in the buffer. View Answer
Answer: d
Explanation: The optimal strategy for block replacement
is the most recently used (MRU) strategy.
Answer: c
Explanation: The optimal strategy for block replacement
is the most recently used (MRU) strategy.
Page 82 of 139
Database Questions and Answers – Ordered Indices data record with that search-key value and the rest of
the records will be in the sequential pointers.
This set of Database Multiple Choice Questions &
a) Dense
Answers (MCQs) focuses on “Ordered Indices”.
b) Sparse
1. In ordered indices the file containing the records is c) Straight
sequentially ordered, a ___________ is an index whose d) Continuous
search key also defines the sequential order of the file. View Answer
a) Clustered index
Answer: a
b) Structured index
Explanation: In a dense nonclustering index, the index
c) Unstructured index
must store a list of pointers to all records with the same
d) Nonclustered index
search-key value.
View Answer
5. In a __________ index, an index entry appears for
Answer: a
only some of the search-key values.
Explanation: Clustering index are also called primary
a) Dense
indices; the term primary index may appear to denote
b) Sparse
an index on a primary key, but such indices can in fact
c) Straight
be built on any search key.
d) Continuous
2. Indices whose search key specifies an order different View Answer
from the sequential order of the file are called
Answer: a
___________ indices.
Explanation: Sparse indices can be used only if the
a) Nonclustered
relation is stored in sorted order of the search key, that
b) Secondary
is if the index is a clustering index.
c) All of the mentioned
d) None of the mentioned Note: Join free Sanfoundry classes
View Answer at Telegram or Youtube
1. If h is any hashing function and is used to hash n keys 5. Consider a hash table of size seven, with starting
in to a table of size m, where n<=m, the expected index zero, and a hash function (3x + 4)mod7. Assuming
Page 84 of 139
the hash table is initially empty, which of the following is c) Two entries with different keys have the same exact
the contents of the table when the sequence 1, 3, 8, 10 hash value
is inserted into the table using closed hashing? Note d) Two entries with the exact same key have different
that ‘_’ denotes an empty location in the table. hash values
a) 8, _, _, _, _, _, 10 View Answer
b) 1, 8, 10, _, _, _, 3
Answer: a
c) 1, _, _, _, _, _,3
Explanation: This level is the root of the tree.
d) 1, 10, 8, _, _, _, 3
View Answer 9. Which of the following scenarios leads to linear
running time for a random search hit in a linear-probing
Answer: b
hash table?
Explanation: A formula generates the hash, which helps
a) All keys hash to same index
to protect the security of the transmission from
b) All keys hash to different indices
unauthorized users.
c) All keys hash to an even-numbered index
Sanfoundry Certification Contest of the Month is Live. d) All keys hash to different even-numbered indices
100+ Subjects. Participate Now! View Answer
2. A hash function must meet ________ criteria. Subscribe Now: DBMS Newsletter | Important Subjects
a) Two Newsletters
b) Three
6. In the client / server model, the database:
c) Four
a) Is downloaded to the client upon request
d) None of the mentioned
b) Is shared by both the client and server
View Answer
c) Resides on the client side
Answer: b d) Resides on the server side
Explanation: Only if the criteria is fulfilled the values are View Answer
hashed.
Answer: d
3. What is the main limitation of Hierarchical Explanation: The server has all the database information
Databases? and the client access it.
a) Limited capacity (unable to hold much data)
7. The traditional storage of data that is organized by
b) Limited flexibility in accessing data
customer, stored in separate folders in filing cabinets is
c) Overhead associated with maintaining indexes
an example of what type of ‘database’ system?
d) The performance of the database is poor
a) Hierarchical
View Answer
b) Network
Answer: b c) Object oriented
Explanation: In this, the data items are placed in a tree d) Relational
like hierarchical structure. View Answer
advertisement Answer: a
Explanation: Hierarchy is based on Parent-Child
4. The property (or set of properties) that uniquely
Relationship. Parent-Child Relationship Type is basically
defines each row in a table is called the:
1:N relationship.
a) Identifier
b) Index 8. The database design that consists of multiple tables
c) Primary key that are linked together through matching data stored in
d) Symmetric key each table is called
View Answer a) Hierarchical database
b) Network database
Answer: c
c) Object oriented database
Explanation: Primary is used to uniquely identify the
d) Relational database
tuples.
View Answer
5. The separation of the data definition from the
Answer: d
program is known as:
Explanation: A relational database is a collection of data
a) Data dictionary
items organized as a set of formally described tables
b) Data independence
from which data can be accessed or reassembled.
c) Data integrity
d) Referential integrity 9. The association role defines:
View Answer a) How tables are related in the database
b) The relationship between the class diagram and the
tables in the database
c) The tables that each attribute is contained
Page 86 of 139
d) Which attribute is the table’s primary key 3.
View Answer
advertisement
Answer: a
SELECT *
Explanation: The tables are always related in the
database to form consistency. FROM r
10. The purpose of an N-Ary association is: WHERE gender = ’f’ AND income level = ’L2’;
a) To capture a parent-child relationship
b) To deal with one to many relationships In this selection, we fetch the bitmaps for gender value f
c) To deal with relationships that involve more than two and the bitmap for income level value L2, and perform
tables an ________ of the two bitmaps.
d) To represent an inheritance relationship a) Union
View Answer b) Addition
c) Combination
Answer: c d) Intersection
Explanation: The is binary n-array association meaning View Answer
more than two classes are involved in the relationship.
Answer: d
Sanfoundry Global Education & Learning Series – Explanation: We compute a new bitmap where bit i has
Database Management System. value 1 if the ith bit of the two bitmaps are both 1, and
has a value 0 otherwise.
Database Questions & Answers – Bitmap Indices
Subscribe Now: DBMS Newsletter | Important Subjects
This set of Database Multiple Choice Questions &
Newsletters
Answers (MCQs) focuses on “Bitmap Indices”.
4. To identify the deleted records we use the
1. Bitmap indices are a specialized type of index
______________
designed for easy querying on ___________
a) Existence bitmap
a) Bit values
b) Current bitmap
b) Binary digits
c) Final bitmap
c) Multiple keys
d) Deleted bitmap
d) Single keys
View Answer
View Answer
Answer: a
Answer: a
Explanation: The bitmaps which are deleted are
Explanation: Bitmap indices are a type of index that is
denoted by 0.
optimized for efficient querying on columns containing
boolean or bit values. Each value in the column has a 5. Bitmaps can be used as a compressed storage
corresponding bitmap, with each bit representing a row. mechanism at the leaf nodes of ________ for those
This enables fast querying and filtering of large datasets. values that occur very frequently.
a) B-trees
2. A _______ on the attribute A of relation r consists of
b) B+-trees
one bitmap for each value that A can take.
c) Bit trees
a) Bitmap index
d) Both B-trees and B+-trees
b) Bitmap
View Answer
c) Index
d) Array Answer: b
View Answer Explanation: Bitmaps are combined and stored in a B+
tree.
Answer: a
Explanation: A bitmap is simply an array of bits.
Page 87 of 139
6. Bitmaps can be combined with regular B+-tree indices an index on a primary key, but such indices can in fact
for relations where a few attribute values are extremely be built on any search key.
common, and other values also occur, but much less
10. Indices whose search key specifies an order different
frequently.
from the sequential order of the file are called
a) Bitmap, B-tree
___________ indices.
b) Bitmap, B+tree
a) Nonclustered
c) B-tree, Bitmap
b) Secondary
d) B+tree, Bitmap
c) All of the mentioned
View Answer
d) None of the mentioned
Answer: b View Answer
Explanation: Bitmaps are combined and stored in a B+
Answer: c
tree.
Explanation: Nonclustering index are also called
7. In a B+-tree index ______ for each value, we would secondary indices.
normally maintain a list of all records with that value for
Database Questions and Answers – Index Definition in
the indexed attribute.
SQL
a) Leaf
b) Node This set of Database Multiple Choice Questions &
c) Root Answers (MCQs) focuses on “Index Definition in SQL”.
d) Link
View Answer 1. What is the purpose of the index in sql server?
a) To enhance the query performance
Answer: a b) To provide an index to a record
Explanation: Bitmaps are combined and stored in a B+ c) To perform fast searches
tree. d) All of the mentioned
View Answer
8. A tablespace is further broken down into ________
a) Tablespace Answer: d
b) Segments Explanation: A database index is a data structure that
c) Extents improves the speed of data retrieval operations on a
d) Blocks database table at the cost of additional writes.
View Answer
2. How many types of indexes are there in sql server?
Answer: b a) 1
Explanation: Segment names are used in create table b) 2
and create index commands to place tables or indexes c) 3
on specific database devices. d) 4
View Answer
9. In ordered indices the file containing the records is
sequentially ordered, a ___________ is an index whose Answer: b
search key also defines the sequential order of the file. Explanation: They are clustered index and non clustered
a) Clustered index index.
b) Structured index
c) Unstructured index 3. How non clustered index point to the data?
d) Nonclustered index a) It never points to anything
View Answer b) It points to a data row
c) It is used for pointing data rows containing key values
Answer: a d) None of the mentioned
Explanation: Clustering index are also called primary View Answer
indices; the term primary index may appear to denote
Page 88 of 139
Answer: c 7. What are composite indexes?
Explanation: Nonclustered indexes have a structure a) Are those which are composed by database for its
separate from the data rows. A nonclustered index internal use
contains the nonclustered index key values and each key b) A composite index is a combination of index on 2 or
value entry has a pointer to the data row that contains more columns
the key value. c) Composite index can never be created
d) None of the mentioned
advertisement
View Answer
4. Which one is true about clustered index?
Answer: b
a) Clustered index is not associated with table
Explanation: A composite index is an index on two or
b) Clustered index is built by default on unique key
more columns of a table.
columns
c) Clustered index is not built on unique key columns 8. If an index is _________________ the metadata and
d) None of the mentioned statistics continue to exists
View Answer a) Disabling
b) Dropping
Answer: b
c) Altering
Explanation: Nonclustered indexes have a structure
d) Both Disabling and Dropping
separate from the data rows. A nonclustered index
View Answer
contains the nonclustered index key values and each key
value entry has a pointer to the data row that contains Answer: a
the key value. Explanation: A database index is a data structure that
improves the speed of data retrieval operations on a
5. What is true about indexes?
database table at the cost of additional writes.
a) Indexes enhance the performance even if the table is
updated frequently 9. In _______________ index instead of storing all the
b) It makes harder for sql server engines to work to columns for a record together, each column is stored
work on index which have large keys separately with all other rows in an index.
c) It doesn’t make harder for sql server engines to work a) Clustered
to work on index which have large keys b) Column store
d) None of the mentioned c) Non clustered
View Answer d) Row store
View Answer
Answer: b
Explanation: Indexes tend to improve the performance. Answer: b
Explanation: A database index is a data structure that
Note: Join free Sanfoundry classes
improves the speed of data retrieval operations on a
at Telegram or Youtube
database table at the cost of additional writes.
6. Does index take space in the disk?
10. A _________________ index is the one which
a) It stores memory as and when required
satisfies all the columns requested in the query without
b) Yes, Indexes are stored on disk
performing further lookup into the clustered index.
c) Indexes are never stored on disk
a) Clustered
d) Indexes take no space
b) Non Clustered
View Answer
c) Covering
Answer: b d) B-Tree
Explanation: Indexes take memory slots which are View Answer
located on the disk.
Answer: c
Explanation: A covered query is a query where all the
Page 89 of 139
columns in the query’s result set are pulled from non- d) Alternate key
clustered indexes. View Answer
Page 90 of 139
8. A table can be logically connected to another table by Answer: c
defining a Explanation: File scans are search algorithms that locate
a) Super key and retrieve records that fulfill a selection condition.
b) Candidate key
2. In a ____________ the system scans each file block
c) Primary key
and tests all records to see whether they satisfy the
d) Unique key
selection condition.
View Answer
a) Index Search
Answer: c b) Linear search
Explanation: A superkey is a combination of attributes c) File scan
that can be uniquely used to identify a database record. d) Access paths
View Answer
9. If the state of the database no longer reflects a real
state of the world that the database is supposed to Answer: b
capture, then such a state is called Explanation: An initial seek is required to access the first
a) Consistent state block of the file.
b) Parallel state
3. Index structures are referred to as __________ since
c) Durable state
they provide a path through which data can be located
d) Inconsistent state
and accessed.
View Answer
a) Index Search
Answer: d b) Linear search
Explanation: SQL data consistency is that whenever a c) File scan
transaction is performed, it sees a consistent database. d) Access paths
View Answer
10. Ensuring isolation property is the responsibility of
the Answer: d
a) Recovery-management component of the DBMS Explanation: A primary index is an index that allows the
b) Concurrency-control component of the DBMS records of a file to be read in an order that corresponds
c) Transaction-management component of the DBMS to the physical order in the file.
d) Buffer management component in DBMS
advertisement
View Answer
4. Search algorithms that use an index are referred to as
Answer: b
a) Index Search
Explanation: Concurrency control ensures that correct
b) Linear search
results for concurrent operations are generated while
c) File scan
getting those results as quickly as possible.
d) Access paths
Database Questions and Answers – Selection View Answer
Operation
Answer: a
This set of Database Multiple Choice Questions & Explanation: Selection predicates are used to guide in
Answers (MCQs) focuses on “Selection Operation”. the choice of the index to use in processing the query.
1. In query processing, the ___________ is the lowest- 5. Which algorithm uses equality comparison on a key
level operator to access data. attribute with a primary index to retrieve a single record
a) Index Search that satisfies the corresponding equality condition.
b) Linear search a) A2
c) File scan b) A4
d) Access paths c) A5
View Answer
Page 91 of 139
d) A6 c) A9
View Answer d) A6
View Answer
Answer: a
Explanation: A2 – primary index, equality on key. Answer: a
Explanation: A10 – Disjunctive selection by union of
Sanfoundry Certification Contest of the Month is Live.
identifiers.
100+ Subjects. Participate Now!
10. Conjunctive selection using one index. This is
6. The strategy can retrieve a single record if the
a) A10
equality condition is on a key; multiple records may be
b) A7
retrieved if the indexing field is not a key is
c) A9
a) A2
d) A6
b) A4
View Answer
c) A5
d) A6 Answer: b
View Answer Explanation: To reduce the cost of A7 we choose a i and
one of algorithms A1 through A6 for which the
Answer: b
combination results in the least cost for i (r ). The cost of
Explanation: A4 – Secondary index, equality.
algorithm A7 is given by the cost of the chosen
7. The algorithm that uses a secondary ordered index to algorithm.
guide retrieval for comparison conditions involving
Database Questions and Answers – Sorting
<,≤,≥, or > is
a) A2 This set of Database Multiple Choice Questions &
b) A4 Answers (MCQs) focuses on “Sorting”.
c) A5
1. Two main measures for the efficiency of an algorithm
d) A6
are
View Answer
a) Processor and memory
Answer: d b) Complexity and capacity
Explanation: A6 – Secondary index, comparison. c) Time and space
d) Data and space
8. The ___ algorithm scans each index for pointers to
View Answer
tuples that satisfy an individual condition.
a) A2 Answer: c
b) A4 Explanation: Depending on the time and space
c) A9 complexity only the algorithm for sorting will be chosen.
d) A6
2. The time factor when determining the efficiency of an
View Answer
algorithm is measured by
Answer: c a) Counting microseconds
Explanation: A9 – Conjunctive selection by an b) Counting the number of key operations
intersection of identifiers. c) Counting the number of statements
d) Counting the kilobytes of algorithm
9. If access paths are available on all the conditions of a
View Answer
disjunctive selection, each index is scanned for pointers
to tuples that satisfy the individual condition. This is Answer: b
satisfied by Explanation: The operations taking place with the time
a) A10 and space is counted.
b) A7
Page 92 of 139
3. The space factor when determining the efficiency of there at all
an algorithm is measured by View Answer
a) Counting the maximum memory needed by the
Answer: a
algorithm
Explanation: Algorithmic complexity is concerned about
b) Counting the minimum memory needed by the
how fast or slow particular algorithm performs.
algorithm
c) Counting the average memory needed by the 7. The complexity of the average case of an algorithm is
algorithm a) Much more complicated to analyze than that of worst
d) Counting the maximum disk space needed by the case
algorithm b) Much more simpler to analyze than that of worst case
View Answer c) Sometimes more complicated and some other times
simpler than that of worst case
Answer: a
d) None of the mentioned
Explanation: Time complexity maintains the maximum
View Answer
time needed.
Answer: a
advertisement
Explanation: Algorithmic complexity is concerned about
4. Which of the following case does not exist in how fast or slow particular algorithm performs.
complexity theory
8. The complexity of a linear search algorithm is
a) Best case
a) O(n)
b) Worst case
b) O(log n)
c) Average case
c) O(n2)
d) Null case
d) O(n log n)
View Answer
View Answer
Answer: d
Answer: a
Explanation: Null case cannot be counted as the factor
Explanation: It refers to n values complexity in the
for complexity.
algorithm which can be reduced by choosing the other
5. The Worst case occur in linear search algorithm when algorithms.
a) Item is somewhere in the middle of the array
9. The complexity of Binary search algorithm is
b) Item is not in the array at all
a) O(n)
c) Item is the last element in the array
b) O(log )
d) Item is the last element in the array or is not there at
c) O(n2)
all
d) O(n log n)
View Answer
View Answer
Answer: d
Answer: b
Explanation: Algorithmic complexity is concerned about
Explanation: This shows that it has a standard
how fast or slow particular algorithm performs.
complexity in addressing.
Sanfoundry Certification Contest of the Month is Live.
10. The complexity of Bubble sort algorithm is
100+ Subjects. Participate Now!
a) O(n)
6. The Average case occur in linear search algorithm b) O(log n)
a) When Item is somewhere in the middle of the array c) O(n2)
b) When Item is not in the array at all d) O(n log n)
c) When Item is the last element in the array View Answer
d) When Item is the last element in the array or is not
Page 93 of 139
Answer: c Database. The i stands for “Internet” to indicate that 9i
Explanation: Bubble sort, is a simple sorting algorithm is “Internet ready”.
that works by repeatedly stepping through the list to be
advertisement
sorted, comparing each pair of adjacent items and
swapping them if they are in the wrong order. 4. How many join types in join condition:
a) 2
Database Questions and Answers – Join Operations
b) 3
This set of Database Multiple Choice Questions & c) 4
Answers (MCQs) focuses on “Join Operations”. d) 5
View Answer
1. A_____ is a query that retrieves rows from more than
one table or view: Answer: d
a) Start Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL
b) End JOIN, EQUIJOIN.
c) Join
5. Which are the join types in join condition:
d) All of the mentioned
a) Cross join
View Answer
b) Natural join
Answer: c c) Join with USING clause
Explanation: An SQL join clause combines records from d) All of the mentioned
two or more tables in a database. It creates a set that View Answer
can be saved as a table or used as it is. A JOIN is a means
Answer: d
for combining fields from two tables by using values
Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL
common to each.
JOIN, EQUIJOIN are the types of joins.
2. A condition is referred to as __________
Subscribe Now: DBMS Newsletter | Important Subjects
a) Join in SQL
Newsletters
b) Join condition
c) Join in SQL & Condition 6. Which product is returned in a join query have no join
d) None of the mentioned condition:
View Answer a) Equijoins
b) Cartesian
Answer: b
c) Both Equijoins and Cartesian
Explanation: An SQL join clause combines records from
d) None of the mentioned
two or more tables in a database. It creates a set that
View Answer
can be saved as a table or used as it is. A JOIN is a means
for combining fields from two tables by using values Answer: b
common to each. Explanation: A Cartesian coordinate system is a
coordinate system that specifies each point uniquely in
3. Which oracle is the join condition is specified using
a plane by a pair of numerical coordinates.
the WHERE clause:
a) Oracle 9i 7. Which is a join condition contains an equality
b) Oracle 8i operator:
c) Pre-oracle 9i a) Equijoins
d) Pre-oracle 8i b) Cartesian
View Answer c) Both Equijoins and Cartesian
d) None of the mentioned
Answer: c
View Answer
Explanation: Oracle 9i is a version of the Oracle
Page 94 of 139
Answer: a This set of Database Multiple Choice Questions &
Explanation: An equi-join is a specific type of Answers (MCQs) focuses on “Evaluation of Expressions”.
comparator-based join, that uses only equality
1. Pictorial representation of an expression is called
comparisons in the join-predicate.
a) Expression tree
8. Which join refers to join records from the write table b) Operator tree
that have no matching key in the left table are include in c) Expression flow
the result set: d) Expression chart
a) Left outer join View Answer
b) Right outer join
Answer: b
c) Full outer join
Explanation: The operator tree has a tree like format
d) Half outer join
where the evaluation starts from root of the tree.
View Answer
2. The results of each intermediate operation are
Answer: b
created and then are used for evaluation of the next-
Explanation: A right outer join will return all the rows
level operations. This is called
that an inner join returns plus one row for each of the
a) Materialized evaluation
other rows in the second table that did not have a
b) Expression evaluation
match in the first table. It is the same as a left outer join
c) Tree evaluation
with the tables specified in the opposite order.
d) Tree materialization
9. Which operation are allowed in a join view: View Answer
a) UPDATE
Answer: a
b) INSERT
Explanation: The cost of a materialized evaluation is not
c) DELETE
simply the sum of the costs of the operations involved.
d) All of the mentioned
View Answer 3. ______________ allows the algorithm to execute
more quickly by performing CPU activity in parallel with
Answer: d
I/O activity.
Explanation: The DELETE statement is used to delete
a) Buffering
rows in a table. The UPDATE statement is used to update
b) Double buffering
existing records in a table. The INSERT INTO statement is
c) Multiple buffering
used to insert new records in a table.
d) Double reading
10. Which view that contains more than one table in the View Answer
top-level FROM clause of the SELECT statement:
Answer: a
a) Join view
Explanation: Double buffering using two buffers, with
b) Datable join view
one continuing execution of the algorithm while the
c) Updatable join view
other is being written out.
d) All of the mentioned
View Answer advertisement
Answer: c 4. Pipelines can be executed in
Explanation: The DELETE statement is used to delete a) 4
rows in a table. The UPDATE statement is used to update b) 3
existing records in a table. The INSERT INTO statement is c) 2
used to insert new records in a table. d) 5
View Answer
Database Questions and Answers – Evaluation of
Expressions
Page 95 of 139
Answer: c requests receive successive result tuples.
Explanation: Demand driven and producer driven a) State
pipelines are the two ways. b) Transition
c) Rate
5. In a _________ the system makes repeated requests
d) Block
for tuples from the operation at the top of the pipeline.
View Answer
a) Demand-driven pipeline
b) Producer-driven pipeline Answer: a
c) Demand pipeline Explanation: The function close() tells an iterator that no
d) All of the mentioned more tuples are required.
View Answer
9. Tuples are generated ___________ in producer-driven
Answer: a pipelining, they are generated ________ on demand, in
Explanation: Each time that an operation receives a demand-driven pipelining.
request for tuples, it computes the next tuple (or tuples) a) Lazily, Eagerly
to be returned, and then returns that tuple. b) Eagerly, Lazily
c) Slowly, Eagerly
Subscribe Now: DBMS Newsletter | Important Subjects
d) Eagerly, Slowly
Newsletters
View Answer
6. In a _____________ operations do not wait for
Answer: b
requests to produce tuples, but instead generate the
Explanation: Producer-driven pipelining is very useful in
tuples eagerly.
parallel processing systems.
a) Demand-driven pipeline
b) Producer-driven pipeline 10. When two inputs that we desire to pipeline into the
c) Demand pipeline join are not already sorted it is the _____________
d) All of the mentioned technique.
View Answer a) Hash join
b) Buffer join
Answer: b
c) double-pipelined hash join
Explanation: Each operation in a producer-driven
d) double-pipelined join
pipeline is modeled as a separate process or thread
View Answer
within the system that takes a stream of tuples from its
pipelined inputs and generates a stream of tuples for its Answer: d
output. Explanation: When hash indices are used on tuples, the
resultant algorithm is called the double-pipelined hash-
7. Each operation in a demand-driven pipeline can be
join technique.
implemented as an ____ that provides the following
functions: open(), next(), and close(). Database Questions and Answers – Transformation of
a) Demand Relational Expressions
b) Pipeline
This set of Database Questions and Answers for
c) Iterator
Entrance exams focuses on “Transformation of
d) All of the mentioned
Relational Expressions”.
View Answer
1. Consider the following relational schemes for a library
Answer: c
database:
Explanation: After a call to open(), each call to next()
returns the next output tuple of the operation. Book (Title, Author, Catalog_no, Publisher, YEAR, Price)
8. The iterator maintains the __________ of its Collection (Title, Author, Catalog_no)
execution in between calls so that successive next()
Page 96 of 139
WITH the following functional dependencies: schema
b) BINARY BASE32 returns the binary data in base32-
I. Title Author -> Catalog_no
encoded format
II. Catalog_no -> Title Author Publisher YEAR c) Each row in the query result is transformed into an
XML element
III. Publisher Title YEAR -> Price d) None of the mentioned
Assume {Author, Title} is the key for both schemes. View Answer
Which of the following statements is true? Answer: b
a) Both Book and Collection are in BCNF Explanation: XML was designed to transport and store
b) Both Book and Collection are in 3NF only data.
c) Book is in 2NF and Collection is in 3NF
d) Both Book and Collection are in 2NF only 4. ___________ refers to the ability of the system to
View Answer recover committed transaction updates if either the
system or the storage media fails.
Answer: c a) Isolation
Explanation: The relation Collection is in BCNF: Its given b) Atomicity
that {Author, Title} is the key and there is only one c) Consistency
functional dependency (FD) applicable to the relation d) Durability
Collection {i.e. Title Author –> Catalog_no}. View Answer
advertisement Answer: d
2. Let R(A,B,C,D,E,P,G) be a relational schema in which Explanation: In database systems, durability is the ACID
the following FDs are known to hold: property which guarantees that transactions that have
committed will survive permanently.
AB->CD
5. Which utilities can we use to export data from sql
DE->P server to a text file?
C->E a) DTS export wizard
b) BCP
P->C c) ISQL
d) DTS export wizard and BCP
B->G
View Answer
The relation schema R is
Answer: d
a) in BCNF
Explanation: The bcp utility bulk copies data between an
b) in 3NF, but not in BCNF
instance of Microsoft SQL Server and a data file in a
c) in 2NF, but not in 3NF
user-specified format.
d) not in 2NF
View Answer 6. You have a column that will only contain values from
0 to 256. What is the most economical data type to use
Answer: d
for the column?
Explanation: From the closure set of attributes we can
a) TINYINT
see that the key for the relation is AB. The FD B->G is a
b) SMALLINT
partial dependency, hence it is not in 2NF.
c) INT
Sanfoundry Certification Contest of the Month is Live. d) DECIMAL(1)
100+ Subjects. Participate Now! View Answer
3. Which of the following is/are false for RAW mode of Answer: b
FOR XML? Explanation: The bcp utility bulk copies data between an
a) XMLSCHEMA option does not returns an in-line XSD
Page 97 of 139
instance of Microsoft SQL Server and a data file in a Database Questions and Answers – Estimating
user-specified format. Statistics of Expression Results
7. Problems occurs if we don’t implement a proper This set of Database Questions and Answers for Campus
locking strategy interviews focuses on “Estimating Statistics of
a) Dirty reads Expression Results”.
b) Phantom reads
1. Which feature converts row data to a column for
c) Lost updates
better analytical view?
d) Unrepeatable reads
a) Views
View Answer
b) Join
Answer: b c) Pivot
Explanation: Phantom reads occur when an insert or d) Trigger
delete action is performed against a row that belongs to View Answer
a range of rows being read by a transaction.
Answer: c
8. Which of the following fixed database roles can add Explanation: Pivot table is very powerful and very easy
or remove user IDs? to use.
a) db_accessadmin
2. Which of the following statements is/are not true for
b) db_securityadmin
SQL profiler?
c) db_setupadmin
a) Enables you to monitor events
d) db_sysadmin
b) Check if rows are being inserted properly
View Answer
c) Check the performance of a stored procedure
Answer: a d) None of the mentioned
Explanation: The db_accessadmin role manages View Answer
security, but handles access to the database, as the
Answer: c
name implies.
Explanation: Stored procedures are like functions which
9. By default sql server has ___________ isolation level do not return values.
a) READ COMMITTED
3. Which global variables can be used to determine if a
b) READ UNCOMMITTED
transaction is still open?
c) SERIALIZABLE
a) @@NESTLEVEL
d) REPEATABLE READ
b) @@FETCH_STATUS
View Answer
c) @@TRANCOUNT
Answer: a d) @@CONNECTIONS
Explanation: READ UNCOMMITTED is the most View Answer
optimistic concurrency isolation option available in SQL
Answer: c
Server.
Explanation: PRINT @@TRANCOUNT — The BEGIN
10. Which of the following pair of regular expression are TRAN statement will increment the — transaction count
not equivalent? by 1.
a) 1(01)* and (10)*1
advertisement
b) x(xx)* and (xx)*x
c) (ab)* and a*b* 4. Which statement is used to define a cursor?
d) x+ and x*x+ a) OPEN
View Answer b) FETCH
c) DECLARE CURSOR
Answer: c
Explanation: (ab)*=(a*b*)*.
Page 98 of 139
d) @@FETCH_STATUS b) False
View Answer c) Depends on the result
d) Always safe
Answer: c
View Answer
Explanation: A database cursor is a control structure
that enables traversal over the records in a database. Answer: a
Explanation: Injection attack is not possible in SP.
5. What is the default “SORT” order for a SQL?
a) Ascending 9. Which of the following connection type supports
b) Descending application role permissions and password encryption?
c) As specified by the user a) OLE DB
d) None of the mentioned b) DBLib
View Answer c) ODBC
d) OLE DB and ODBC
Answer: a
View Answer
Explanation: Default is ascending order.
Answer: d
Sanfoundry Certification Contest of the Month is Live.
Explanation: Open Database Connectivity (ODBC) is
100+ Subjects. Participate Now!
Microsoft’s strategic interface for accessing data in a
6. Capabilities of RAISERROR heterogeneous environment of relational.
a) It can be logged in the error log
10. Cursor that reflects the changes made to the
b) It can print a message to the application
database table even after the result set is returned
c) It can assign an error number, state and severity
a) Static
d) All of the mentioned
b) Dynamic
View Answer
c) FORWARD_ONLY
Answer: d d) Keyset
Explanation: A relational database table is often View Answer
described as “normalized” if it is in the Third Normal
Answer: b
Form because most of the 3NF tables are free of
Explanation: A database cursor is a control structure
insertion, update, and deletion anomalies.
that enables traversal over the records in a database.
7. How inserting data through stored procedure do
Database Questions and Answers – Materialized Views
reduces network traffic and increase database
performance? This set of Database Multiple Choice Questions &
a) Stored procedure can accept parameter Answers (MCQs) focuses on “Materialized Views”.
b) Permission check is not required
1. Which normal form is considered adequate for
c) The execution plan is stored in the cache after it was
normal relational database design?
executed the first time
a) 2NF
d) None of the mentioned
b) 5NF
View Answer
c) 4NF
Answer: c d) 3NF
Explanation: A relational database table is often View Answer
described as “normalized” if it is in the Third Normal
Answer: d
Form because most of the 3NF tables are free of
Explanation: A relational database table is often
insertion, update, and deletion anomalies.
described as “normalized” if it is in the Third Normal
8. Stored procedures are safe from SQL injection attacks Form because most of the 3NF tables are free of
a) True insertion, update, and deletion anomalies.
Page 99 of 139
2. Consider a schema R(A, B, C, D) and functional Note: Join free Sanfoundry classes
dependencies A -> B and C -> D. Then the at Telegram or Youtube
decomposition of R into R1 (A, B) and R2(C, D) is
F1->F3
a) dependency preserving and lossless join
b) lossless join but not dependency preserving F2->F4
c) dependency preserving but not lossless join
d) not dependency preserving and not lossless join (F1,F2)->F5
View Answer in terms of normalization, this table is in
Answer: d a) 1NF
Explanation: While decomposing a relational table we b) 2NF
must verify the following properties: c) 3NF
i) Dependency Preserving Property d) None of the mentioned
ii) Lossless-Join Property. View Answer
name->rollNo Answer: d
Explanation: A table is in 3NF if and only if, for each of
rollNo->name its functional dependencies X -> A, at least one of the
The highest normal form of this relation scheme is following conditions holds:
a) 2NF * X contains A (that is, X -> A is trivial functional
b) 3NF dependency), or
c) BCNF * X is a superkey, or
d) 4NF * A should be prime attribute.
View Answer Database Questions and Answers – Advanced Query
Answer: b Optimization
Explanation: A super key is a combination of prime This set of Database Multiple Choice Questions &
attributes and one or more non-prime key attribute(s). It Answers (MCQs) focuses on “Advanced Query
also uniquely identifies a record in a table. Primary key Optimization”.
can be defined as super key with minimal attributes.
1. _______________ is a procedural extension of Oracle
9. The relation EMPDT1 is defined with attributes – SQL that offers language constructs similar to those in
empcode(unique), name, street, city, state, and pincode. imperative programming languages.
For any pincode, there is only one city and state. Also, a) SQL
for any given street, city and state, there is just one b) PL/SQL
pincode. In normalization terms EMPDT1 is a relation in c) Advanced SQL
a) 1NF only d) PQL
b) 2NF and hence also in 1NF View Answer
c) 3NF and hence also in 2NF and 1NF
Answer: b
Explanation: PL/SQL is an imperative 3GL that was
Page 101 of 139
designed specifically for the seamless processing of SQL d) Identifiers
commands. View Answer
1. Consider money is transferred from (1)account-A to 5. The database system must take special actions to
account-B and (2) account-B to account-A. Which of the ensure that transactions operate properly without
following form a transaction? interference from concurrently executing database
a) Only 1 statements. This property is referred to as
b) Only 2 a) Atomicity
c) Both 1 and 2 individually b) Durability
d) Either 1 or 2 c) Isolation
View Answer d) All of the mentioned
View Answer
Answer: c
Explanation: The term transaction refers to a collection Answer: c
of operations that form a single logical unit of work. Explanation: Even though multiple transactions may
execute concurrently, the system guarantees that, for
2. A transaction is delimited by statements (or function
every pair of transactions Ti and Tj, it appears to Ti that
calls) of the form __________
either Tj finished execution before Ti started or Tj
a) Begin transaction and end transaction
started execution after Ti finished.
b) Start transaction and stop transaction
c) Get transaction and post transaction Subscribe Now: DBMS Newsletter | Important Subjects
d) Read transaction and write transaction Newsletters
View Answer
Answer: b Answer: a
Explanation: Commit is used to store all the Explanation: Triggers are used to initialize the actions for
transactions. an activity.
Page 104 of 139
3. Which character function can be used to return a d) Data Retrieval Language
specified portion of a character string? View Answer
a) INSTR
Answer: a
b) SUBSTRING
Explanation: DDL are used to define schema and table
c) SUBSTR
characters.
d) POS
View Answer 7. The SQL statement SELECT SUBSTR(‘123456789’,
INSTR(‘abcabcabc’,’b’), 4) FROM EMP; prints
Answer: c
a) 6789
Explanation: SUBSTR are used to match the particular
b) 2345
characters in a string.
c) 1234
advertisement d) 456789
View Answer
4. Which of the following is TRUE for the System
Variable $date$? Answer: b
a) Can be assigned to a global variable Explanation: SUBSTR are used to match the particular
b) Can be assigned to any field only during design time characters in a string.
c) Can be assigned to any variable or field during run
8. Which of the following SQL command can be used to
time
modify existing data in a database table?
d) Can be assigned to a local variable
a) MODIFY
View Answer
b) UPDATE
Answer: b c) CHANGE
Explanation: A database schema of a database system is d) NEW
its structure described in a formal language supported View Answer
by the database management system and refers to the
Answer: b
organization of data as a blueprint of how a database is
Explanation: Syntax : UPDATE table_name
constructed.
SET column1=value1,column2=value2,…
5. What are the different events in Triggers? WHERE some_column=some_value; .
a) Define, Create
9. When SQL statements are embedded inside 3GL, we
b) Drop, Comment
call such a program as
c) Insert, Update, Delete
a) Nested query
d) Select, Commit
b) Nested programming
View Answer
c) Distinct query
Answer: c d) Embedded SQL
Explanation: A database trigger is a procedural code that View Answer
is automatically executed in response to certain events
Answer: d
on a particular table or view in a database.
Explanation: SQL-99 is the most recent version of
Subscribe Now: DBMS Newsletter | Important Subjects standard SQL prescribed by the ANSI.
Newsletters
10. _______________ provides option for entering SQL
6. Which is the subset of SQL commands used to queries as execution time, rather than at the
manipulate Oracle Database Structures, including development stage.
tables? a) PL/SQL
a) Data Definition Language b) SQL*Plus
b) Data Manipulation Language c) SQL
c) Data Described Language
Page 105 of 139
d) Dynamic SQL advertisement
View Answer
4. The unit of storage that can store one are more
Answer: d records in a hash file organization are
Explanation: Dynamic SQL enables you to write a) Buckets
programs that reference SQL statements whose full text b) Disk pages
is not known until runtime. c) Blocks
d) Nodes
Database Questions and Answers – Storage Structure
View Answer
This set of Database Multiple Choice Questions &
Answer: a
Answers (MCQs) focuses on “Storage Structure”.
Explanation: Buckets are used to store one or more
1. The storage structure which do not survive system records in a hash file organization.
crashes are ______
5. A ______ file system is software that enables multiple
a) Volatile storage
computers to share file storage while maintaining
b) Non-volatile storage
consistent space allocation and file content.
c) Stable storage
a) Storage
d) Dynamic storage
b) Tertiary
View Answer
c) Secondary
Answer: a d) Cluster
Explanation: Volatile storage, is a computer memory View Answer
that requires power to maintain the stored information,
Answer: d
in other words it needs power to reach the computer
Explanation: With a cluster file system, the failure of a
memory.
computer in the cluster does not make the file system
2. Storage devices like tertiary storage, magnetic disk unavailable.
comes under
Subscribe Now: DBMS Newsletter | Important Subjects
a) Volatile storage
Newsletters
b) Non-volatile storage
c) Stable storage 6. A file produced by a spreadsheet
d) Dynamic storage a) is generally stored on disk in an ASCII text format
View Answer b) can be used as is by the DBMS
c) all of the mentioned
Answer: b
d) none of the mentioned
Explanation: Information residing in nonvolatile storage
View Answer
survives system crashes.
Answer: a
3. For a transaction to be durable, its changes need to
Explanation: ASCII text format uses the standard text file
be written to ________ storage.
for the changing the value.
a) Volatile storage
b) Non-volatile storage 7. SDL means _____________
c) Stable storage a) Storage Discrete Language
d) Dynamic storage b) Storage Definition Language
View Answer c) Storage Definition Localisation
d) Storage Discrete Localisation
Answer: c
View Answer
Explanation: Similarly, for a transaction to be atomic, log
records need to be written to stable storage before any
changes are made to the database on disk.
Answer: c
Explanation: Triggers are used to initiate an action to
take place.
1. Which s essential a business problem not a data 5. How many types of insertion anomalies:
problem: a) 1
a) Data b) 2
b) Database c) 3
c) Database design d) 4
d) All of the mentioned View Answer
View Answer
Answer: b
Answer: c Explanation: Insertion anomaly is due to confusion in
Explanation: SQL-99 is the most recent version of data deletion or insertion.
standard SQL prescribed by the ANSI.
Sanfoundry Certification Contest of the Month is Live.
2. Which is primarily the result of a thorough 100+ Subjects. Participate Now!
understanding of information about an enterprise:
6. Who developed the normalization process:
a) Data
a) E.F. codd
b) Database
b) F.F. codd
c) Database design
c) E.E. codd
d) Data modeling
d) None of the mentioned
View Answer
View Answer
Answer: d
Answer: a
Explanation: Data modelling designs the data in a
Explanation: Normalization helps in improving the
secured manner.
quality of the data.
3. McFadden has defined normalization in his which
7. [Link] developed the normalization process in the
book___________
which early:
a) Database modern management
a) 1969
b) Management database of modern
b) 1970
c) Modern database management
c) 1971
d) Database management
d) 1972
View Answer
View Answer
Answer: c
Answer: b
Explanation: SQL-99 is the most recent version of
Explanation: Normalization helps in improving the
standard SQL prescribed by the ANSI.
quality of the data.
advertisement
8. Which is a bottom-up approach to database design
4. The database design prevents some data from being that design by examining the relationship between
represented due to _______ attributes:
a) Deletion anomalies a) Functional dependency
b) Insertion anomalies b) Database modeling
c) Update anomaly c) Normalization
Answer: b
Explanation: External users are the people who do not
involve in the processing of the database.
Database Questions and Answers – Implementation of
7. Copying files to secondary or specific devices is Isolation Levels
known as ______
a) Retrieve This set of Database Multiple Choice Questions &
b) Backup Answers (MCQs) focuses on “Implementation of
c) Recovery Isolation Levels”.
d) Deadlock 1. In concurrency control policy the lock is obtained on
View Answer a) Entire database
Answer: b b) A particular transaction alone
Explanation: Backup is required to take all the data. c) All the new elements
d) All of the mentioned
8. How many types of recovery control techniques: View Answer
a) 2
b) 3 Answer: a
c) 4 Explanation: It is to avoid deadlock.
d) 5 2. A concurrency-control policy such as this one leads to
View Answer ______ performance since it forces transactions to wait
Answer: a for preceding transactions to finish before they can
Explanation: Recovery means to take the backup data start.
while there is a crash. a) Good
b) Average
9. Which are types of recovery control techniques: c) Poor
a) Deferred update d) Unstable
b) Immediate update View Answer
c) All of the Mentioned
d) None of the Mentioned Answer: c
View Answer Explanation: It provides a poor degree of concurrency.
empdet_idx COMMIT;
(deptno NUMBER(3) PRIMARY KEY, Database Questions and Answers – Transactions as SQL
Statements
deptname VARCHAR2(10));
This set of Basic Database Questions and Answers
DROP TABLE dept; focuses on “Transactions as SQL Statements”.
Page 115 of 139
1. Which of the following is a property of transactions? 5. Problems occurs if we don’t implement a proper
a) Atomicity locking strategy
b) Concurrency a) Dirty reads
c) Isolation b) Phantom reads
d) All of the mentioned c) Lost updates
View Answer d) Unrepeatable reads
View Answer
Answer: d
Explanation: Atomicity, Concurrency, Isolation, and Answer: d
Durability are essential properties of transactions in Explanation: In a concurrent execution of these
database systems. They ensure that transactions are transactions, it is intuitively clear that they conflict, but
executed consistently, efficiently, and reliably, this is a conflict not captured by our simple model. This
maintaining data integrity and consistency. situation is referred to as the phantom phenomenon,
because a conflict may exist on “phantom” data.
2. SNAPSHOT is used for (DBA)
a) Synonym Sanfoundry Certification Contest of the Month is Live.
b) Tablespace 100+ Subjects. Participate Now!
c) System server
6. Which of the following fixed database roles can add
d) Dynamic data replication
or remove user IDs?
View Answer
a) db_accessadmin
Answer: d b) db_securityadmin
Explanation: Snapshot gets the instance of the database c) db_setupadmin
at that time. d) db_sysadmin
View Answer
3. Isolation of the transactions is ensured by
a) Transaction management Answer: a
b) Application programmer Explanation: The database can be accessed by assigning
c) Concurrency control the roles.
d) Recovery management
7. By default sql server has ___________ isolation level
View Answer
a) READ COMMITTED
Answer: c b) READ UNCOMMITTED
Explanation: ACID properties are the properties of c) SERIALIZABLE
transactions. d) REPEATABLE READ
View Answer
advertisement
Answer: a
4. Constraint checking can be disabled in existing
Explanation: Read committed is used to commit the
_______________ and _____________ constraints so
default read operation.
that any data you modify or add to the table is not
checked against the constraint. 8. Which of the following statements is/are not true for
a) CHECK, FOREIGN KEY SQL profiler?
b) DELETE, FOREIGN KEY a) Enables you to monitor events
c) CHECK, PRIMARY KEY b) Check if rows are being inserted properly
d) PRIMARY KEY, FOREIGN KEY c) Check the performance of a stored procedure
View Answer d) ALL of the mentioned
View Answer
Answer: a
Explanation: Check and foreign constraints are used to
constraint the table data.
Page 116 of 139
Answer: c 2. A lock that allows concurrent transactions to access
Explanation: Read committed is used to commit the different rows of the same table is known as a
default read operation. a) Database-level lock
b) Table-level lock
9. Which of the following is the original purpose of SQL?
c) Page-level lock
a) To specify the syntax and semantics of SQL data
d) Row-level lock
definition language
View Answer
b) To specify the syntax and semantics of SQL
manipulation language Answer: d
c) To define the data structures Explanation: Locks are used to maintain database
d) All of the mentioned consistency.
View Answer
3. Which of the following are introduced to reduce the
Answer: d overheads caused by the log-based recovery?
Explanation: Read committed is used to commit the a) Checkpoints
default read operation. b) Indices
c) Deadlocks
10. SQL can be used to:
d) Locks
a) Create database structures only
View Answer
b) Query database data only
c) Modify database data only Answer: a
d) All of the mentioned Explanation: Checkpoints are introduced to reduce
View Answer overheads caused by the log-based recovery.
Answer: d advertisement
Explanation: In a concurrent execution of these
4. Which of the following protocols ensures conflict
transactions, it is intuitively clear that they conflict, but
serializability and safety from deadlocks?
this is a conflict not captured by our simple model. This
a) Two-phase locking protocol
situation is referred to as the phantom phenomenon,
b) Time-stamp ordering protocol
because a conflict may exist on “phantom” data.
c) Graph based protocol
Database Questions and Answers – Lock-Based d) None of the mentioned
Protocols View Answer
Answer: c Answer: c
Explanation: Locks are used to maintain database Explanation: A block that is not permitted to be written
consistency. back to the disk is called pinned.
Subscribe Now: DBMS Newsletter | Important Subjects 10. DBMS periodically suspends all processing and
Newsletters synchronizes its files and journals through the use of
a) Checkpoint facility
6. A unit of storage that can store one or more records
b) Backup facility
in a hash file organization is denoted as
c) Recovery manager
a) Buckets
d) Database change log
b) Disk pages
View Answer
c) Blocks
d) Nodes Answer: a
View Answer Explanation: DBMS periodically suspends all processing
and synchronizes its files and journals through the use
Answer: a
of Check point facility.
Explanation: Buckets are used to store one or more
records in a hash file organization. Database Questions and Answers – Snapshot Isolation
7. The file organization which allows us to read records This set of Database Multiple Choice Questions &
that would satisfy the join condition by using one block Answers (MCQs) focuses on “Snapshot Isolation”.
read is
1. Snapshot isolation is a particular type of
a) Heap file organization
______________ scheme.
b) Sequential file organization
a) Concurrency-control
c) Clustering file organization
b) Concurrency-allowance
d) Hash files organization
c) Redirection
View Answer
d) Repetition-allowance
Answer: c View Answer
Explanation: Clustering file organization allows us to
Answer: a
read records that would satisfy the join condition by
Explanation: It has gained wide acceptance in
using one block read.
Page 122 of 139
commercial and open-source systems, including Oracle, Subscribe Now: DBMS Newsletter | Important Subjects
PostgreSQL, and SQL Server. Newsletters
2. Snapshot isolation is used to give 6. Each of a pair of transactions has read data that is
a) Transaction a snapshot of the database written by the other, but there is no data written by
b) Database a snapshot of the transaction both transactions, is referred to as
c) Database a snapshot of committed values in the a) Read skew
transaction b) Update skew
d) Transaction a snapshot of the database and Database c) Write lock
a snapshot of committed values in the transaction d) None of the mentioned
View Answer View Answer
Answer: d Answer: d
Explanation: The data values in the snapshot consist Explanation: Write skew is the issue addressed here.
only of values written by committed transactions.
7. An application developer can guard against certain
3. Lost update problem is snapshot anomalies by appending a ______ clause to
a) Second update overwrites the first the SQL select query.
b) First update overwrites the second a) For update
c) The updates are lost due to conflicting problem b) For read
d) None of the mentioned c) For write
View Answer d) None of the mentioned
View Answer
Answer: a
Explanation: Lost update problem has to be resolved. Answer: a
Explanation: Adding the for update clause causes the
advertisement
system to treat data that are read as if they had been
4. Under first updater wins the system uses a updated for purposes of concurrency control.
__________ mechanism that applies only to updates.
8. Evaluate the CREATE TABLE statement:
a) Close
b) Read CREATE TABLE products
c) Locking
(product_id NUMBER(6) CONSTRAINT prod_id_pk
d) Beat
PRIMARY KEY, product_name VARCHAR2(15));
View Answer
Which statement is true regarding the PROD_ID_PK
Answer: c
constraint?
Explanation: Reads are unaffected by this, since they do
a) It would be created only if a unique index is manually
not obtain locks.
created first
5. When a transaction Ti attempts to update a data b) It would be created and would use an automatically
item, it requests a _________ on that data item. created unique index
a) Read lock c) It would be created and would use an automatically
b) Update lock created no unique index
c) Write lock d) It would be created and remains in a disabled state
d) Chain lock because no index is specified in the command
View Answer View Answer
Answer: c Answer: b
Explanation: Reads are unaffected by this, since they do Explanation: Syntax: create table table_name(name
not obtain locks. constraint).
Sanfoundry Certification Contest of the Month is Live. 5. Which statement is true regarding synonyms?
100+ Subjects. Participate Now! a) Synonyms can be created for tables but not views
b) Synonyms are used to reference only those tables
CREATE TABLE digits that are owned by another user
(id NUMBER(2), c) A public synonym and a private synonym can exist
with the same name for the same table
description VARCHAR2(15)); d) The DROP SYNONYM statement removes the
INSERT INTO digits VALUES (1,'ONE); synonym, and the status of the table on which the
synonym has been created becomes invalid
UPDATE digits SET description ='TWO'WHERE id=1; View Answer
INSERT INTO digits VALUES (2 ,'TWO'); Answer: c
Explanation: A synonym is an alias or alternate name for
COMMIT;
a table, view, sequence, or other schema object. They
DELETE FROM digits; are used mainly to make it easy for users to access
database objects owned by other users.
SELECT description FROM digits
6. SCOTT is a user in the database.
VERSIONS BETWEEN TIMESTAMP MINVALUE AND
MAXVALUE; Evaluate the commands issued BY the DBA:
What would be the outcome of the above query? 1 - CREATE ROLE mgr;
a) It would not display any values
2 - GRANT CREATE TABLE, SELECT
b) It would display the value TWO once
c) It would display the value TWO twice ON oe. orders TO mgr;
d) It would display the values ONE, TWO, and TWO
View Answer 3 - GRANT mgr, CREATE TABLE TO SCOTT;
7. OE and SCOTT are the users in the database. The Which statement describes the consequences?
ORDERS table is owned by OE. Evaluate the statements a) No SQL statement would be rolled back
issued by the DBA in the following sequence: b) Both the DELETE statements would be rolled back
c) Only the second DELETE statement would be rolled
CREATE ROLE r1; back
d) Both the DELETE statements and the UPDATE
GRANT SELECT, INSERT ON oe. orders TO r1;
statement would be rolled back
GRANT r1 TO scott; View Answer
Answer: b
Explanation: Crabbing protocol moves in a crab like
manner down the index tree.
Answer: b
Explanation: Crabbing protocol moves in a crab like
manner down the index tree.
Answer: b
Explanation: Almost all current-generation operating
systems retain complete control of virtual memory.
1. The silicon chips used for data processing are called 5. The ALU of a computer normally contains a number
a) RAM chips of high speed storage element called
b) ROM chips a) Semiconductor memory
c) Micro processors b) Registers
d) PROM chips c) Hard disks
View Answer d) Magnetic disk
View Answer
Answer: d
Explanation: PROM is Programmable Read Only Answer: b
Memory. Explanation: External control unit tells the ALU what
operation to perform on that data, and then the ALU
2. Which of the following is used for manufacturing
stores its result into an output register.
chips?
a) Control bus Sanfoundry Certification Contest of the Month is Live.
b) Control unit 100+ Subjects. Participate Now!
c) Parity unit
6. Which of the following is used only for data entry and
d) Semiconductor
storage, and never for processing?
View Answer
a) Mouse
Answer: d b) Dumb terminal
Explanation: A semiconductor is a material which has c) Micro computer
electrical conductivity between that of a conductor such d) Dedicated data entry system
as copper and that of an insulator such as glass. View Answer
advertisement Answer: a
Explanation: The basic scheme is to dump the entire
4. The magnetic storage chip used to provide non-
contents of the database to stable storage periodically—
volatile direct access storage of data and that have no
say, once per day.
moving parts are known as
a) Magnetic core memory 8. A dump of the database contents is also referred to as
b) Magnetic tape memory an _____________ dump.
c) Magnetic disk memory a) Archival
10. If ___________ are not obtained in undo operation 3. The backup is taken by
it will cause problem in undo-phase. a) Erasing all previous records
a) Higher-level lock b) Entering the new records
b) Lower-level lock c) Sending all log records from primary site to the
c) Read only lock remote backup site
d) Read write d) Sending selected records from primary site to the
View Answer remote backup site
View Answer
Answer: b
Explanation: Operations acquire lower-level locks while Answer: c
they execute, but release them when they complete; Explanation: We can achieve high availability by
the corresponding transaction must however retain a performing transaction processing at one site, called the
higher-level lock in a two-phase manner to prevent primary site, and having a remote backup site where all
concurrent transactions from executing conflicting the data from the primary site are replicated.
actions.
advertisement
Answer: d
Explanation: In this configuration, the remote backup
site continually processes redo log records as they
arrive, applying the updates locally.
Answer: a
Explanation: The problem with this scheme is that the
updates of a committed transaction may not have made
it to the backup site, when the backup site takes over
processing.