You are on page 1of 46

Databases

1) ------- responsible for authorizing access to the database, for co-ordinating and monitoring its use, acquiring software, and hardware resources, controlling
its use and monitoring efficiency of operations.
A. Authorization Manager
B. Storage Manager
C. File Manager
D. Transaction Manager
E. Buffer Manager
Ans: E

2) ------- is a property that describes various characteristics of an entity


A.ER Diagram
B.Column
C.Relationship
D.Attribute
Ans: D

3) -------- level describes what data is stored in the database and the relationships among the data
A.Physical Level
B.Logical Level
C.Conceptual Level
D.None of the above
Ans: B

4) ---------- denote derived attributes.


A.Double ellipse
B.Dashed ellipse
C.Squared ellipse
D.Ellipse with attribute name underlined
Ans: B

5) A --------- is an association between entities


A.Relation
B.One to One
C.Generalization
D.Specialization
Ans: A

6) ------------- stores metadata about the structure of the data base


A.Physical data base
B.Query Analyzer
C.Data Dictionary
D.Data Catalog
Ans: C

7) ------------is a collection of operations that perform s single logical function in a database application
A.Transaction
B.Concurrent operation
C.Atomocity
D.Durability
Ans: A

8) The problem that is compounded when constraints involve several data items from different files are Called --------
A.Transaction Control Management Problem
B.Security Problem
C.Integrity Problem
D.Durability Problem
Ans: C

9) Ensuring atomicity is the responsibility of the ------------component


A.File Manager
B.Buffer Manager
C.DBA
D.Transation Manager
Ans: D

10) -----manages the allocation of the space on the disk storage and the data base structure used to represent information stored on disk
A.Disk Manager
B.File Manager
C.Buffer Manager
D.Memory Manager
E.None of the above
Ans: B
1
11) is the minimal super key
A.Primary Key
B.Candidate Key
C.Surrogate Key
D.Unique Key
E.Alternate Key
Ans: B

12) engine executes low level instructions generated by the DML compilier
A.DDL Analyzer
B.Query Interpreter
C.Database Engine
D.None of the above
Ans: D

13) ------------responsible to define the content, the structure, the constraints, and functions or transactions against the database
A.Transcation Manager
B.Query Analyzer
C.DBA
D.All the above
E.None of the above
Ans: C

14) In ER model -------------denote derived attributes


A.Double ellipse
B.Diamond
C.Reactangle
D.None of the above
Ans: D

15) Foreign Key can be null


A.TRUE
B.FALSE
Ans: A

16) All primary keys should be super keys.


A.TRUE
B.FALSE
Ans: A

17) In Relational database Data is stored as record types and the relationship is represented by set types
A.True
B.False
Ans: A

18) In Hierarchical database to get to a low-level table, you start at the root and work your way down the tree until you reach your target data.
A.True
B.False
Ans: A

19) Using relational model we design conceptual database design


A.True
B.False
Ans: B

20) Conceptual data model is the source of information for logical design phase
A.True
B.False
Ans: A

21) Logical database design describes describes base relations, file organizations, and indexes that are used to achieve efficient access to data.
A.True
B.False
Ans: B

22) Conceptual data modeling uses a high level data modeling concept of E-R Models
A.True
B.False
Ans: A

23) Tables are required to have at least one column


A.True
B.False
Ans: A

2
24) Logical data independence. Refers to the separation of the external views from the conceptual view
A.True
B.False
Ans: A

25) Duplication of data is the disadvantage of DBMS


A.True
B.False
Ans: B

26) Candidate key can have a null value


A.True
B.False
Ans: B

27) Each program maintains its own set of data. So users of one program may be unaware of potentially useful data held by other programs this leads
toDuplication of data
A.True
B.False
Ans: B

28) A traditional database stores just data – with no procedures


A.True
B.False
Ans: A

29) Simple Attribute composed of multiple components, each with an independent existence.
A.True
B.False
Ans: B

30) Cardinality specifies how many instances of an entity relate to one instance of another entity.
A.True
B.False
Ans: A

MCQ Based On SQL

1. Which SQL function is used to count the number of rows in a SQL query ?
a) COUNT()
b) NUMBER()
c) SUM()
d) COUNT(*)
View Answer

Answer: d
Explanation: COUNT(*) takes null value row in to consideration.

2. Which SQL keyword is used to retrieve a maximum value ?


a) MOST
b) TOP
c) MAX
d) UPPER
View Answer

Answer: c
Explanation: The MAX() function returns the largest value of the selected column.

3. Which of the following SQL clauses is used to DELETE tuples from a database table ?
a) DELETE
b) REMOVE
c) DROP
d) CLEAR
View Answer

Answer: a
Explanation: The SQL DELETE Query is used to delete the existing records from a table.

4. ___________removes all rows from a table without logging the individual row deletions.
a) DELETE
b) REMOVE
c) DROP
d) TRUNCATE
View Answer

3
Answer: d
Explanation: TRUNCATE statement is a Data Definition Language (DDL) operation that marks the extents of a table for deallocation.

5. Which of the following is not a DDL command ?


a) UPDATE
b) TRUNCATE
c) ALTER
d) None of the Mentioned
View Answer

Answer: a
Explanation: Data definition language (DDL) commands enable you to perform the following tasks:Create, alter, and drop schema objects.

6. Which of the following are TCL commands ?


a) UPDATE and TRUNCATE
b) SELECTand INSERT
c) GRANT and REVOKE
d) ROLLBACK and SAVEPOINT
View Answer

Answer: d
Explanation: Transaction control commands manage changes made by DML commands. These SQL commands are used for managing changes affecting the data.

7. ________________ is not a category of SQL command.


a) TCL
b) SCL
c) DCL
d) DDL
View Answer

Answer: b
Explanation: SQL commands can be used not only for searching the database but also to perform various other functions.They are DDL,DML,TCL and DCL.

8. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default
a) ASC
b) DESC
c) There is no default value
d) None of the mentioned
View Answer

Answer: a
Explanation: ASC is the default sort order. Null values are treated as the lowest possible values.

9. Which of the following statement is true ?


a) DELETE does not free the space containing the table and TRUNCATE free the space containing the table
b) Both DELETE and TRUNCATE free the space containing the table
c) Both DELETE and TRUNCATE does not free the space containing the table
d) DELETE free the space containing the table and TRUNCATE does not free the space containing the table
View Answer

Answer: a
Explanation: The SQL TRUNCATE command is used to delete all the rows from the table and free the space containing the table.

10. What is the purpose of the SQL AS clause ?


a) The AS SQL clause is used change the name of a column in the result set or to assign a name to a derived column
b) The AS clause is used with the JOIN clause only
c) The AS clause defines a search condition
d) All of the mentioned
View Answer

Answer: a
Explanation: SQL Aliases are defined for columns and tables. Basically aliases is created to make the column selected more readable.

1. What does DML stand for ?


