Database Multiple Choice Questions & Answers (MCQs) focuses on “Relational Database and Database Schema”.
a) Tables
b) Fields
c) Records
d) Keys
Explanation: Fields are the column of the relation or tables. Records are each row in a relation. Keys are the constraints in a relation.
2. A ________ in a table represents a relationship among a set of values.
a) Column
b) Key
c) Row
d) Entry
Explanation: Column has only one set of values. Keys are constraints and row is one whole set of attributes. Entry is just a piece of data.
3. The term _______ is used to refer to a row.
a) Attribute
b) Tuple
c) Field
d) Instance
Explanation: Tuple is one entry of the relation with several attributes which are fields.
4. The term attribute refers to a ___________ of a table.
a) Record
b) Column
c) Tuple
d) Key
Explanation: Attribute is a specific domain in the relation which has entries of all tuples.
5. For each attribute of a relation, there is a set of permitted values, called the ________ of that attribute.
a) Domain
b) Relation
c) Set
d) Schema
Explanation: The values of the attribute should be present in the domain. Domain is a set of values permitted.
6. Database __________ which is the logical design of the database,
and the database _______ which is a snapshot of the data in the database
at a given instant in time.
a) Instance, Schema
b) Relation, Schema
c) Relation, Domain
d) Schema, Instance
Explanation: Instance is an instance of time and schema is a representation.
7. Course(course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a _________
a) Relations, Attribute
b) Attributes, Relation
c) Tuple, Relation
d) Tuple, Attributes
Explanation: The relation course has a set of attributes course_id,sec_id,semester .
8. Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary)
Here the dept_name attribute appears in both the relations. Here using
common attributes in relation schema is one way of relating ___________
relations.
a) Attributes of common
b) Tuple of common
c) Tuple of distinct
d) Attributes of distinct
Explanation: Here the relations are connected by the common attributes.
9. A domain is atomic if elements of the domain are considered to be ____________ units.
a) Different
b) Indivisbile
c) Constant
d) Divisible
Explanation: None.
10. The tuples of the relations can be of ________ order.
a) Any
b) Same
c) Sorted
d) Constant
Explanation: The values only count. The order of the tuples does not matter.
This set of Database MCQs focuses on “Relational Query Operations and Relational Operators”.
1. Using which language can a user request information from a database?
a) Query
b) Relational
c) Structural
d) Compiler
Explanation: Query language is a method through which the database entries can be accessed.
2. Student(ID, name, dept name, tot_cred)
In this query which attributes form the primary key?
a) Name
b) Dept
c) Tot_cred
d) ID
Explanation: The attributes name, dept and tot_cred can have same values unlike ID.
3. Which one of the following is a procedural language?
a) Domain relational calculus
b) Tuple relational calculus
c) Relational algebra
d) Query language
Explanation: Domain and Tuple relational calculus are non-procedural language. Query language is a method through which database entries can be accessed.
4. The_____ operation allows the combining of two relations by
merging pairs of tuples, one from each relation, into a single tuple.
a) Select
b) Join
c) Union
d) Intersection
Explanation: Join finds the common tuple in the relations and combines it.
5. The result which operation contains all pairs of tuples from the
two relations, regardless of whether their attribute values match.
a) Join
b) Cartesian product
c) Intersection
d) Set difference
Explanation: Cartesian product is the multiplication of all the values in the attributes.
6. The _______operation performs a set union of two “similarly structured” tables
a) Union
b) Join
c) Product
d) Intersect
Explanation: Union just combines all the values of relations of same attributes.
7. The most commonly used operation in relational algebra for projecting a set of tuple from a relation is
a) Join
b) Projection
c) Select
d) Union
Explanation: Select is used to view the tuples of the relation with or without some constraints.
8. The _______ operator takes the results of two queries and returns only rows that appear in both result sets.
a) Union
b) Intersect
c) Difference
d) Projection
Explanation: The union operator gives the result which is the union of two queries and difference is the one where query which is not a part of second query.
9. A ________ is a pictorial depiction of the schema of a database
that shows the relations in the database, their attributes, and primary
keys and foreign keys.
a) Schema diagram
b) Relational algebra
c) Database diagram
d) Schema flow
Explanation: None.
10. The _________ provides a set of operations that take one or more relations as input and return a relation as an output.
a) Schematic representation
b) Relational algebra
c) Scheme diagram
d) Relation flow
Explanation: None.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “SQL Basics and SQL Data Definition”.
1. Which one of the following is used to define the structure of the relation, deleting relations and relating schemas?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
Explanation: Data Definition language is the language which performs all the operation in defining structure of relation.
2. Which one of the following provides the ability to query
information from the database and to insert tuples into, delete tuples
from, and modify tuples in the database?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
Explanation: DML performs the change in the values of the relation.
3.
employee name id
What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint
Explanation: Data Definition language is the language which performs all the operation in defining structure of relation.
4.
employee
What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint
Explanation: Select operation just shows the required fields of the relation. So it forms a DML.
5. The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.
a) Fixed, equal
b) Equal, variable
c) Fixed, variable
d) Variable, equal
Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be filled by either letters or spaces.
6. An attribute A of datatype varchar(20) has the value “Avi”. The
attribute B of datatype char(20) has value ”Reed”. Here attribute A has
____ spaces and attribute B has ____ spaces.
a) 3, 20
b) 20, 4
c) 20, 20
d) 3, 4
Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be filled by either letters or spaces.
7. To remove a relation from an SQL database, we use the ______ command.
a) Delete
b) Purge
c) Remove
d) Drop table
Explanation: Drop table deletes the whole structure of the relation .purge removes the table which cannot be obtained again.
8.
r; r relation
Explanation: Delete command removes the entries in the table.
instructor ’Smith’ ’Biology’ ;
What type of statement is this?
a) Query
b) DML
c) Relational
d) DDL
Explanation: The values are manipulated. So it is a DML.
10. Updates that violate __________ are disallowed.
a) Integrity constraints
b) Transaction control
c) Authorization
d) DDL constraints
Explanation: Integrity constraint has to be maintained in the entries of the relation.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Transactions”.
1. A _________ consists of a sequence of query and/or update statements.
a) Transaction
b) Commit
c) Rollback
d) Flashback
Explanation: Transaction is a set of operation until commit.
2. Which of the following makes the transaction permanent in the database?
a) View
b) Commit
c) Rollback
d) Flashback
Explanation: Commit work commits the current transaction.
3. In order to undo the work of transaction after last commit which one should be used?
a) View
b) Commit
c) Rollback
d) Flashback
Explanation: Rollback work causes the current transaction to be rolled back; that is, it undoes all the updates performed by the SQL statements in the transaction.
4. Consider the following action:
Commit; ;
What does Rollback do?
a) Undoes the transactions before commit
b) Clears all transactions
c) Redoes the transactions before commit
d) No action
Explanation: Once a transaction has executed commit work, its effects can no longer be undone by rollback work.
5. In case of any shut down during transaction before commit which of the following statement is done automatically?
a) View
b) Commit
c) Rollback
d) Flashback
Explanation: Once a transaction has executed commit work, its effects can no longer be undone by rollback work.
6. In order to maintain the consistency during transactions, database provides
a) Commit
b) Atomic
c) Flashback
d) Retain
Explanation: By atomic, either all the effects of the transaction are reflected in the database, or none are (after rollback).
7. Transaction processing is associated with everything below except
a) Conforming an action or triggering a response
b) Producing detail summary or exception report
c) Recording a business activity
d) Maintaining a data
Explanation: None.
8. A transaction completes its execution is said to be
a) Committed
b) Aborted
c) Rolled back
d) Failed
Explanation: A complete transaction always commits.
9. Which of the following is used to get back all the transactions back after rollback?
a) Commit
b) Rollback
c) Flashback
d) Redo
Explanation: None.
10. ______ will undo all statements up to commit?
a) Transaction
b) Flashback
c) Rollback
d) Abort
Explanation: Flashback will undo all the statements and Abort will terminate the operation.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Relational Algebra”.
1. Relational Algebra is a __________ query language that takes two
relations as input and produces another relation as an output of the
query.
a) Relational
b) Structural
c) Procedural
d) Fundamental
Explanation: This language has fundamental and other operations which are used on relations.
2. Which of the following is a fundamental operation in relational algebra?
a) Set intersection
b) Natural join
c) Assignment
d) None of the mentioned
Explanation: The fundamental operations are select, project, union, set difference, Cartesian product, and rename.
3. Which of the following is used to denote the selection operation in relational algebra?
a) Pi (Greek)
b) Sigma (Greek)
c) Lambda (Greek)
d) Omega (Greek)
Explanation: The select operation selects tuples that satisfy a given predicate.
4. For select operation the ________ appear in the subscript and the
___________ argument appears in the paranthesis after the sigma.
a) Predicates, relation
b) Relation, Predicates
c) Operation, Predicates
d) Relation, Operation
Explanation: None.
5. The ___________ operation, denoted by −, allows us to find tuples that are in one relation but are not in another.
a) Union
b) Set-difference
c) Difference
d) Intersection
Explanation: The expression r − s produces a relation containing those tuples in r but not in s.
6. Which is a unary operation:
a) Selection operation
b) Primitive operation
c) Projection operation
d) Generalized selection
Explanation: Generalization Selection takes only one argument for operation.
7. Which is a join condition contains an equality operator:
a) Equijoins
b) Cartesian
c) Natural
d) Left
Explanation: None.
8. In precedence of set operators, the expression is evaluated from
a) Left to left
b) Left to right
c) Right to left
d) From user specification
Explanation: The expression is evaluated from left to right according to the precedence.
9. Which of the following is not outer join?
a) Left outer join
b) Right outer join
c) Full outer join
d) All of the mentioned
Explanation: The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.
10. The assignment operator is denoted by
a) ->
b) <-
c) =
d) ==
Explanation: The result of the expression to the right of the ← is assigned to the relation variable on the left of the ←.
This set of Database test focuses on “Tuple Relational Calculus and Domain Relational Calculus”.
1. Find the ID, name, dept name, salary for instructors whose salary is greater than $80,000 .
a) {t | t ε instructor ∧ t[salary] > 80000}
b) Э t ∈ r (Q(t))
c) {t | Э s ε instructor (t[ID] = s[ID]∧ s[salary] > 80000)}
d) None of the mentioned
Explanation: This expression is in tuple relational format.
2. A query in the tuple relational calculus is expressed as:
a) {t | P() | t}
b) {P(t) | t }
c) {t | P(t)}
d) All of the mentioned
Explanation: The tuple relational calculus, is a nonprocedural query language. It describes the desired information without giving a specific procedure for obtaining that information.
3.
t Э s ε instructor tname sname ∧ Э u ε department udept name sdept name ∧ ubuilding “Watson”
Which of the following best describes the query?
a) Finds the names of all instructors whose department is in the Watson building
b) Finds the names of all department is in the Watson building
c) Finds the name of the dapartment whose instructor and building is Watson
d) Returns the building name of all the departments
Explanation: This query has two “there exists” clauses in our tuple-relational-calculus expression, connected by and (∧).
4. Which of the following symbol is used in the place of except?
a) ^
b) V
c) ¬
d) ~
Explanation: The query ¬P negates the value of P.
5. “Find all students who have taken all courses offered in the
Biology department.” The expressions that matches this sentence is :
a) Э t ε r (Q(t))
b) ∀ t ε r (Q(t))
c) ¬ t ε r (Q(t))
d) ~ t ε r (Q(t))
Explanation: ∀ is used denote “for all” in SQL.
6. Which of the following is the comparison operator in tuple relational calculus
a) ⇒
b) =
c) ε
d) All of the mentioned
Explanation: The comparison operators are (<, ≤, =, =, >, ≥).
7. An expression in the domain relational calculus is of the form
a) {P(x1, x2, . . . , xn) | < x1, x2, . . . , xn > }
b) {x1, x2, . . . , xn | < x1, x2, . . . , xn > }
c) { x1, x2, . . . , xn | x1, x2, . . . , xn}
d) {< x1, x2, . . . , xn > | P(x1, x2, . . . , xn)}
Explanation: Here x1, x2, . . . , xn represent domain variables. P represents a formula composed of atoms, as was the case in the tuple relational calculus.
8. Find the names of all instructors in the Physics department together with the course id of all courses they teach:
a)
{< c > | Э s (< c, a, s, y, b, r, t >ε section ∧s = “Fall” ∧ y = “2009” ∨Эu (< c, a, s, y, b, r, t >ε section ∧s = “Spring” ∧ y = “2010”
b)
{< n, c > | Э i, a (< i, c, a, s, y > ε teaches ∧ Э d, s (< i, n, d, s > ε instructor ∧ d = “Physics”))}
c)
{< n > | Э i, d, s (< i, n, d, s > ε instructor ∧ s > 80000)}
{< i, n, d, s > | < i, n, d, s > ε instructor ∧ s > 80000}
Explanation: None.
9. In domain relaional calculus “there exist” can be expressed as
a) (P1(x))
b) (P1(x)) Э x
c) V x (P1(x))
d) Э x (P1(x))
Explanation:Э is used to denote “some” values in relational calculus.
10. A set of possible data values is called
a) Attribute
b) Degree
c) Tuple
d) Domain
Explanation: None.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “The Entity-Relationship Model”.
1. An ________ is a set of entities of the same type that share the same properties, or attributes.
a) Entity set
b) Attribute set
c) Relation set
d) Entity model
Explanation: An entity is a “thing” or “object” in the real world that is distinguishable from all other objects.
2. Entity is a _________
a) Object of relation
b) Present working model
c) Thing in real world
d) Model of relation
Explanation: For example, each person in a university is an entity.
3. The descriptive property possessed by each entity set is _________
a) Entity
b) Attribute
c) Relation
d) Model
Explanation: Possible attributes of the instructor entity set are ID, name, dept name, and salary.
4. The function that an entity plays in a relationship is called that entity’s _____________
a) Participation
b) Position
c) Role
d) Instance
Explanation: A relationship is an association among several entities.
5. The attribute name could be structured as an attribute consisting of first name, middle initial, and last name. This type of attribute is called
a) Simple attribute
b) Composite attribute
c) Multivalued attribute
d) Derived attribute
Explanation: Composite attributes can be divided into subparts (that is, other attributes).
6. The attribute AGE is calculated from DATE_OF_BIRTH. The attribute AGE is
a) Single valued
b) Multi valued
c) Composite
d) Derived
Explanation: The value for this type of attribute can be derived from the values of other related attributes or entities.
7. Not applicable condition can be represented in relation entry as
a) NA
b) 0
c) NULL
d) Blank Space
Explanation: NULL always represents that the value is not present.
8. Which of the following can be a multivalued attribute?
a) Phone_number
b) Name
c) Date_of_birth
d) All of the mentioned
Explanation: Name and Date_of_birth cannot hold more than 1 value.
9. Which of the following is a single valued attribute
a) Register_number
b) Address
c) SUBJECT_TAKEN
d) Reference
Explanation: None.
10. In a relation between the entities the type and condition of the
relation should be specified. That is called as______attribute.
a) Desciptive
b) Derived
c) Recursive
d) Relative
Explanation: Consider the entity sets student and section, which participate in a relationship set takes. We may wish to store a descriptive attribute grade with the relationship to record the grade that a student got in the class.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Extended E-R Features”.
1. The entity set person is classified as student and employee. This process is called _________
a) Generalization
b) Specialization
c) Inheritance
d) Constraint generalization
Explanation: The process of designating subgroupings within an entity set is called specialization.
2. Which relationship is used to represent a specialization entity?
a) ISA
b) AIS
c) ONIS
d) WHOIS
Explanation: In terms of an E-R diagram, specialization is depicted by a hollow arrow-head pointing from the specialized entity to the other entity.
3. The refinement from an initial entity set into successive levels
of entity subgroupings represents a ________ design process in which
distinctions are made explicit.
a) Hierarchy
b) Bottom-up
c) Top-down
d) Radical
Explanation: The design process may also proceed in a bottom-up manner, in which multiple entity sets are synthesized into a higher-level entity set on the basis of common features.
4. There are similarities between the instructor entity set and the
secretary entity set in the sense that they have several attributes that
are conceptually the same across the two entity sets: namely, the
identifier, name, and salary attributes. This process is called
a) Commonality
b) Specialization
c) Generalization
d) Similarity
Explanation: Generalization is used to emphasize the similarities among lower-level entity sets and to hide the differences.
5. If an entity set is a lower-level entity set in more than one ISA relationship, then the entity set has
a) Hierarchy
b) Multilevel inheritance
c) Single inheritance
d) Multiple inheritance
Explanation: The attributes of the higher-level entity sets are said to be inherited by the lower-level entity sets.
6. A _____________ constraint requires that an entity belong to no more than one lower-level entity set.
a) Disjointness
b) Uniqueness
c) Special
d) Relational
Explanation: For example, student entity can satisfy only one condition for the student type attribute; an entity can be either a graduate student or an undergraduate student, but cannot be both.
7. Consider the employee work-team example, and assume that certain
employees participate in more than one work team. A given employee may
therefore appear in more than one of the team entity sets that are lower
level entity sets of employee. Thus, the generalization is
_____________
a) Overlapping
b) Disjointness
c) Uniqueness
d) Relational
Explanation: In overlapping generalizations, the same entity may belong to more than one lower-level entity set within a single generalization.
8. The completeness constraint may be one of the following: Total
generalization or specialization, Partial generalization or
specialization. Which is the default?
a) Total
b) Partial
c) Should be specified
d) Cannot be determined
Explanation: Partial generalization or specialization – Some higher-level entities may not belong to any lower-level entity set.
9. Functional dependencies are a generalization of
a) Key dependencies
b) Relation dependencies
c) Database dependencies
d) None of the mentioned
Explanation: The subclasses are combined to form the superclass.
10. Which of the following is another name for a weak entity?
a) Child
b) Owner
c) Dominant
d) All of the mentioned
Explanation: A parent may be called as a strong entity.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Normal Forms”.
1. In the __________ normal form, a composite attribute is converted to individual attributes.
a) First
b) Second
c) Third
d) Fourth
Explanation: The first normal form is used to eliminate the duplicate information.
2. A table on the many side of a one to many or many to many relationship must:
a) Be in Second Normal Form (2NF)
b) Be in Third Normal Form (3NF)
c) Have a single attribute key
d) Have a composite key
Explanation: The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key.
3. Tables in second normal form (2NF):
a) Eliminate all hidden dependencies
b) Eliminate the possibility of a insertion anomalies
c) Have a composite key
d) Have all non key fields depend on the whole primary key
Explanation: The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key.
4. Which-one ofthe following statements about normal forms is FALSE?
a) BCNF is stricter than 3 NF
b) Lossless, dependency -preserving decomposition into 3 NF is always possible
c) Loss less, dependency – preserving decomposition into BCNF is always possible
d) Any relation with two attributes is BCNF
Explanation: We say that the decomposition is a lossless decomposition if there is no loss of information by replacing r (R) with two relation schemas r1(R1) andr2(R2).
5. Functional Dependencies are the types of constraints that are based on______
a) Key
b) Key revisited
c) Superset key
d) None of the mentioned
Explanation: Key is the basic element needed for the constraints.
6. Which is a bottom-up approach to database design that design by examining the relationship between attributes:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
Explanation: Normalisation is the process of removing redundancy and unwanted data.
7. Which forms simplifies and ensures that there are minimal data aggregates and repetitive groups:
a) 1NF
b) 2NF
c) 3NF
d) All of the mentioned
Explanation: The first normal form is used to eliminate the duplicate information.
8. Which forms has a relation that possesses data about an individual entity:
a) 2NF
b) 3NF
c) 4NF
d) 5NF
Explanation: A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X \twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof.
9. Which forms are based on the concept of functional dependency:
a) 1NF
b) 2NF
c) 3NF
d) 4NF
Explanation: The table is in 3NF if every non-prime attribute of R is non-transitively dependent (i.e. directly dependent) on every superkey of R.
10.
Empdt1(empcode, name, street, city, state, pincode).
For any pincode, there is only one city and state. Also, for given
street, city and state, there is just one pincode. In normalization
terms, empdt1 is a relation in
a) 1 NF only
b) 2 NF and hence also in 1 NF
c) 3NF and hence also in 2NF and 1NF
d) BCNF and hence also in 3NF, 2NF and 1NF
Explanation: The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key.
This set of Database online quiz focuses on “Using Multivalued Dependencies”.
1. The normal form which satisfies multivalued dependencies and which is in BCNF is
a) 4 NF
b) 3 NF
c) 2 NF
d) All of the mentioned
Explanation: Fourth normal form is more restrictive than BCNF.
2. Which of the following is a tuple-generating dependencies?
a) Functional dependency
b) Equality-generating dependencies
c) Multivalued dependencies
d) Non-functional dependency
Explanation: Multivalued dependencies, do not rule out the existence of certain tuples. Instead, they require that other tuples of a certain form be present in the relation.
3. The main task carried out in the __________ is to remove repeating attributes to separate tables.
a) First Normal Form
b) Second Normal Form
c) Third Normal Form
d) Fourth Normal Form
Explanation: Multivalued dependencies, do not rule out the existence of certain tuples. Instead, they require that other tuples of a certain form be present in the relation.
4. Which of the normal form is based on multivalued dependencies?
a) First
b) Second
c) Third
d) Fourth
Explanation: Multivalued dependencies, do not rule out the existence of certain tuples. Instead, they require that other tuples of a certain form be present in the relation.
5. Which forms has a relation that possesses data about an individual entity?
a) 2NF
b) 3NF
c) 4NF
d) 5NF
Explanation: A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X \twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof.
6. If a multivalued dependency holds and is not implied by the
corresponding functional dependency, it usually arises from one of the
following sources.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) Both A many-to-many relationship set and A multivalued attribute of an entity set
Explanation: For a many-to-many relationship set each related entity set has its own schema and there is an additional schema for the relationship set. For a multivalued attribute, a separate schema is created consisting of that attribute and the primary key of the entity set.
7. Which of the following has each related entity set has its own
schema and there is an additional schema for the relationship set?
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) None of the mentioned
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional dependency, it usually arises from this source.
8. In which of the following, a separate schema is created consisting of that attribute and the primary key of the entity set.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) None of the mentioned
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional dependency, it usually arises from this source.
9. Fifth Normal form is concerned with
a) Functional dependency
b) Multivalued dependency
c) Join dependency
d) Domain-key
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional dependency, it usually arises from this source.
10. In 2NF
a) No functional dependencies (FDs) exist
b) No multivalued dependencies (MVDs) exist
c) No partial FDs exist
d) No partial MVDs exist
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional dependency, it usually arises from this source.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Web Fundamentals”.
1. Which of the following is a valid uniform resource locator?
a) http://www.acm.org/sigmod
b) www.google.com
c) www.ann.in
d) http:/www.acm.org/sigmod/
Explanation: A uniform resource locator (URL) is a globally unique name for each document that can be accessed on the Web.
2. http://www.google.com/search?q=silberschatz
In the above URL which one is the argument which is used for processing of the URL?
a) google
b) google.com
c) search
d) q=silberschatz
Explanation: Argument is always placed after ? symbol.
3. HTTP defines two ways in which values entered by a user at the
browser can be sent to the Web server. The _____ method encodes the
values as part of the URL.
a) Post
b) Get
c) Read
d) Argument
Explanation: For example, if the Google search page used a form with an input parameter
named q with the get method, and the user typed in the string “silberschatz” and submitted the form, the browser would request the following URL from the Web server: http://www.google.com/search?q=silberschatz.
4. A __________ is a program running on the server machine, which
accepts requests from a Web browser and sends back results in the form
of HTML documents.
a) HTML
b) HTTP
c) Web Server
d) Web browser
Explanation: The browser and Web server communicate via HTTP. Web servers provide powerful features, beyond the simple transfer of documents.
5. The application program typically communicates with a database
server, through ___________ or other protocols, in order to get or store
data.
a) JDBC
b) ODBC
c) All of the mentioned
d) None of the mentioned
Explanation: The common gateway interface (CGI) standard defines how the Web server communicates with application programs.
6. This extra information is usually maintained in the form of a _________ at the client.
a) Cookie
b) History
c) Remainder
d) None of the mentioned
Explanation: A cookie is simply a small piece of text containing identifying information and with an associated name.
7. Which of the following is not true about HTML ?
a) <meta>…</meta>
b) <meta…./>
c) <metadata>…</metadata>
d) <metadata name=”” />
Explanation: Meta data is the data about data which is included in the meta data tag.
8. Html code contains:
a) Tags
b) Attributes
c) Elements
d) All of the mentioned
Explanation: <> are tags,size is a attribute.
9. Html document must always be saved with:
a) .html
b) .htm
c) .doc
d) Both .html & .htm
Explanation: .doc is used only for the word document format.
10. How many levels of headings are in html:
a) 2
b) 7
c) 6
d) 4
Explanation: The heading levels are h1,h2,h3,h4,h5,h6.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Application Performance”.
1. The indirect change of the values of a variable in one module by another module is called
a) Internal change
b) Inter-module change
c) Side effect
d) Side-module update
Explanation: The module of the search tree and the flow is directed by its values.
2. Which of the following data structure is not linear data structure?
a) Arrays
b) Linked lists
c) Arrays & Linked lists
d) None of the mentioned
Explanation: Both array and linked lists are in data structure concepts.
3. Which of the following data structure is linear data structure?
a) Trees
b) Graphs
c) Arrays
d) None of the mentioned
Explanation: Tree and graphs are not linear.
4. Which of the following criterion is NOT written using the proper syntax?
a) “Haris”
b) <500
c) NO VALUE
d) Between #1/1/2000# and #12/31/2000#
Explanation: NO VALUE cannot be specified.
5. The operation of processing each element in the list is known as
a) Sorting
b) Merging
c) Inserting
d) Traversal
Explanation: There are several types of traversals.
6. Finding the location of the element with a given value is:
a) Traversal
b) Search
c) Sort
d) None of the mentioned
Explanation: Search is performed by traversing through the tree.
7. Arrays are best data structures
a) For relatively permanent collections of data
b) For the size of the structure and the data in the structure are constantly changing
c) All of the mentioned
d) None of the mentioned
Explanation: The operator tree has a tree like format where the evaluation starts from root of the tree.
8. Linked lists are best suited
a) For relatively permanent collections of data
b) For the size of the structure and the data in the structure are constantly changing
c) All of the mentioned
d) None of the mentioned
Explanation: A linked list is a data structure consisting of a group of nodes which together represent a sequence.
9. Each array declaration need not give, implicitly or explicitly, the information about
a) The name of array
b) The data type of array
c) The first data from the set to be stored
d) The index set of the array
Explanation: The operator tree has a tree like format where the evaluation starts from root of the tree.
10. The elements of an array are stored successively in memory cells because
a) By this way computer can keep track only the address of the first
element and the addresses of other elements can be calculated
b) The architecture of computer memory does not allow arrays to store other than serially
c) All of the mentioned
d) None of the mentioned
Explanation: Memory is always allotted in order.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Physical Storage Media”.
1. Which of the following is a physical storage media?
a) Tape Storage
b) Optical Storage
c) Flash memory
d) All of the mentioned
Explanation: The storage media are classified by the speed with which data can be accessed, by the cost per unit of data to buy the medium, and by the medium’s reliability.
2. The _________ is the fastest and most costly form of storage,
which is relatively small; its use is managed by the computer system
hardware.
a) Cache
b) Disk
c) Main memory
d) Flash memory
Explanation: Cache storage is easy to access because it is closer to the processor.
3. Which of the following stores several gigabytes of data but usually lost when power failure?
a) Flash memory
b) Disk
c) Main memory
d) Secondary memory
Explanation: The contents of main memory are usually lost if a power failure or system crash occurs.
4. The flash memory storage used are
a) NOR Flash
b) OR Flash
c) AND Flash
d) All of the mentioned
Explanation: NAND flash has a much higher storage capacity for a given cost, and is widely used for data storage in devices such as cameras, music players, and cell phones.
5. __________ is increasingly being used in server systems to improve
performance by caching frequently used data, since it provides faster
access than disk, with larger storage capacity than main memory.
a) Flash memory
b) Disk
c) Main memory
d) Secondary memory
Explanation: Flash memory is of two types – NAND and NOR.
6. Which is the cheapest memory device in terms of costs/ bit?
a) Semiconductor memory
b) Magnetic disks
c) Compact disks
d) Magnetic tapes
Explanation: Compact disk is used for easy storage at lower cost.
7. The primary medium for the long-term online storage of data is the
__________ where the entire database is stored on magnetic disk.
a) Semiconductor memory
b) Magnetic disks
c) Compact disks
d) Magnetic tapes
Explanation: The system must move the data from disk to main memory so that they can be accessed.
8. Optical disk _______ systems contain a few drives and numerous
disks that can be loaded into one of the drives automatically (by a
robot arm) on demand.
a) Tape Storage
b) Jukebox
c) Flash memory
d) All of the mentioned
Explanation: The most popular form of optical disks are CD and DVD.
9. There are “record-once” versions of the compact disk and digital
video disk, which can be written only once; such disks are also called
__________ disks.
a) Write-once, read-many (WORM)
b) CD-R
c) DVD-W
d) CD-ROM
Explanation: There are also “multiple-write” versions of compact disk (called CD-RW) and digital video disk (DVD-RW, DVD+RW, and DVD-RAM), which can be written multiple times.
10. Tape storage is referred to as __________ storage.
a) Direct-access
b) Random-access
c) Sequential-access
d) All of the mentioned
Explanation: Tape storage is used primarily for backup and archival data.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “File Organisations”.
1. Which level of RAID refers to disk mirroring with block striping?
a) RAID level 1
b) RAID level 2
c) RAID level 0
d) RAID level 3
Explanation: RAID (redundant array of independent disks) is a way of storing the same data in different places (thus, redundantly) on multiple hard disks.
2. A unit of storage that can store one or more records in a hash file organization is denoted as
a) Buckets
b) Disk pages
c) Blocks
d) Nodes
Explanation: A unit of storage that can store one or more records in a hash file organization is denoted as buckets.
3. The file organization which allows us to read records that would satisfy the join condition by using one block read is
a) Heap file organization
b) Sequential file organization
c) Clustering file organization
d) Hash file organization
Explanation: All systems in the cluster share a common file structure via NFS, but not all disks are mounted on all other systems.
4. What are the correct features of a distributed database?
a) Is always connected to the internet
b) Always requires more than three machines
c) Users see the data in one global schema.
d) Have to specify the physical location of the data when an update is done
Explanation: Users see the data in one global schema.
5. Each tablespace in an Oracle database consists of one or more files called
a) Files
b) name space
c) datafiles
d) PFILE
Explanation: A data file is a computer file which stores data to use by a computer application or system.
6. The management information system (MIS) structure with one main computer system is called a
a) Hierarchical MIS structure
b) Distributed MIS structure
c) Centralized MIS structure
d) Decentralized MIS structure
Explanation: Structure of MIS may be understood by looking at the physical components of the information system in an organization.
7. A top-to-bottom relationship among the items in a database is established by a
a) Hierarchical schema
b) Network schema
c) Relational schema
d) All of the mentioned
Explanation: A hierarchical database model is a data model in which the data is organized into a tree-like structure. The structure allows representing information using parent/child relationships.
8. Choose the RDBMS which supports full fledged client server application development
a) dBase V
b) Oracle 7.1
c) FoxPro 2.1
d) Ingress
Explanation: RDBMS is Relational Database Management System.
9. One approach to standardization storing of data?
a) MIS
b) Structured programming
c) CODASYL specification
d) None of the mentioned
Explanation: CODASYL is an acronym for “Conference on Data Systems Languages”.
10. The highest level in the hierarchy of data organization is called
a) Data bank
b) Data base
c) Data file
d) Data record
Explanation: Database is a collection of all tables which contains the data in form of fields.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Ordered Indices”.
1. In ordered indices the file containing the records is sequentially
ordered, a ___________ is an index whose search key also defines the
sequential order of the file.
a) Clustered index
b) Structured index
c) Unstructured index
d) Nonclustered index
Explanation: Clustering index are also called primary indices; the term primary index may appear to denote an index on a primary key, but such indices can in fact be built on any search key.
2. Indices whose search key specifies an order different from the sequential order of the file are called ___________ indices.
a) Nonclustered
b) Secondary
c) All of the mentioned
d) None of the mentioned
Explanation: Nonclustering index is also called secondary indices.
3. An ____________ consists of a search-key value and pointers to one or more records with that value as their search-key value.
a) Index entry
b) Index hash
c) Index cluster
d) Index map
Explanation: The pointer to a record consists of the identifier of a disk block and an offset within the disk block to identify the record within the block.
4. In a _______ clustering index, the index record contains the
search-key value and a pointer to the first data record with that
search-key value and the rest of the records will be in the sequential
pointers.
a) Dense
b) Sparse
c) Straight
d) Continuous
Explanation: In a dense nonclustering index, the index must store a list of pointers to all records with the same search-key value.
5. In a __________ index, an index entry appears for only some of the search-key values.
a) Dense
b) Sparse
c) Straight
d) Continuous
Explanation: Sparse indices can be used only if the relation is stored in sorted order of the search key, that is if the index is a clustering index.
6. Incase the indices values are larger, index is created for these values of the index. This is called
a) Pointed index
b) Sequential index
c) Multilevel index
d) Multiple index
Explanation: Indices with two or more levels are called multilevel indices.
7. A search key containing more than one attribute is referred to as a _________ search key.
a) Simple
b) Composite
c) Compound
d) Secondary
Explanation: The structure of the index is the same as that of any other index, the only difference being that the search key is not a single attribute, but rather is a list of attributes.
8. In B+ tree the node which points to another node is called
a) Leaf node
b) External node
c) Final node
d) Internal node
Explanation: Nonleaf nodes are also referred to as internal nodes.
9. Insertion of a large number of entries at a time into an index is referred to as __________ of the index.
a) Loading
b) Bulk insertion
c) Bulk loading
d) Increase insertion
Explanation: Bulk loading is used to improve efficiency and scalability.
10. While inserting the record into the index, if the search-key value does not appear in the index.
a) The system adds a pointer to the new record in the index entry
b) The system places the record being inserted after the other records with the same search-key values
c) The system inserts an index entry with the search-key value in the index at the appropriate position
d) None of the mentioned
Explanation: If the index entry stores pointers to all records with the same search key value, the system adds a pointer to the new record in the index entry.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Bitmap Indices”.
1. Bitmap indices are a specialized type of index designed for easy querying on ___________
a) Bit values
b) Binary digits
c) Multiple keys
d) Single keys
Explanation: Each bitmap index is built on a single key.
2. A _______ on the attribute A of relation r consists of one bitmap for each value that A can take.
a) Bitmap index
b) Bitmap
c) Index
d) Array
Explanation: A bitmap is simply an array of bits.
3.
r gender ’f’ income level ’L2’;
In this selection, we fetch the bitmaps for gender value f and the
bitmap for income level value L2, and perform an ________ of the two
bitmaps.
a) Union
b) Addition
c) Combination
d) Intersection
Explanation: We compute a new bitmap where bit i has value 1 if the ith bit of the two bitmaps are both 1, and has a value 0 otherwise.
4. To identify the deleted records we use the ______________
a) Existence bitmap
b) Current bitmap
c) Final bitmap
d) Deleted bitmap
Explanation: The bitmaps which are deleted are denoted by 0.
5. Bitmaps can be used as a compressed storage mechanism at the leaf
nodes of ________ for those values that occur very frequently.
a) B-trees
b) B+-trees
c) Bit trees
d) Both B-trees and B+-trees
Explanation: Bitmaps are combined and stored in a B+ tree.
6. Bitmaps can be combined with regular B+-tree indices for relations
where a few attribute values are extremely common, and other values
also occur, but much less frequently.
a) Bitmap, B-tree
b) Bitmap, B+tree
c) B-tree, Bitmap
d) B+tree, Bitmap
Explanation: Bitmaps are combined and stored in a B+ tree.
7. In a B+-tree index ______ for each value, we would normally
maintain a list of all records with that value for the indexed
attribute.
a) Leaf
b) Node
c) Root
d) Link
Explanation: Bitmaps are combined and stored in a B+ tree.
8. A tablespace is further broken down into ________
a) Tablespace
b) Segments
c) Extents
d) Blocks
Explanation: Segment names are used in create table and create index commands to place tables or indexes on specific database devices.
9. In ordered indices the file containing the records is sequentially
ordered, a ___________ is an index whose search key also defines the
sequential order of the file.
a) Clustered index
b) Structured index
c) Unstructured index
d) Nonclustered index
Explanation: Clustering index are also called primary indices; the term primary index may appear to denote an index on a primary key, but such indices can in fact be built on any search key.
10. Indices whose search key specifies an order different from the sequential order of the file are called ___________ indices.
a) Nonclustered
b) Secondary
c) All of the mentioned
d) None of the mentioned
Explanation: Nonclustering index are also called secondary indices.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Query Processing”.
1. A collection of data designed to be used by different people is called a/an
a) Organization
b) Database
c) Relationship
d) Schema
Explanation: Database is a collection of related tables.
2. Which of the following is the oldest database model?
a) Relational
b) Deductive
c) Physical
d) Network
Explanation: The network model is a database model conceived as a flexible way of representing objects and their relationships.
3. Which of the following schemas does define a view or views of the database for particular users?
a) Internal schema
b) Conceptual schema
c) Physical schema
d) External schema
Explanation: An externally-defined schema can provide access to tables that are managed on any PostgreSQL, Microsoft SQL Server, SAS, Oracle, or MySQL database.
4. Which of the following is an attribute that can uniquely identify a row in a table?
a) Secondary key
b) Candidate key
c) Foreign key
d) Alternate key
Explanation: A Candidate Key can be any column or a combination of columns that can qualify as unique key in database.
5. Which of the following are the process of selecting the data storage and data access characteristics of the database?
a) Logical database design
b) Physical database design
c) Testing and performance tuning
d) Evaluation and selecting
Explanation: The physical design of the database optimizes performance while ensuring data integrity by avoiding unnecessary data redundancies.
6. Which of the following terms does refer to the correctness and completeness of the data in a database?
a) Data security
b) Data constraint
c) Data independence
d) Data integrity
Explanation: ACID property is satisfied by transaction in database.
7. The relationship between DEPARTMENT and EMPLOYEE is a
a) One-to-one relationship
b) One-to-many relationship
c) Many-to-many relationship
d) Many-to-one relationship
Explanation: One entity department is related to several employees.
8. A table can be logically connected to another table by defining a
a) Super key
b) Candidate key
c) Primary key
d) Unique key
Explanation: A superkey is a combination of attributes that can be uniquely used to identify a database record.
9. If the state of the database no longer reflects a real state of
the world that the database is supposed to capture, then such a state is
called
a) Consistent state
b) Parallel state
c) Durable state
d) Inconsistent state
Explanation: SQL data consistency is that whenever a transaction is performed, it sees a consistent database.
10. Ensuring isolation property is the responsibility of the
a) Recovery-management component of the DBMS
b) Concurrency-control component of the DBMS
c) Transaction-management component of the DBMS
d) Buffer management component in DBMS
Explanation: Concurrency control ensures that correct results for concurrent operations are generated while getting those results as quickly as possible.
This set of Database Questions and Answers for Entrance exams focuses on “Transformation of Relational Expressions”.
1. Consider the following relational schemes for a library database:
Book Title Author Catalog_no Publisher Price Collection Title Author Catalog_no the following functional dependencies: I Title Author Catalog_no II Catalog_no Title Author Publisher III Publisher Title Price
Assume {Author, Title} is the key for both schemes. Which of the following statements is true?
a) Both Book and Collection are in BCNF
b) Both Book and Collection are in 3NF only
c) Book is in 2NF and Collection is in 3NF
d) Both Book and Collection are in 2NF only
Explanation: The relation Collection is in BCNF: Its given that {Author, Title} is the key and there is only one functional dependency (FD) applicable to the relation Collection {i.e. Title Author –> Catalog_no}.
2. Let R(A,B,C,D,E,P,G) be a relational schema in which the following FDs are known to hold:
ABCD DEP CE PC BG
The relation schema R is
a) in BCNF
b) in 3NF, but not in BCNF
c) in 2NF, but not in 3NF
d) not in 2NF
Explanation: From the closure set of attributes we can see that the key for the relation is AB. The FD B->G is a partial dependency, hence it is not in 2NF.
3. Which of the following is/are false for RAW mode of FOR XML?
a) XMLSCHEMA option does not returns an in-line XSD schema
b) BINARY BASE32 returns the binary data in base32-encoded format
c) Each row in the query result is transformed into an XML element
d) None of the mentioned
Explanation: XML was designed to transport and store data.
4. ___________ refers to the ability of the system to recover
committed transaction updates if either the system or the storage media
fails.
a) Isolation
b) Atomicity
c) Consistency
d) Durability
Explanation: In database systems, durability is the ACID property which guarantees that transactions that have committed will survive permanently.
5. Which utilities can we use to export data from sql server to a text file?
a) DTS export wizard
b) BCP
c) ISQL
d) DTS export wizard and BCP
Explanation: The bcp utility bulk copies data between an instance of Microsoft SQL Server and a data file in a user-specified format.
6. You have a column that will only contain values from 0 to 256. What is the most economical data type to use for the column?
a) TINYINT
b) SMALLINT
c) INT
d) DECIMAL(1)
Explanation: The bcp utility bulk copies data between an instance of Microsoft SQL Server and a data file in a user-specified format.
7. Problems occurs if we don’t implement a proper locking strategy
a) Dirty reads
b) Phantom reads
c) Lost updates
d) Unrepeatable reads
Explanation: Phantom reads occur when an insert or delete action is performed against a row that belongs to a range of rows being read by a transaction.
8. Which of the following fixed database roles can add or remove user IDs?
a) db_accessadmin
b) db_securityadmin
c) db_setupadmin
d) db_sysadmin
Explanation: The db_accessadmin role manages security, but handles access to the database, as the name implies.
9. By default sql server has ___________ isolation level
a) READ COMMITTED
b) READ UNCOMMITTED
c) SERIALIZABLE
d) REPEATABLE READ
Explanation: READ UNCOMMITTED is the most optimistic concurrency isolation option available in SQL Server.
10. Which of the following pair of regular expression are not equivalent?
a) 1(01)* and (10)*1
b) x(xx)* and (xx)*x
c) (ab)* and a*b*
d) x+ and x*x+
Explanation: (ab)*=(a*b*)*.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Transaction Concept”.
1. Consider money is transferred from (1)account-A to account-B and
(2) account-B to account-A. Which of the following form a transaction?
a) Only 1
b) Only 2
c) Both 1 and 2 individually
d) Either 1 or 2
Explanation: The term transaction refers to a collection of operations that form a single logical unit of work.
2. A transaction is delimited by statements (or function calls) of the form __________
a) Begin transaction and end transaction
b) Start transaction and stop transaction
c) Get transaction and post transaction
d) Read transaction and write transaction
Explanation: The transaction consists of all operations executed between the begin transaction and end transaction.
3. Identify the characteristics of transactions
a) Atomicity
b) Durability
c) Isolation
d) All of the mentioned
Explanation: Because of the above three properties, transactions are an ideal way of structuring interaction with a database.
4. Which of the following has “all-or-none” property?
a) Atomicity
b) Durability
c) Isolation
d) All of the mentioned
Explanation: Either all operations of the transaction are reflected properly in the database, or none are.
5. The database system must take special actions to ensure that
transactions operate properly without interference from concurrently
executing database statements. This property is referred to as
a) Atomicity
b) Durability
c) Isolation
d) All of the mentioned
Explanation: Even though multiple transactions may execute concurrently, the system guarantees that, for every pair of transactions Ti and Tj, it appears to Ti that either Tj finished execution before Ti started or Tj started execution after Ti finished.
6. The property of a transaction that persists all the crashes is
a) Atomicity
b) Durability
c) Isolation
d) All of the mentioned
Explanation: After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures.
7. __________ states that only valid data will be written to the database.
a) Consistency
b) Atomicity
c) Durability
d) Isolation
Explanation: If for some reason, a transaction is executed that violates the database’s consistency rules, the entire transaction will be rolled back and the database will be restored to a state consistent with those rules.
8. Transaction processing is associated with everything below except
a) Producing detail summary or exception reports
b) Recording a business activity
c) Confirming an action or triggering a response
d) Maintaining a data
Explanation: Collections of operations that form a single logical unit of work are called transactions.
9. The Oracle RDBMS uses the ____ statement to declare a new transaction start and its properties.
a) BEGIN
b) SET TRANSACTION
c) BEGIN TRANSACTION
d) COMMIT
Explanation: Commit is used to store all the transactions.
10. ____ means that the data used during the execution of a
transaction cannot be used by a second transaction until the first one
is completed.
a) Consistency
b) Atomicity
c) Durability
d) Isolation
Explanation: Even though multiple transactions may execute concurrently, the system guarantees that, for every pair of transactions Ti and Tj, it appears to Ti that either Tj finished execution before Ti started or Tj started execution after Ti finished.
This set of Database Questions and Answers for Experienced people focuses on ” Querying database part – 4″.
1. Which s essential a business problem not a data problem:
a) Data
b) Database
c) Database design
d) All of the mentioned
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
2. Which is primarily the result of a thorough understanding of information about an enterprise:
a) Data
b) Database
c) Database design
d) Data modeling
Explanation: Data modelling designs the data in a secured manner.
3. McFadden has defined normalization in his which book___________
a) Database modern management
b) Management database of modern
c) Modern database management
d) Database management
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
4. The database design prevents some data from being represented due to _______
a) Deletion anomalies
b) Insertion anomalies
c) Update anomaly
d) None of the mentioned
Explanation: Insertion anomaly is due to confusion in data deletion or insertion.
5. How many types of insertion anomalies:
a) 1
b) 2
c) 3
d) 4
Explanation: Insertion anomaly is due to confusion in data deletion or insertion.
6. Who developed the normalization process:
a) E.F. codd
b) F.F. codd
c) E.E. codd
d) None of the mentioned
Explanation: Normalization helps in improving the quality of the data.
7. E.F.Codd developed the normalization process in the which early:
a) 1969
b) 1970
c) 1971
d) 1972
Explanation: Normalization helps in improving the quality of the data.
8. Which is a bottom-up approach to database design that design by examining the relationship between attributes:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
Explanation: Normalization helps in improving the quality of the data.
9. Which is the process of breaking a relation into multiple relations:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
10. Which formal method that locates and analyses relation schemas
on the basis of their primary, candidate keys, and the FD’s that are
present among the attributes of these schemas:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
Explanation: Normalization helps in improving the quality of the data.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Lock-Based Protocols”.
1. In order to maintain transactional integrity and database consistency, what technology does a DBMS deploy?
a) Triggers
b) Pointers
c) Locks
d) Cursors
Explanation: Locks are used to maintain database consistency.
2. A lock that allows concurrent transactions to access different rows of the same table is known as a
a) Database-level lock
b) Table-level lock
c) Page-level lock
d) Row-level lock
Explanation: Locks are used to maintain database consistency.
3. Which of the following are introduced to reduce the overheads caused by the log-based recovery?
a) Checkpoints
b) Indices
c) Deadlocks
d) Locks
Explanation: Checkpoints are introduced to reduce overheads caused by the log-based recovery.
4. Which of the following protocols ensures conflict serializability and safety from deadlocks?
a) Two-phase locking protocol
b) Time-stamp ordering protocol
c) Graph based protocol
d) None of the mentioned
Explanation: Time-stamp ordering protocol ensures conflict serializability and safety from deadlocks.
5. Which of the following is the block that is not permitted to be written back to the disk?
a) Dead code
b) Read only
c) Pinned
d) Zapped
Explanation: A block that is not permitted to be written back to the disk is called pinned.
6. If transaction Ti gets an explicit lock on the file Fc in
exclusive mode, then it has an __________ on all the records
belonging to that file.
a) Explicit lock in exclusive mode
b) Implicit lock in shared mode
c) Explicit lock in shared mode
d) Implicit lock in exclusive mode
Explanation: If transaction Ti gets an explicit lock on the file Fc in exclusive mode, then it has an implicit lock in exclusive mode on all the records belonging to that file.
7. Which refers to a property of computer to run several operation
simultaneously and possible as computers await response of each other
a) Concurrency
b) Deadlock
c) Backup
d) Recovery
Explanation: Concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other.
8. All lock information is managed by a __________ which is
responsible for assigning and policing the locks used by the
transactions.
a) Scheduler
b) DBMS
c) Lock manager
d) Locking agent
Explanation: A distributed lock manager (DLM) provides distributed software applications with a means to synchronize their accesses to shared resources.
9. The ____ lock allows concurrent transactions to access the same
row as long as they require the use of different fields within that row.
a) Table-level
b) Page-level
c) Row-level
d) Field-level
Explanation: Lock is limited to the attributes of the relation.
10. Which of the following is a procedure for acquiring the necessary
locks for a transaction where all necessary locks are acquired before
any are released?
a) Record controller
b) Exclusive lock
c) Authorization rule
d) Two phase lock
Explanation: Two-phase lock is a procedure for acquiring the necessary locks for a transaction where all necessary locks are acquired before any are released.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Snapshot Isolation”.
1. Snapshot isolation is a particular type of ______________ scheme.
a) Concurrency-control
b) Concurrency-allowance
c) Redirection
d) Repetition-allowance
Explanation: It has gained wide acceptance in commercial and open-source systems, including Oracle, PostgreSQL, and SQL Server.
2. Snapshot isolation is used to give
a) Transaction a snapshot of the database
b) Database a snapshot of the transaction
c) Database a snapshot of committed values in the transaction
d) Transaction a snapshot of the database and Database a snapshot of committed values in the transaction
Explanation: The data values in the snapshot consist only of values written by committed transactions.
3. Lost update problem is
a) Second update overwrites the first
b) First update overwrites the second
c) The updates are lost due to conflicting problem
d) None of the mentioned
Explanation: Lost update problem has to be resolved.
4. Under first updater wins the system uses a __________ mechanism that applies only to updates.
a) Close
b) Read
c) Locking
d) Beat
Explanation: Reads are unaffected by this, since they do not obtain locks.
5. When a transaction Ti attempts to update a data item, it requests a _________ on that data item.
a) Read lock
b) Update lock
c) Write lock
d) Chain lock
Explanation: Reads are unaffected by this, since they do not obtain locks.
6. Each of a pair of transactions has read data that is written by
the other, but there is no data written by both transactions, is
referred to as
a) Read skew
b) Update skew
c) Write lock
d) None of the mentioned
Explanation: Write skew is the issue addressed here.
7. An application developer can guard against certain snapshot anomalies by appending a ______ clause to the SQL select query.
a) For update
b) For read
c) For write
d) None of the mentioned
Explanation: Adding the for update clause causes the system to treat data that are read as if they had been updated for purposes of concurrency control.
8. Evaluate the CREATE TABLE statement:
products product_id prod_id_pk product_name VARCHAR2;
Which statement is true regarding the PROD_ID_PK constraint?
a) It would be created only if a unique index is manually created first
b) It would be created and would use an automatically created unique index
c) It would be created and would use an automatically created no unique index
d) It would be created and remains in a disabled state because no index is specified in the command
Explanation: Syntax: create table table_name(name constraint).
9. Evaluate the following CREATE SEQUENCE statement:
seq1 MAXVALUE CYCLE NOCACHE;
The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue the following SQL statement:
SELECT seq1.nextval FROM dual;
What is displayed by the SELECT statement?
a) 1
b) 10
c) 100
d) an error
Explanation: Sequence is used to generate a series of values.
10. In which scenario would you use the ROLLUP operator for expression or columns within a GROUP BY clause?
a) To find the groups forming the subtotal in a row
b) To create group-wise grand totals for the groups specified within a GROUP BY clause
c) To create a grouping for expressions or columns specified within a GROUP BY clause in one direction, from
right to left for calculating the subtotals
d) To create a grouping for expressions or columns specified within a GROUP BY clause in all possible
directions, which is cross-tabular report for calculating the subtotals
Explanation: Sequence is used to generate a series of values.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Failure Classification”.
1. The recovery scheme must also provide
a) High availability
b) Low availability
c) High reliability
d) High durability
Explanation: It must minimize the time for which the database is not usable after a failure.
2. Which one of the following is a failure to a system
a) Boot crash
b) Read failure
c) Transaction failure
d) All of the mentioned
Explanation: Types of system failure are transaction failure, system crash and disk failure.
3. Which of the following belongs to transaction failure
a) Read error
b) Boot error
c) Logical error
d) All of the mentioned
Explanation: Types of system transaction failure are logical and system error.
4. The system has entered an undesirable state (for example,
deadlock), as a result of which a transaction cannot continue with its
normal execution. This is
a) Read error
b) Boot error
c) Logical error
d) System error
Explanation: The transaction, can be re-executed at a later time.
5. The transaction can no longer continue with its normal execution
because of some internal condition, such as bad input, data not found,
overflow, or resource limit exceeded. This is
a) Read error
b) Boot error
c) Logical error
d) System error
Explanation: The transaction, can be re-executed at a later time.
6. The assumption that hardware errors and bugs in the software bring
the system to a halt, but do not corrupt the nonvolatile storage
contents, is known as the
a) Stop assumption
b) Fail assumption
c) Halt assumption
d) Fail-stop assumption
Explanation: Well-designed systems have numerous internal checks, at the hardware and the software level, that bring the system to a halt when there is an error. Hence, the fail-stop assumption is a reasonable one.
7. Which kind of failure loses its data in head crash or failure during a transfer operation.
a) Transaction failure
b) System crash
c) Disk failure
d) All of the mentioned
Explanation: Copies of the data on other disks, or archival backups on tertiary media, such as DVD or tapes, are used to recover from the failure.
8. The failure occurred sufficiently early during the transfer that the destination block remains intact.
a) Partial Failure
b) Total failure
c) Successful completion
d) Data transfer failure
Explanation: Copies of the data on other disks, or archival backups on tertiary media, such as DVD or tapes, are used to recover from the failure.
9. The database is partitioned into fixed-length storage units called
a) Parts
b) Blocks
c) Reads
d) Build
Explanation: Blocks are the units of data transfer to and from disk, and may contain several data items.
10. Which of the following causes system to crash
a) Bug in software
b) Loss of volatile data
c) Hardware malfunction
d) All of the mentioned
Explanation: The content of non-volatile storage remains intact, and is not corrupted.
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “ARIES”.
1. ARIES uses a ___________ to identify log records, and stores it in database pages.
a) Log sequence number
b) Log number
c) Lock number
d) Sequence
Explanation: LSN is used to identify which operations have been applied to a database page.
2. ARIES supports ___________ operations, which are physical in that
the affected page is physically identified, but can be logical within
the page.
a) Physiological redo
b) Physiological undo
c) Logical redo
d) Logical undo
Explanation: The deletion of a record from a page may result in many other records in the page being shifted, if a slotted page structure is used.
3. ______________ is used to minimize unnecessary redos during recovery.
a) Dirty page table
b) Page table
c) Dirty redo
d) All of the mentioned
Explanation: Dirty pages are those that have been updated in memory, and the disk version is not up-to-date.
4. __________ scheme that records only information about dirty pages
and associated information and does not even require of writing dirty
pages to disk.
a) Fuzzy logic
b) Checkpoints
c) Fuzzy-checkpoint
d) Logical checkpoint
Explanation: It flushes dirty pages in the background, continuously, instead of writing them during checkpoints.
5. Whenever an update operation occurs on a page, the operation
stores the LSN of its log record in the _______ field of the page.
a) LSN
b) ReadLSN
c) PageLSN
d) RedoLSN
Explanation: Each page maintains an identifier called the PageLSN.
6. There are special redo-only log records generated during transaction rollback, called _________ in ARIES.
a) Compensation log records
b) Read log records
c) Page log records
d) Redo log records
Explanation: These serve the same purpose as the redo-only log records in our earlier recovery scheme.
7. The __________________ contains a list of pages that have been updated in the database buffer.
a) Dirty page table
b) Page table
c) Dirty redo
d) All of the mentioned
Explanation: Dirty pages are those that have been updated in memory, and the disk version is not up-to-date.
8. ___________ determines which transactions to undo, which pages
were dirty at the time of the crash, and the LSN from which the redo
pass should start.
a) Analysis pass
b) Redo pass
c) Undo pass
d) None of the mentioned
Explanation: The analysis pass finds the last complete checkpoint log record, and reads in the DirtyPageTable from this record.
9. __________ starts from a position determined during analysis, and
performs a redo, repeating history, to bring the database to a state it
was in before the crash.
a) Analysis pass
b) Redo pass
c) Undo pass
d) None of the mentioned
Explanation: The redo pass repeats history by replaying every action that is not already reflected in the page on disk.
10. ______________ rolls back all transactions that were incomplete at the time of crash.
a) Analysis pass
b) Redo pass
c) Undo pass
d) None of the mentioned
Explanation: It performs a single backward scan of the log, undoing all transactions in undo-list.