250+ TOP MCQs on Failure with Nonvolatile Storage and Answers

Database Multiple Choice Questions on “Failure with Nonvolatile Storage”.

1. The silicon chips used for data processing are called
a) RAM chips
b) ROM chips
c) Micro processors
d) PROM chips

Answer: d
Clarification: PROM is Programmable Read Only Memory.

2. Which of the following is used for manufacturing chips?
a) Control bus
b) Control unit
c) Parity unit
d) Semiconductor

Answer: d
Clarification: A semiconductor is a material which has electrical conductivity between that of a conductor such as copper and that of an insulator such as glass.

3. What was the name of the first commercially available microprocessor chip?
a) Intel 308
b) Intel 33
c) Intel 4004
d) Motorola 639

Answer: c
Clarification: The Intel 4004 is a 4-bit central processing unit (CPU) released by Intel Corporation in 1971

4. The magnetic storage chip used to provide non-volatile direct access storage of data and that have no moving parts are known as
a) Magnetic core memory
b) Magnetic tape memory
c) Magnetic disk memory
d) Magnetic bubble memory

Answer: d
Clarification: Bubble domain visualization by using CMOS-MagView.

5. The ALU of a computer normally contains a number of high speed storage element called
a) Semiconductor memory
b) Registers
c) Hard disks
d) Magnetic disk

Answer: b
Clarification: External control unit tells the ALU what operation to perform on that data, and then the ALU stores its result into an output register.

6. Which of the following is used only for data entry and storage, and never for processing?
a) Mouse
b) Dumb terminal
c) Micro computer
d) Dedicated data entry system

Answer: b
Clarification: Dumb terminals are those that can interpret a limited number of control codes.

7. Non-volatile storage needs to have a _________ where the loses in future can be recovered.
a) Dump
b) Recover place
c) Disk
d) Redo plan

Answer: a
Clarification: The basic scheme is to dump the entire contents of the database to stable storage periodically—say, once per day.

8. A dump of the database contents is also referred to as an _____________ dump.
a) Archival
b) Fuzzy
c) SQL
d) All of the mentioned

Answer: a
Clarification: We can archive the dumps and use them later to examine old states of the database.

9. ________ dump, writes out SQL DDL statements and SQL insert statements to a file, which can then be reexecuted to re-create the database.
a) Archival
b) Fuzzy
c) SQL
d) All of the mentioned

Answer: c
Clarification: Such dumps are useful when migrating data to a different instance of the database, or to a different version of the database software, since the physical locations and layout may be different in the other database instance or database software version.

10. _________ dump schemes have been developed that allow transactions to be active while the dump is in progress.
a) Archival
b) Fuzzy
c) SQL
d) All of the mentioned

Answer: b
Clarification: The simple dump procedure described here is costly and so fuzzy dump is used.

250+ TOP MCQs on Aggregate Functions and Nested Subqueries

Database Multiple Choice Questions on “Aggregate Functions and Nested Subqueries”.

1. Aggregate functions are functions that take a ___________ as input and return a single value.
a) Collection of values
b) Single value
c) Aggregate value
d) Both Collection of values & Single value

Answer: a
Clarification: None.

2.

SELECT __________
FROM instructor
WHERE dept name= ’Comp. Sci.’;

Which of the following should be used to find the mean of the salary ?
a) Mean(salary)
b) Avg(salary)
c) Sum(salary)
d) Count(salary)

Answer: b
Clarification: Avg() is used to find the mean of the values.

3.

SELECT COUNT (____ ID)
FROM teaches
WHERE semester = ’Spring’ AND YEAR = 2010;

If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.
a) Distinct
b) Count
c) Avg
d) Primary key

Answer: a
Clarification: Distinct keyword is used to select only unique items from the relation.

4. All aggregate functions except _____ ignore null values in their input collection.
a) Count(attribute)
b) Count(*)
c) Avg
d) Sum

Answer: b
Clarification: * is used to select all values including null.

5. A Boolean data type that can take values true, false, and________
a) 1
b) 0
c) Null
d) Unknown

Answer: d
Clarification: Unknown values do not take null value but it is not known.

6. The ____ connective tests for set membership, where the set is a collection of values produced by a select clause. The ____ connective tests for the absence of set membership.
a) Or, in
b) Not in, in
c) In, not in
d) In, or

Answer: c
Clarification: In checks, if the query has the value but not in checks if it does not have the value.

7. Which of the following should be used to find all the courses taught in the Fall 2009 semester but not in the Spring 2010 semester .
a)

SELECT DISTINCT course id
FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009 AND
course id NOT IN (SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010);

b)

SELECT DISTINCT course_id
FROM instructor
WHERE name NOT IN (’Fall’, ’Spring’);