a) Different Mode Level
b) Data Model Language
c) Data Mode Lane
d) Data Manipulation language
View Answer

Answer: d
Explanation: Data Manipulation Language is used to modify the records in the database.

2. With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a” ?
a) SELECT * FROM Persons WHERE FirstName=’a’
b) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
c) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
d) SELECT * FROM Persons WHERE FirstName=’%a%’
View Answer
4
Answer: c
Explanation: The SQL LIKE clause is used to compare a value to similar values using wildcard operators.

3. With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName” ?
a) SELECT * FROM Persons SORT BY ‘FirstName’ DESC
b) SELECT * FROM Persons ORDER FirstName DESC
c) SELECT * FROM Persons SORT ‘FirstName’ DESC
d) SELECT * FROM Persons ORDER BY FirstName DESC
View Answer

Answer: d
Explanation: The SQL SELECT statement queries data from tables in the database.

4. With SQL, how can you return the number of not null records in the “Persons” table ?
a) SELECT COUNT() FROM Persons
b) SELECT COLUMNS() FROM Persons
c) SELECT COLUMNS(*) FROM Persons
d) SELECT COUNT(*) FROM Persons
View Answer

5. What does the ALTER TABLE clause do ?


a) The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
b) The SQL ALTER TABLE clause is used to insert data into database table
c) THE SQL ALTER TABLE deletes data from database table
d) The SQL ALTER TABLE clause is used to delete a database table
View Answer

Answer: a
Explanation: The ALTER TABLE statement is used to add, delete, or modify columns.

6. The UPDATE SQL clause can


a) update only one row at a time
b) update more than one row at a time
c) delete more than one row at a time
d) delete only one row at a time
View Answer

Answer: b
Explanation: The SQL UPDATE Query is used to modify the existing records in a table.You can use WHERE clause with UPDATE query to update selected rows
otherwise all the rows would be affected.

7. The UNION SQL clause can be used with


a) SELECT clause only
b) DELETE and UPDATE clauses
c) UPDATE clause only
d) All oF the mentioned
View Answer

Answer: a
Explanation: The SQL UNION operator is used to combine the result sets of 2 or more SELECT statements. It removes duplicate rows between the various SELECT
statements.

8. Which SQL statement is used to return only different values ?


a) SELECT DIFFERENT
b) SELECT UNIQUE
c) SELECT DISTINCT
d) SELECT ALL
View Answer

Answer: c
Explanation: The SELECT DISTINCT statement is used to return only distinct (different) values.

9. Which SQL keyword is used to sort the result-set ?


a) ORDER BY
b) SORT
c) ORDER
d) SORT BY
View Answer

Answer: a
Explanation: The ORDER BY keyword sorts the records in ascending order by default.

10. How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
a) UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
b) MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
c) MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
d) UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
View Answer

5
Answer: d
Explanation: In its simplest form, the syntax for the UPDATE statement when updating one table is:UPDATE table SET column1 = expression1,column2 =
expression2,… WHERE conditions.

1. Which of the following command makes the updates performed by the transaction permanent in the database ?
a) ROLLBACK
b) COMMIT
c) TRUNCATE
d) DELETE
View Answer

Answer: b
Explanation: Commit command is used to permanently save any transaaction into database.

2. Which TCL command undo all the updates performed by the SQL in the transaction ?
a) ROLLBACK
b) COMMIT
c) TRUNCATE
d) DELETE
View Answer

Answer: b
Explanation: Rollback is used for undoing the work done in the current transaction. This command also releases the locks if any hold by the current transaction.

3. SQL query to find all the cities whose humidity is 95 .


a) SELECT city WHERE humidity = 95
b) SELECT city FROM weather WHERE humidity = 95
c) SELECT humidity = 89 FROM weather
d) SELECT city FROM weather
View Answer

Answer: b
Explanation: The SQL WHERE clause is used to filter the results and apply conditions in a SELECT, INSERT, UPDATE, or DELETE statement.

4. SQL query to find the temperature in increasing order of all cities.


a) SELECT city FROM weather ORDER BY temperature
b) SELECT city, temperature FROM weather
c) SELECT city, temperature FROM weather ORDER BY temperature
d) SELECT city, temperature FROM weather ORDER BY city
View Answer

Answer: d
Explanation: The ORDER BY keyword sorts the records in ascending order by default.

5. What is the meaning of LIKE ‘%0%0%’ ?


a) Feature begins with two 0’s
b) Feature ends with two 0’s
c) Feature has more than two 0’s
d) Feature has two 0’s in it, at any position
View Answer

Answer: d
Explanation: The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.

6. Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
a) SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
b) SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
c) SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
d) SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);
View Answer

Answer: a
Explanation: The IN operator allows you to specify multiple values in a WHERE clause.

7. Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
a) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
b) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
c) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
d) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
View Answer

Answer: c
Explanation: The AND operator displays a record if both the first condition AND the second condition are true.The OR operator displays a record if either the first
condition OR the second condition is true.

8. Find all the tuples having temperature greater than ‘Paris’.


a) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’
b) SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)
c) SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)
6
d) SELECT * FROM weather WHERE temperature > ‘Paris’ temperature
View Answer

Answer: a
Explanation: Subquery—also referred to as an inner query or inner select—is a SELECT statement embedded within a data manipulation language (DML) statement or
nested within another subquery.

9. Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79.
a) SELECT * FROM weather WHERE humidity IN (63 to 79)
b) SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
c) SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
d) SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79
View Answer

Answer: c
Explanation: The BETWEEN operator is used to select values within a range.

10. The command to remove rows from a table ‘CUSTOMER’ is


a) DROP FROM CUSTOMER
b) UPDATE FROM CUSTOMER
c) REMOVE FROM CUSTOMER
d) DELETE FROM CUSTOMER WHERE
View Answer

Answer: d
Explanation: The SQL DELETE Query is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete selected rows.

1. What type of join is needed when you wish to include rows that do not have matching values?

A. Equi-join

B. Natural join

C. Outer join

D. All of the above.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

2. What type of join is needed when you wish to return rows that do have matching values?

A. Equi-join

B. Natural join

C. Outer join

D. All of the above.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

3. Which of the following is true concerning a procedure?

A. You do not create them with SQL.

7
B. They do not need to have a unique name.

C. They include procedural and SQL statements.

D. They are the same thing as a function.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

4. A CASE SQL statement is which of the following?

A. A way to establish an IF-THEN-ELSE in SQL.

B. A way to establish a loop in SQL.

C. A way to establish a data definition in SQL.

D. All of the above.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

5. Which of the following statements is true concerning routines and triggers?

A. Both consist of procedural code.

B. Both have to be called to operate.

C. Both run automatically.

D. Both are stored in the database.

Answer: Option A

6. Which of the following is one of the basic approaches for joining tables?

A. Subqueries

B. Union Join

C. Natural join

D. All of the above

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

8
View Answer Discuss in Forum Workspace Report

7. Which of the following is true concerning systems information in an RDBMS?

A. RDBMS store database definition information in system-created tables.

B. This information can be accessed using SQL.

C. This information often cannot be updated by a user.

D. All of the above.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

8. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM
CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID

A. Equi-join

B. Natural join

C. Outer join

D. Cartesian join

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

9. Embedded SQL is which of the following?

A. Hard-coded SQL statements in a program language such as Java.

B. The process of making an application capable of generating specific SQL code on the fly.

C. Hard-coded SQL statements in a procedure.

D. Hard-coded SQL statements in a trigger.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

10. A UNION query is which of the following?

A. Combines the output from no more than two queries and must include the same number of columns.

9
B. Combines the output from no more than two queries and does not include the same number of columns.

C. Combines the output from multiple queries and must include the same number of columns.

D. Combines the output from multiple queries and does not include the same number of columns.

Answer: Option C

11. Which of the following statements is true concerning subqueries?

A. Involves the use of an inner and outer query.

B. Cannot return the same result as a query that is not a subquery.

C. Does not start with the word SELECT.

D. All of the above.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

12. Which of the following is a correlated subquery?

A. Uses the result of an inner query to determine the processing of an outer query.

B. Uses the result of an outer query to determine the processing of an inner query.

C. Uses the result of an inner query to determine the processing of an inner query.

D. Uses the result of an outer query to determine the processing of an outer query.

Answer: Option B

Explanation:

Correlated subquery references a column in the outer query and executes the subquery once for every row in the outer query while Uncorrelated subquery
executes the subquery first and passes the value to the outer query.

View Answer Discuss in Forum Workspace Report

13. How many tables may be included with a join?

A. One

B. Two

C. Three

D. All of the above.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

10
View Answer Discuss in Forum Workspace Report

14. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM
CUSTOMER_T,ORDER_T ;

A. Equi-join

B. Natural join

C. Outer join

D. Cartesian join

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

15. Which of the following is true concerning triggers?

A. You do not create them with SQL.

B. They execute against only some applications that access a database.

C. They have an event, condition, and action.

D. They cannot cascade (cause another trigger to fire).

Answer: Option C

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Recovery”.

1. SQL Server backup and restore operations occur within the context of the _______ model of the database.
a) backup
b) recovery
c) restore
d) None of the mentioned
View Answer

Answer: b
Explanation: A recovery model is a database property that controls how transactions are logged.

2. Point out the correct statement :


a) Backup models are designed to control transaction log maintenance
b) Restore models are designed to control transaction log maintenance
c) Recovery models are designed to control transaction log maintenance
d) None of the mentioned
View Answer

Answer: c
Explanation: Recovery Model is one of the mechanisms which controls and manages the growth of the transaction log file.

3. How many types of recovery model is provided by SQL Server ?


a) 2
b) 3
c) 4
d) 5
View Answer

Answer: b
Explanation: Three recovery models exist: simple, full, and bulk-logged.

4. No log backups is a feature of __________ recovery model.


a) Simple
b) Full

11
c) Bulk-logged
d) All of the mentioned
View Answer

Answer: a
Explanation: Simple recovery model is the simplest of all and maintains only a minimum amount of information in the SQL Server transaction log file.

5. Point out the wrong statement :


a) Managing databases with simple recovery model is much easier
b) Managing databases with full recovery model is much easier
c) Managing databases with bulk-logged recovery model is much easier
d) All of the mentioned
View Answer

Answer: a
Explanation: Manageability with Simple recovery model is much easier–no need to take transactional backups.

6. Which the following feature cannot be used in simple recovery mode ?


a) Media recovery without data loss
b) Log shipping
c) Database mirroring
d) All of the mentioned
View Answer

Answer: d
Explanation: perations that require transaction log backups are not supported by the simple recovery model.

7. Which of the following recovery models requires log backups ?


a) Simple
b) Full
c) Bulk
d) All of the mentioned
View Answer

Answer: b
Explanation: In full recovery model,no work is lost due to a lost or damaged data fileand it can even recover to an arbitrary point in time.

8. How many type of backups you can run when the data is in the “Full” recovery model ?
a) 5
b) 6
c) 7
d) All of the mentioned
View Answer

Answer: b
Explanation: Six backups if full recovery model are Complete backup,Differential backup,File and/or Filegroup backup,Partial backup,Copy-Only backup,Transaction
log backup.

9. The _______ recovery model is a special-purpose model that works in a similar manner to the full recovery model.
a) Simple
b) Full
c) bulk-logged
d) None of the mentioned
View Answer

Answer: c
Explanation: Full Recovery and Bulk-Logged Recovery models provide the greatest protection for data.

10. Which of the following statement is used for changing Recovery Model with T-SQL ?
a) ALTER DATABASE
b) ALTER TABLE
c) ALTER COLUMN
d) None of the mentioned
View Answer

Answer: a
Explanation: You can use ALTER DATABASE command with the SET RECOVERY option to change the recovery model of a database.

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Locking”.

1. Which of the following resource can be locked in SQL Server ?


a) TID
b) RID
c) PID
d) SID
View Answer

Answer: b
Explanation: RID stands for Row identifier and is used to lock a single row within a table.

12
2. Point out the correct statement :
a) Deadlocking is same as normal blocking
b) No other transactions can read or modify data locked with shared lock
c) A deadlock occurs when there is a cyclic dependency between two or more threads for some set of resources
d) All of the mentioned
View Answer

Answer: c
Explanation: Deadlock is a condition that can occur on any system with multiple threads, not just on a relational database management system.

3. ______________ allow concurrent transactions to read (SELECT) a resource.


a) Update locks
b) Shared locks
c) Exclusive Locks
d) All of the mentioned
View Answer

Answer: b
Explanation: Shared (S) locks on a resource are released as soon as the data has been read.

4. Which is the most restrictive isolation level in transaction ?


a) Repeatable Read
b) Snapshot
c) Read Committed
d) SERIALIZABLE
View Answer

Answer: d
Explanation: When SERIALIZABLE isolation level is set – a range lock is placed on the data set, preventing other users from updating or inserting rows into the data
set until the transaction is complete.

5. Point out the wrong statement :


a) Schema modification (Sch-M) locks are used when a table data definition language operationis being performed
b) By default, SQL Server transactions times out after a certain time
c) Disallowing a locking level can affect concurrency adversely
d) Table-level locking hints can be used when a finer control of the types of locks acquired on an object is required
View Answer

Answer: b
Explanation: SQL Server transactions do not time out (unless LOCK_TIMEOUT is set)

6. __________ locks allow processes to bulk copy data concurrently into the same table.
a) Bulk update
b) Bulk import
c) Bulk export
d) Bulk copy
View Answer

Answer: a
Explanation: Bulk update (BU) locks are used when bulk copying data into a table and either the TABLOCK hint is specified

7. Which of the following locking hint is similar to NOLOCK ?


a) PAGLOCK
b) READCOMMITTED
c) READUNCOMMITTED
d) SERIALIZABLE
View Answer