c)

(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)

d)

SELECT COUNT (DISTINCT ID)
FROM takes
WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR
FROM teaches
WHERE teaches.ID= 10101);

Answer: a
Clarification: None.

8. The phrase “greater than at least one” is represented in SQL by _____
a) < all
b) < some
c) > all
d) > some

Answer: d
Clarification: >some takes atlest one value above it .

9. Which of the following is used to find all courses taught in both the Fall 2009 semester and in the Spring 2010 semester .
a)

SELECT course id
FROM SECTION AS S
WHERE semester = ’Fall’ AND YEAR= 2009 AND
EXISTS (SELECT *
FROM SECTION AS T
WHERE semester = ’Spring’ AND YEAR= 2010 AND
S.course id= T.course id);

b)

SELECT name
FROM instructor
WHERE salary > SOME (SELECT salary
FROM instructor
WHERE dept name = ’Biology’);

c)

SELECT COUNT (DISTINCT ID)
FROM takes
WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR
FROM teaches
WHERE teaches.ID= 10101);

d)

(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)

Answer: a
Clarification: None.

10. We can test for the nonexistence of tuples in a subquery by using the _____ construct.
a) Not exist
b) Not exists
c) Exists
d) Exist

Answer: b
Clarification: Exists is used to check for the existence of tuples.

250+ TOP MCQs on The Entity-Relationship Model and Answers

Database Multiple Choice Questions 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

Answer: a
Clarification: 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

Answer: c
Clarification: 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

Answer: b
Clarification: 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

Answer: c
Clarification: 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

Answer: b
Clarification: 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

Answer: d
Clarification: 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

Answer: c
Clarification: 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

Answer: a
Clarification: 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

Answer: a
Clarification: 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

Answer: a
Clarification: 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.

250+ TOP MCQs on Servlets and JSP and Answers

Database Multiple Choice Questions on “Servlets and JSP”.

1. The Java __________ specification defines an application programming interface for communication between the Web server and the application program.
a) Servlet
b) Server
c) Program
d) Randomize

Answer: a
Clarification: Servlets are commonly used to generate dynamic responses to HTTP requests.

2. The doGet() method in the example extracts values of the parameter’s type and number by using __________
a) request.getParameter()
b) request.setParameter()
c) responce.getParameter()
d) responce.getAttribute()

Answer: a
Clarification: These methods uses these values to run a query against a database.

3. How many JDBC driver types does Sun define?
a) One
b) Two
c) Three
d) Four

Answer: d
Clarification: JBDB.DriverManager.getConnection() is used to get the connection to the database.

4. Which JDBC driver Type(s) can be used in either applet or servlet code?
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

Answer: c
Clarification: In a Type 3 driver, a three-tier approach is used to accessing databases. The JDBC clients use standard network sockets to communicate with an middleware application server. In a Type 4 driver, a pure Java-based driver that communicates directly with vendor’s database through socket connection.

5. What MySQL property is used to create a surrogate key in MySQL?
a) UNIQUE
b) SEQUENCE
c) AUTO_INCREMENT
d) None of the mentioned

Answer: c
Clarification: A surrogate key in a database is a unique identifier for either an entity in the modeled world or an object in the database.

6. A JSP is transformed into a(n):
a) Java applet
b) Java servlet
c) Either 1 or 2 above
d) Neither 1 nor 2 above

Answer: b
Clarification: Servlets are commonly used to generate dynamic responses to HTTP requests.

7. Which JDBC driver Type(s) is(are) the JDBC-ODBC bridge?
a) Type 1
b) Type 2
c) Type 3
d) Type 4

Answer: a
Clarification: In a Type 1 driver, a JDBC bridge is used to access ODBC drivers installed on each client machine.

8. What programming language(s) or scripting language(s) does Java Server Pages (JSP) support?
a) VBScript only
b) Jscript only
c) Java only
d) All of the mentioned

Answer: c
Clarification: JSP primarily uses Java for certain codes.

9. What is bytecode?
a) Machine-specific code
b) Java code
c) Machine-independent code
d) None of the mentioned

Answer: c
Clarification: Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode opcode is one byte in length, although some require parameters, resulting in some multi-byte instructions.

10. Where is metadata stored in MySQL?
a) In the MySQL database metadata
b) In the MySQL database metasql
c) In the MySQL database mysql
d) None of the mentioned

Answer: c
Clarification: Metadata contains data about other data which is given in the… tags.

250+ TOP MCQs on Ordered Indexing and Hashing and Answers

Database Multiple Choice Questions on “Ordered Indexing and Hashing”.

1. A(n) _________ can be used to preserve the integrity of a document or a message.
a) Message digest
b) Message summary
c) Encrypted message
d) None of the mentioned