Answer: c
Explanation: Do not issue shared locks and do not honor exclusive locks.

8. Which of the following mode indicates the intention of the transaction to read all of the resources lower in the hierarchy ?
a) IS
b) IX
c) SIX
d) All of the mentioned
View Answer

Answer: c
Explanation: SIX stands for Shared with intent exclusive and can modify some (but not all) resources lower in the hierarchy by placing IX locks on those individual
resources.

9. Which of the following lock is incompatible with all lock modes ?


a) Intent exclusive (IX)
b) Schema stability
c) Schema modification
d) Bulk update
View Answer

13
Answer: c
Explanation: SQL Server allows only one Sch-M lock on an object at a time.

10. Which of the following mode has exclusive range and exclusive resource lock ?
a) RangeX_X
b) RangeS_U
c) RangeS_S
d) RangeI_N
View Answer

Answer: a
Explanation: RangeX-X locks are exclusive resource locks acquired on Index key values from a specific range when the transaction modifies a key value from the
Index.

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Transaction ”.

1. The INSERT, UPDATE, or DELETE statement fails if the OLE DB provider used to access the linked server does not support the _________ interface.
a) ITransJoin
b) ITransactionJoin
c) IactionJoin
d) None of the mentioned
View Answer

Answer: b
Explanation: ITransactionJoin is exposed only by providers that support distributed transactions.

2. Point out the correct statement :


a) Transaction ID Returns an object that can be used to specify configuration options for a subsequent call to ITransactionJoin
b) COMMIT WORK syntax, with or without specifying the optional keyword WORK, is compatible with SQL-92
c) You can use ROLLBACK WORK TRANSACTION to erase all data modifications made from the start of the transaction
d) SQL-92 was the third revision of the SQL database query language
View Answer

Answer: b
Explanation: SQL-92 was the third revision of the SQL database query language

3. __________ marks the end of a successful implicit or explicit transaction.


a) COMMIT TRANSACTION
b) ROLLBACK TRANSACTION
c) COMMIT WORK
d) All of the mentioned
View Answer

Answer: a
Explanation:

4. Syntax for COMMIT WORK statement in transaction is :


a)

COMMIT [ WORK ]

[;]

b)

COMMIT WORK [ WORK ]

[;]

c)

COMMITWORK [ WORK ]

[;]

d) None of the mentioned


View Answer

Answer:
Explanation: COMMIT WORK marks the end of a transaction.

5. Point out the wrong statement :


a) BEGIN TRANSACTION represents a point at which the data referenced by a connection is logically and physically consistent
b) BEGIN TRANSACTION deccrements @@TRANCOUNT by 2
c) BEGIN TRANSACTION starts a local transaction for the connection issuing the statement

14
d) All of the mentioned
View Answer

Answer:
Explanation: BEGIN TRANSACTION increments @@TRANCOUNT by 1.

6. ____________ rolls back a user-specified transaction to the beginning of the transaction.


a) ROLLBACK
b) ROLLBACK WORK
c) SAVE TRANSACTION
d) COMMIT
View Answer

Answer: b
Explanation: When nesting transactions, ROLLBACK WORK always rolls back to the outermost BEGIN TRANSACTION statement.

7. Which of the following is valid syntax for SAVE TRANSACTION with all the optional parameters ?
a)

SAVE { TRAN | TRANSACTION }

[;]

b)

SAVE { savepoint_name | @savepoint_variable }

[;]

c)

SAVE { TRAN | TRANSACTION } { savepoint_name | @savepoint_variable }

d) None of the mentioned


View Answer

Answer: c
Explanation: The savepoint defines a location to which a transaction can return if part of the transaction is conditionally canceled.

8. In _______ transaction we include the DML statements that need to be execute as a unit.
a) Explicit
b) Implicit
c) Distributed
d) All of the mentioned
View Answer

Answer: a
Explanation: Generally we don’t include Select statement in a transaction.

9. _________ permissions default to any valid user.


a) ROLLBACK WORK
b) ROLLBACK
c) COMMIT
d) None of the mentioned
View Answer

Answer: a
Explanation: When nesting transactions, ROLLBACK WORK always rolls back to the outermost BEGIN TRANSACTION statement and decrements the
@@TRANCOUNT system function to 0.

10. If @@TRANCOUNT is 1, ________ makes all data modifications performed since the start of the transaction a permanent part of the database.
a) COMMIT TRANSACTION
b) SAVE TRANSACTION
c) ROLLBACK TRANSACTION
d) None of the mentioned
View Answer

Answer: a
Explanation: If @@TRANCOUNT is greater than 1, COMMIT TRANSACTION decrements @@TRANCOUNT only by 1 and the transaction stays active.

1. Which of the following argument is ignored by database engine in COMMIT TRANSACTION?


a) @tran_name_variable
b) @tran_name
c) transaction_name
d) All of the mentioned
View Answer

Answer: a
Explanation: transaction_name specifies a transaction name assigned by a previous BEGIN TRANSACTION. transaction_name must conform to the rules for
identifiers

15
2. Point out the correct statement :
a) ROLLBACK TRANSACTION with a savepoint_name or transaction_name rolls back to the beginning of the transaction
b) A ROLLBACK TRANSACTION statement does produce any messages to the user
c) Issuing a COMMIT TRANSACTION when @@TRANCOUNT is 0 results in an error
d) All of the mentioned
View Answer

Answer: c
Explanation: Error condition implies that there is no corresponding BEGIN TRANSACTION.

3. ____________ is the preferred statement for indicating errors in the transaction.


a) SELECT
b) PRINT
c) RAISERROR
d) All of the mentioned
View Answer

Answer: c
Explanation: If warnings are needed in stored procedures or triggers, use RAISERROR.

4. Which of the following query deletes a job candidate ?


a)

BEGIN TRANSACTION;

GO

DELETE FROM HumanResources.JobCandidate

WHERE JobCandidateID = 13;

GO

COMMIT TRANSACTION;

b)

BEGIN TRANSACTION;

GO

DELETE FROM HumanResources.JobCandidate

WHERE JobCandidateID = 13;

GO

ROLLBACK TRANSACTION;

c)

BEGIN TRANSACTION;

GO

DELETE FROM HumanResources.JobCandidate

WHERE JobCandidateID = 13;

GO

END;

d) All of the mentioned


View Answer

Answer: a
Explanation: You cannot roll back a transaction after a COMMIT TRANSACTION statement is issued because the data modifications have been made a permanent
part of the database.

5. Point out the wrong statement :


a) It is the responsibility of the Transact-SQL programmer to issue COMMIT TRANSACTION only at a point when all data referenced by the transaction is logically
correct
b) The Database Engine increments the transaction count within a statement only when the transaction count is 1 at the start of the statement
c) You cannot roll back a transaction after a COMMIT TRANSACTION statement is issued
d) COMMIT transaction requires membership in the public role
View Answer

Answer: b
Explanation: The Database Engine increments the transaction count within a statement only when the transaction count is 1 at the start of the statement.

16
6. A ROLLBACK TRANSACTION statement specifying a savepoint_name releases any locks that are acquired beyond the savepoint, with the exception of:.
a) escalations
b) containment
c) contention
d) None of the mentioned
View Answer

Answer: a
Explanation: These locks are not released, and they are not converted back to their previous lock mode.

7. What is the fundamental difference between COMMIT and COMMIT WORK ?


a) COMMIT TRANSACTION accepts a user-defined transaction name
b) COMMIT WORK accepts a user-defined transaction name
c) COMMIT TRANSACTION accepts a user-defined function
d) COMMIT WORK accepts a user-defined stored procedure
View Answer

Answer: a
Explanation: COMMIT syntax, with or without specifying the optional keyword WORK, is compatible with SQL-92.

8. Implicit transactions are maintained by SQL Server for :


a) SELECT
b) DDL
c) DML
d) All of the mentioned
View Answer

Answer: d
Explanation: If there is an error occuring within these statements individually, SQL Server will roll back the complete statement.

9. ROLLBACK WORK always rolls back to the outermost BEGIN TRANSACTION statement for ___________ transactions.
a) Simple
b) Nested
c) Distributed
d) None of the mentioned
View Answer

Answer: b
Explanation: When nesting transactions, ROLLBACK WORK decrements the @@TRANCOUNT system function to 0.

10. Which of the following condition will ignore the request to enable delayed durability ?
a) DELAYED_DURABILITY = FORCED
b) DELAYED_DURABILITY = 0
c) DELAYED_DURABILITY = IGNORED
d) DELAYED_DURABILITY = NULL
View Answer

Answer: a
Explanation: The request is ignored if the database has been altered with DELAYED_DURABILITY = DISABLED or DELAYED_DURABILITY = FORCED.

1. With regards to transaction processing, any DBMS should be capable of:

a. Ensuring that transactions are free from interference from other users.

b. Parts of a transaction are not lost due to a failure.

c. Transactions do not make the database inconsistent.

d. All of the above.

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).All of the above.

2. What is ACID properties of Transactions?

17
a. Atomicity, Consistency, Isolation, Database

b. Atomicity, Consistency, Isolation, Durability

c. Atomicity, Consistency, Inconsistent, Durability

d. Automatically, Concurrency, Isolation, Durability

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Atomicity, Consistency, Isolation, Durability

3. Database locking concept is used to solve the problem of

a. Lost Update

b. Uncommitted Dependency

c. Inconsistent Data

d. All of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).All of the above

4. A lock that allows concurrent transactions to access different rows of the same table is known as a

a. Field-level lock

b. Row-level lock

c. Table-level lock

d. Database-level lock

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Field-level lock

5. A transaction completes its execution is said to be

a. Saved

b. Loaded

18
c. Rolled

d. Committed

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).Committed

6. A system is in a ______ state if there exists a set of transactions such that every transaction in the set is waiting for

another transaction in the set.

a. Idle

b. Waiting

c. Deadlock

d. Ready

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Deadlock

7. The deadlock state can be changed back to stable state by using _____________ statement.

a. Commit

b. Rollback

c. Savepoint

d. Deadlock

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Rollback

8. What are the ways of dealing with deadlock ?

a. Deadlock prevention

b. Deadlock recovery

c. Deadlock detection

19
d. All of the mentioned

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).All of the mentioned

9. When transaction Ti requests a data item currently held by Tj , Ti is allowed to wait only if it has a timestamp smaller

than that of Tj (that is, Ti is older than Tj ). Otherwise, Ti is rolled back (dies). This is

a. Wait-die

b. Wait-wound

c. Wound-wait

d. Wait

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Wait-die

10. When transaction Ti requests a data item currently held by Tj , Ti is allowed to wait only if it has a timestamp larger

than that of Tj (that is, Ti is younger than Tj ). Otherwise, Tj is rolled back (Tj is wounded by Ti ). This is

a. Wait-die

b. Wait-wound

c. Wound-wait

d. Wait

View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Wound-wait

11. The deadlock in a set of transaction can be determined by

a. Read-only graph

b. Wait graph

c. Wait-for graph

d. All of the mentioned

20
View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Read-only graph

12. A deadlock exists in the system if and only if the wait-for graph contains a ___________.

a. Cycle

b. Direction

c. Bi-direction

d. Rotation

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Cycle

13. Selecting the victim to be rollbacked to the previous state is determined by the minimum cost. The factors determining

cost of rollback is

a. How long the transaction has computed, and how much longer the transaction will compute before it completes its designated task.

b. How many data items the transaction has used.

c. How many more data items the transaction needs for it to complete and how many transactions will be involved in the rollback.

d. All of the above

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).All of the above

14. __________ rollback requires the system to maintain additional information about the state of all the running

transactions.

a. Total

b. Partial

c. Time

d. Commit

View Answer Report Discuss Too Difficult! Search Google

21
Answer: (b).Partial

15. Which of these is data type long literal?

a. 0x99fffL

b. ABCDEFG

c. 0x99fffa

d. 99671246

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).0x99fffL

16. Which of the following occurs when a transaction rereads data and finds new rows that were inserted by a command

transaction since the prior read?

a. Nonrepeatable read

b. Phantom read

c. Dirty read

d. Consistent read

View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Phantom read

17. A transaction for which all committed changes are permanent is called:

a. atomic

b. consistent

c. isolated

d. durable

View Answer Report Discuss Too Difficult! Search Google

Answer: (d).durable

22
18. In this instance, dirty reads are disallowed, while nonrepeatable reads and phantom reads are allowed.

a. Read committed

b. Read uncommitted

c. Repeatable read

d. Serializable

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Read committed

19. Which of the following occurs when a transaction rereads data it has previously read and finds modification or

deletions caused by a committed transaction?

a. Nonrepeatable read

b. Phantom read

c. Dirty read

d. Consistent read

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Nonrepeatable read

20. A transaction may not always complete its execution successfully. Such a transaction is termed

a. Aborted

b. Terminated

c. Closed

d. All of the mentioned

View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Aborted

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Log Shipping”.

23
1.Which of the following is the instance of SQL Server that is your production server in log shipping ?
a) secondary database
b) primary database
c) secondary server
d) primary server
View Answer

Answer: d
Explanation: Once the monitor server has been configured, it cannot be changed without removing log shipping first.

2. Point out the correct statement :


a) The restore job can be delayed until all users disconnect themselves
b) Log shipping cannot be combined with other disaster recovery options such as AlwaysOn Availability Groups
c) SQL Server log shipping has high cost in human
d) None of the mentioned
View Answer

Answer: a
Explanation: The database is not available only while the restore process is running.

3. In which of the following modes, the database is read-only ?


a) Stand by
b) Read only
c) Restore mode
d) All of the mentioned
View Answer