Answer: c
Clarification: Encryption algorithms are used to keep the contents safe.

2. A hash function must meet ________ criteria.
a) Two
b) Three
c) Four
d) None of the mentioned

Answer: b
Clarification: Only if the criteria is fulfilled the values are hashed.

3. What is the main limitation of Hierarchical Databases?
a) Limited capacity (unable to hold much data)
b) Limited flexibility in accessing data
c) Overhead associated with maintaining indexes
d) The performance of the database is poor

Answer: b
Clarification: In this, the data items are placed in a tree like hierarchical structure.

4. The property (or set of properties) that uniquely defines each row in a table is called the:
a) Identifier
b) Index
c) Primary key
d) Symmetric key

Answer: c
Clarification: Primary is used to uniquely identify the tuples.

5. The separation of the data definition from the program is known as:
a) Data dictionary
b) Data independence
c) Data integrity
d) Referential integrity

Answer: b
Clarification: Data dictionary is the place where the meaning of the data are organized.

6. In the client / server model, the database:
a) Is downloaded to the client upon request
b) Is shared by both the client and server
c) Resides on the client side
d) Resides on the server side

Answer: d
Clarification: The server has all the database information and the client access it.

7. The traditional storage of data that is organized by customer, stored in separate folders in filing cabinets is an example of what type of ‘database’ system?
a) Hierarchical
b) Network
c) Object oriented
d) Relational

Answer: a
Clarification: Hierarchy is based on Parent-Child Relationship. Parent-Child Relationship Type is basically 1:N relationship.

8. The database design that consists of multiple tables that are linked together through matching data stored in each table is called
a) Hierarchical database
b) Network database
c) Object oriented database
d) Relational database

Answer: d
Clarification: A relational database is a collection of data items organized as a set of formally described tables from which data can be accessed or reassembled.

9. The association role defines:
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
d) Which attribute is the table’s primary key

Answer: a
Clarification: The tables are always related in the database to form consistency.

10. The purpose of an N-Ary association is:
a) To capture a parent-child relationship
b) To deal with one to many relationships
c) To deal with relationships that involve more than two tables
d) To represent an inheritance relationship

Answer: c
Clarification: The is binary n-array association meaning more than two classes are involved in the relationship.

250+ TOP MCQs on Querying database and Answers Pdf

Database Interview Questions and Answers for freshers on ” Querying database″.

1. _______________ joins are SQL server default
a) Outer
b) Inner
c) Equi
d) None of the Mentioned

Answer: b
Clarification: Inner query joins only the rows that are matching.

2. The ________________ is essentially used to search for patterns in target string.
a) Like Predicate
b) Null Predicate
c) In Predicate
d) Out Predicate

Answer: a
Clarification: Like matches the pattern with the query.

3. Which of the following is/are the Database server functions?
i) Data management
ii) Transaction management
iii) Compile queries
iv) Query optimization
a) i, ii, and iv only
b) i, ii and iii only
c) ii, iii and iv only
d) All i, ii, iii, and iv

Answer: a
Clarification: All these are functions of the database.

4. To delete a database ___________ command is used
a) Delete database database_name
b) Delete database_name
c) drop database database_name
d) drop database_name

Answer: c
Clarification: This will delete the database with its structure.

5. ____________ is a combination of two of more attributes used as a primary key
a) Composite Key
b) Alternate Key
c) Candidate Key
d) Foreign Key

Answer: a
Clarification: Primary keys together form the composite key.

6. Which of the following is not the function of client?
a) Compile queries
b) Query optimization
c) Receive queries
d) Result formatting and presentation

Answer: b
Clarification: Query optimization is used to improve quality.

7. ____________ is a special type of stored procedure that is automatically invoked whenever the data in the table is modified.
a) Procedure
b) Trigger
c) Curser
d) None of the Mentioned

Answer: b
Clarification: Triggers are used to initiate an action to take place.

8. ______________ requires that data should be made available to only authorized users.
a) Data integrity
b) Privacy
c) Security
d) None of the Mentioned

Answer: c
Clarification: Some algorithms may be used for the security.

9. Some of the utilities of DBMS are _____________
i) Loading ii) Backup iii) File organization iv) Process Organization
a) i, ii, and iv only
b) i, ii and iii only
c) ii, iii and iv only
d) All i, ii, iii, and iv

Answer: b
Clarification: Processing is not the a utility in dbms.

10. ____________ allows individual row operation to be performed on a given result set or on the generated by a selected by a selected statement.
a) Procedure
b) Trigger
c) Curser
d) None of the Mentioned

Answer: c
Clarification: Triggers are used to initiate an action to take place.