Answer: a
Explanation: There are two available modes and they are related to the state in which the secondary, log shipped.

4. Which of the following script can check the database recovery model by querying sys.databases for log shipping ?
a)

SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'jugal'

USE [master]

GO

UPDATE DATABASE [jugal] SET RECOVERY FULL WITH NO_WAIT

GO

b)

SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'jugal'

USE [master]

GO

ALTER DATABASE [jugal] SET RECOVERY FULL WITH NO_WAIT

GO

c)

SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'jugal'

USE [master]

GO

DROP DATABASE [jugal] SET RECOVERY FULL WITH NO_WAIT

GO

d) None of the mentioned


View Answer

Answer: b
Explanation: Make sure your database is in full or bulk-logged recovery model.

5. Point out the wrong statement :


a) The principal database in a mirroring session can also act as the primary database in a log shipping
b) Log Shipping is comparatively tougher than database mirroring for setup
24
c) The database log shipping setup needs to be initiated from the principal server using the SQL Server Management Studio wizard
d) A given database can be mirrored or log shipped; it can also be simultaneously mirrored and log shipped
View Answer

Answer: b
Explanation: Log Shipping is a pretty simple process to setup.

6. Which of the following stored procedure is used to add a primary database on primary server ?
a) sp_add_log_shipping_primary_database
b) sp_add_primary_database
c) sp_add_log_shipping
d) sp_add_log_shipping_primary
View Answer

Answer: a
Explanation: sp_add_log_shipping_primary_database stored procedure returns the backup job ID and primary ID.

7. Execute sp_add_jobschedule to add a schedule for the backup job on _________ server
a) primary
b) secondary
c) primary and secondary
d) None of the mentioned
View Answer

Answer: a
Explanation: sp_add_jobschedule creates a schedule for a job.

8. Which of the following is correct syntax for sp_add_log_shipping_secondary_primary ?


a)

sp_add_log_shipping_secondary_primary

[ @secondary_server = ] 'primary_server',

b)

sp_add_log_shipping_secondary_primary

[ @primary_server = ] 'primary_server',

c)

xp_add_log_shipping_secondary_primary

[ @primary_server = ] 'primary_server',

d) All of the mentioned


View Answer

Answer: b
Explanation: sp_add_log_shipping_secondary_primary sets up the primary information, adds local and remote monitor links, and creates copy and restore jobs on the
secondary server for the specified primary database.

9. Which of the following table stores history detail for log shipping jobs ?
a) log_shipping_monitor_alert
b) log_shipping_monitor_primary
c) log_shipping_monitor_history_detail
d) None of the mentioned
View Answer

Answer: c
Explanation: log_shipping_monitor_alert stores alert job ID.

10. _____________ maps primary databases to secondary databases in log shipping.


a) sp_change_log_shipping_primary_database
b) log_shipping_primary_databases
c) log_shipping_primary_secondaries
d) sp_help_log_shipping_primary_database
View Answer

Answer: c
Explanation: sp_help_log_shipping_primary_database retrieves primary database settings and displays the values from the log_shipping_primary_databases.

25
MCQ Based On Object-Oriented Database

1. ODL supports which of the following types of association relationships?

A. Unary

B. Unary and Binary

C. Unary and Binary and Ternary

D. Unary and Binary and Ternary and higher

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

2. An extent is which of the following?

A. A keyword that indicates that the subclass inherits from a superclass

B. A keyword that indicates that the superclass inherits from a subclass

C. The set of all instances of a class within a database

D. Only one instance of a class within a database

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

3. Identify the class name for the following code: ABC123 course();

A. ABC123

B. course

C. course()

D. All of the above.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

4. Using ODL, you can define which of the following?

26
A. Attribute

B. Structure

C. Operation

D. All of the above.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

5. The keyword "inverse" is used in which of the following?

A. Class

B. Attribute

C. Relationship

D. All of the above.

Answer: Option C

6. The object definition language (ODL) is which of the following?

A. Used to develop logical schemas

B. A data definition language for OODB

C. A method to implement a logical schema

D. All of the above.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

7. An atomic literal is which of the following?

A. Strings

B. Boolean

C. Long

D. All of the above.

Answer: Option D

27
Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

8. Which of the following is true concerning an ODBMS?

A. They have the ability to store complex data types on the Web.

B. They are overtaking RDBMS for all applications.

C. They are most useful for traditional, two-dimensional database table applications.

D. All of the above.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

9. The reserved word enum is used for which of the following?

A. To define a range for an attribute.

B. To define a range for a class.

C. To define a range for a relationship.

D. All of the above.

Answer: Option A.

10. Which of the following is an unordered collection of elements that may contain duplicates?

A. Set

B. Bag

C. List

D. Dictionary

Answer: Option B

11. Which of the following is true concerning the following statement: class Manager extends Employee

A. Manager is a concrete class and a superclass.

B. Manager is a concrete class and a subclass.

C. Manager is an abstract class and a superclass.

D. Manager is an abstract class and a subclass.

28
Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

12. Which of the following is an ordered collection of elements of the same type?

A. Set

B. Bag

C. List

D. Dictionary

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

13. A relationship should be specified how in the ODL?

A. One direction starting with the first class

B. One direction starting with the second class

C. Neither direction.

D. Both directions.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

14. Using OQL, you may do which of the following?

A. Return an entire collection of elements including duplicates.

B. Return a collection of elements without duplicates.

C. Return a specific subset of elements using a given criteria.

D. All of the above.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

29
15. The Object Query Language is which of the following"?

A. Similar to SQL and uses a select-from-where structure

B. Similar to SQL and uses a select-where structure

C. Similar to SQL and uses a from-where structure

D. Not similar to SQL

Answer: Option A

MCQ Based On Relationship

1. Every time attribute A appears, it is matched with the same value of attribute B, but not the same value of attribute C. Therefore, it is true that:

A. A → B.

B. A → C.

C. A → (B,C).

D. (B,C) → A.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

2. The different classes of relations created by the technique for preventing modification anomalies are called:

A. normal forms.

B. referential integrity constraints.

C. functional dependencies.

D. None of the above is correct.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

3. A relation is in this form if it is in BCNF and has no multivalued dependencies:

A. second normal form.

B. third normal form.

C. fourth normal form.

30
D. domain/key normal form.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

4. Row is synonymous with the term:

A. record.

B. relation.

C. column.

D. field.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

5. The primary key is selected from the:

A. composite keys.

B. determinants.

C. candidate keys.

D. foreign keys.

Answer: Option C

6. Which of the following is a group of one or more attributes that uniquely identifies a row?

A. Key

B. Determinant

C. Tuple

D. Relation

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

7. When the values in one or more attributes being used as a foreign key must exist in another set of one or more attributes in another table, we have created a(n):

31
A. transitive dependency.

B. insertion anomaly.

C. referential integrity constraint.

D. normal form.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

8. A relation is considered a:

A. Column.

B. one-dimensional table.

C. two-dimensional table.

D. three-dimensional table.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

9. In the relational model, relationships between relations or tables are created by using:

A. composite keys.

B. determinants.

C. candidate keys.

D. foreign keys.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

10. A functional dependency is a relationship between or among:

A. tables.

B. rows.

C. relations.

32
D. attributes.

Answer: Option D

11. Table is synonymous with the term:

A. record.

B. relation.

C. column.

D. field.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

12. Which of the following is not a restriction for a table to be a relation?

A. The cells of the table must contain a single value.

B. All of the entries in any column must be of the same kind.

C. The columns must be ordered.

D. No two rows in a table may be identical.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

13. For some relations, changing the data can have undesirable consequences called:

A. referential integrity constraints.

B. modification anomalies.

C. normal forms.

D. transitive dependencies.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

14. A key:

A. must always be composed of two or more columns.

33
B. can only be one column.

C. identifies a row.

D. identifies a column.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

15. An attribute is a(n):

A. column of a table.

B. two dimensional table.

C. row of a table.

D. key of a table.

Answer: Option A

16. A relation in this form is free of all modification anomalies.

A. First normal form

B. Second normal form

C. Third normal form

D. Domain/key normal form

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

17. If attributes A and B determine attribute C, then it is also true that:

A. A → C.

B. B → C.

C. (A,B) is a composite determinant.

D. C is a determinant.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

34
18. A tuple is a(n):

A. column of a table.

B. two dimensional table.

C. row of a table.

D. key of a table.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

19. If attribute A determines both attributes B and C, then it is also true that:

A. A → B.

B. B → A.

C. C → A.

D. (B,C) → A.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

20. One solution to the multivalued dependency constraint problem is to:

A. split the relation into two relations, each with a single theme.

B. change the theme.

C. create a new theme.

D. add a composite key.

Answer: Option A

MCQ Based On ER Model

1. Which of the following indicates the maximum number of entities that can be involved in a relationship?

A. Minimum cardinality

B. Maximum cardinality

C. ERD

35
D. Greater Entity Count (GEC)

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

2. Which type of entity cannot exist in the database unless another type of entity also exists in the database, but does not require that the identifier of that other
entity be included as part of its own identifier?

A. Weak entity

B. Strong entity

C. ID-dependent entity

D. ID- independent entity

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

3. In a one-to-many relationship, the entity that is on the one side of the relationship is called a(n) ________ entity.

A. parent

B. child

C. instance

D. subtype

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

4. Which type of entity represents an actual occurrence of an associated generalized entity?

A. Supertype entity

B. Subtype entity

C. Archetype entity

D. Instance entity

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

36
View Answer Discuss in Forum Workspace Report

5. A recursive relationship is a relationship between an entity and ________ .

A. itself

B. a subtype entity

C. an archetype entity

D. an instance entity

Answer: Option A

6. Which of the following indicates the minimum number of entities that must be involved in a relationship?

A. Minimum cardinality

B. Maximum cardinality

C. ERD

D. Greater Entity Count (GEC)

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

7. Which of the following refers to something that can be identified in the users' work environment, something that the users want to track?

A. Entity

B. Attribute

C. Identifier

D. Relationship

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

8. In which of the following is a single-entity instance of one type related to many entity instances of another type?

A. One-to-One Relationship

B. One-to-Many Relationship

C. Many-to-Many Relationship

37
D. Composite Relationship

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

9. Which of the following refers to an entity in which the identifier of one entity includes the identifier of another entity?

A. Weak entity

B. Strong entity

C. ID-dependent entity

D. ID-independent entity

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

10. Which type of entity is related to two or more associated entities that each contain specialized attributes that apply to some but not all of the instances of the
entity?

A. Supertype entity

B. Subtype entity

C. Archetype entity

D. Instance entity

Answer: Option A

11. An attribute that names or identifies entity instances is a(n):

A. entity.

B. attribute.

C. identifier.

D. relationship.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

12. Properties that describe the characteristics of entities are called:

38
A. entities.

B. attributes.

C. identifiers.

D. relationships.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

13. In which of the following can many entity instances of one type be related to many entity instances of another type?

A. One-to-One Relationship

B. One-to-Many Relationship

C. Many-to-Many Relationship

D. Composite Relationship

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

14. Entities of a given type are grouped into a(n):

A. database.

B. entity class.

C. attribute.

D. ERD.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

15. Which of the following is NOT a basic element of all versions of the E-R model?

A. Entities

B. Attributes

C. Relationships

39
D. Primary keys

Answer: Option D

16. In which of the following is a single-entity instance of one type of related to a single-entity instance of another type?

A. One-to-One Relationship

B. One-to-Many Relationship

C. Many-to-Many Relationship

D. Composite Relationship

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

17. Entities can be associated with one another in which of the following?

A. Entities

B. Attributes

C. Identifiers

D. Relationships

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

18. Which type of entity has its relationship to another entity determined by an attribute in that other entity called a discriminator?

A. Supertype entity

B. Subtype entity

C. Archetype entity

D. Instance entity

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

19. Which type of entity represents a logical generalization whose actual occurrence is represented by a second, associated entity?

A. Supertype entity

40
B. Subtype entity

C. Archetype entity

D. Instance entity

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

View Answer Discuss in Forum Workspace Report

20. In a one-to-many relationship, the entity that is on the many side of the relationship is called a(n) ________ entity.

A. parent

B. child

C. instance

D. subtype

Answer: Option B

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
View Answer

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

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

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

Answer: b
Explanation: A Candidate Key can be any column or a combination of columns that can qualify as unique key in database.

41
5. Which of the following is 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
View Answer

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

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

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

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

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

Answer: b
Explanation: Concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Advanced Query Optimization”.

1. _______________ is a procedural extension of Oracle – SQL that offers language constructs similar to those in imperative programming languages.
a) SQL
b) PL/SQL
c) Advanced SQL
d) PQL
View Answer

Answer: b
Explanation: PL/SQL is an imperative 3GL that was designed specifically for the seamless processing of SQL commands.

2. ___________ combines the data manipulating power of SQL with the data processing power of Procedural languages.
a) PL/SQL
b) SQL
c) Advanced SQL
d) PQL
View Answer

42
Answer: a
Explanation: PL/SQL is an imperative 3GL that was designed specifically for the seamless processing of SQL commands.

3. _______________ has made PL/SQL code run faster without requiring any additional work on the part of the programmer.
a) SQL Server
b) My SQL
c) Oracle
d) SQL Lite
View Answer

Answer: c
Explanation: An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information.

4. A line of PL/SQL text contains groups of characters known as


a) Lexical Units
b) Literals
c) Textual Units
d) Identifiers
View Answer

Answer: a
Explanation: Lexical items can be generally understood to convey a single meaning, much as a lexeme, but are not limited to single words.

5. We use ______________ name PL/SQL program objects and units.


a) Lexical Units
b) Literals
c) Delimiters
d) Identifiers
View Answer

Answer: d
Explanation: The database object name is referred to as its identifier.

6. A ___________________ is an explicit numeric, character, string or Boolean value not represented by an identifier.
a) Comments
b) Literals
c) Delimiters
d) Identifiers
View Answer

Answer: b
Explanation: The terms literal and constant value are synonymous and refer to a fixed data value.

7. If no header is specified, the block is said to be an _______________ PL/SQL block.


a) Strong
b) Weak
c) Empty
d) Anonymous
View Answer

Answer: d
Explanation: The terms literal and constant value are synonymous and refer to a fixed data value.

8. _________________ is a sequence of zero or more characters enclosed by single quotes.


a) Integers literal
b) String literal
c) String units
d) String label
View Answer

Answer: b
Explanation: The terms literal and constant value are synonymous and refer to a fixed data value.

9. In _______________ the management of the password for the account can be handled outside of oracle such as operating system.
a) Database Authentication
b) Operating System Authentication
c) Internal Authentication
d) External Authentication
View Answer

Answer: b
Explanation: Database management involves the monitoring, administration, and maintenance of the databases and database groups in your enterprise.

10. In ________________ of Oracle, the database administrator creates a user account in the database for each user who needs access.
a) Database Authentication
b) Operating System Authentication
c) Internal Authentication
d) External Authentication
View Answer
43
Answer: a
Explanation: Database management involves the monitoring, administration, and maintenance of the databases and database groups in your enterprise.

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Buffer Management”.

1. In order to reduce the overhead in retrieving the records from the storage space we use
a) Logs
b) Log buffer
c) Medieval space
d) Lower records
View Answer

Answer: b
Explanation: The output to stable storage is in units of blocks.

2. The order of log records in the stable storage ____________ as the order in which they were written to the log buffer.
a) Must be exactly the same
b) Can be different
c) Is opposite
d) Can be partially same
View Answer

Answer: a
Explanation: As a result of log buffering, a log record may reside in only main memory (volatile storage) for a considerable time before it is output to stable storage.

3. Before a block of data in main memory can be output to the database, all log records pertaining to data in that block must have been output to stable storage. This is
a) Read-write logging
b) Read-ahead logging
c) Write-ahead logging
d) None of the mentioned
View Answer

Answer: c
Explanation: The WAL rule requires only that the undo information in the log has been output to stable storage, and it permits the redo information to be written later.

4. Writing the buffered log to __________ is sometimes referred to as a log force.


a) Memory
b) Backup
c) Redo memory
d) Disk
View Answer

Answer: d
Explanation: If there are insufficient log records to fill the block, all log records in main memory are combined into a partially full block and are output to stable
storage.

5. The _______________ policy, allows a transaction to commit even if it has modified some blocks that have not yet been written back to disk.
a) Force
b) No-force
c) Steal
d) No-steal
View Answer

Answer: b
Explanation: No-force policy allows faster commit of transactions.

6. ______________ policy allows multiple updates to accumulate on a block before it is output to stable storage, which can reduce the number of output operations
greatly for frequently updated blocks.
a) Force
b) No-force
c) Steal
d) No-steal
View Answer

Answer: b
Explanation: No-force policy allows faster commit of transactions.

7. The ___________ policy, allows the system to write modified blocks to disk even if the transactions thatmade those modifications have not all committed.
a) Force
b) No-force
c) Steal
d) No-steal
View Answer

Answer: c
Explanation: The no-steal policy does not work with transactions that perform a large number of updates.

8. Locks on buffer blocks are unrelated to locks used for concurrency-control of transactions, and releasing them in a non-two-phase manner does not have any
implications on transaction serializability. This is

44
a) Latches
b) Swap Space
c) Dirty Block
d) None of the mentioned
View Answer

Answer: a
Explanation: These locks, and other similar locks that are held for a short duration.

9. The __________________ contains a list of blocks that have been updated in the database buffer.
a) Latches
b) Swap Space
c) Dirty Block
d) None of the mentioned
View Answer

Answer: c
Explanation: Dirty blocks are those that have been updated in memory, and the disk version is not up-to-date.

10. The operating system reserves space on disk for storing virtual-memory pages that are not currently in main memory; this space is called
a) Latches
b) Swap Space
c) Dirty Block
d) None of the mentioned
View Answer

Answer: b
Explanation: Almost all current-generation operating systems retain complete control of virtual memory.

This set of Database Question Bank focuses on “Concurrency in Index Structures”.

1. The method of access that uses key transformation is called as


a) Direct
b) Hash
c) Random
d) Sequential
View Answer

Answer: b
Explanation: Hash technique uses particular hash key value.

2. Why do we need concurrency control on B+ trees ?


a) To remove the unwanted data
b) To easily add the index elements
c) To maintain accuracy of index
d) All of the mentioned
View Answer

Answer: c
Explanation: Indices do not have to be treated like other database structures.

3. How many techniques are available to control concurrency on B+ trees?


a) One
b) Three
c) Four
d) None of the mentioned
View Answer

Answer: d
Explanation: Two techniques are present.

4. In crabbing protocol locking


a) Goes down the tree and back up
b) Goes up the tree and back down
c) Goes down the tree and releases
d) Goes up the tree and releases
View Answer

Answer: a
Explanation: It moves in a crab like manner.

5. The deadlock can be handled by


a) Removing the nodes that are deadlocked
b) Restarting the search after releasing the lock
c) Restarting the search without releasing the lock
d) Resuming the search
View Answer

45
Answer: b
Explanation: Crabbing protocol moves in a crab like manner.

6. In crabbing protocol the the lock obtained on the root node is in _________ mode.
a) Shared
b) Exclusive
c) Read only
d) None of the mentioned
View Answer

Answer: a
Explanation: Crabbing protocol moves in a crab like manner down the index tree.

7. If needed to split a node or coalesce it with its siblings, or redistribute key values between siblings, the crabbing protocol locks the parent of the node in
____________ mode.
a) Shared
b) Exclusive
c) Read only
d) None of the mentioned
View Answer

Answer: b
Explanation: Crabbing protocol moves in a crab like manner down the index tree.

8. In crabbing protocol to inset or delete a key value the leaf node has to be locked in ___________ mode.
a) Shared
b) Exclusive
c) Read only
d) None of the mentioned
View Answer

Answer: b
Explanation: Crabbing protocol moves in a crab like manner down the index tree.

9. B-link tree requires a pointer to its __________ sibling.


a) Upper
b) Lower
c) Right
d) Left
View Answer

Answer: c
Explanation: This pointer is required because a lookup that occurs while a node is being split may have to search not only that node but also that node’s right sibling.

10. Instead of locking index leaf nodes in a two-phase manner, some index concurrency-control schemes use ___________ on individual key values, allowing other
key values to be inserted or deleted from the same leaf.
a) B+ tree locking
b) Link level locking
c) Key-value locking
d) Next value locking
View Answer

Answer: c
Explanation: Key-value locking thus provides increased concurrency.

46

You might also like