Final Flashcards
The time required to read or write the first byte of data is known as _____.
access time
transfer rate
random-access
volatility
access time
A magnetic disk groups data into _____.
blocks
sectors
kilobytes
pages
sectors
A relational database uses row-oriented storage to store an entire row
within one _____.
Table
block
page
sector
block
With column-oriented storage, a block stores values for _____.
a single column
non-key columns
key columns only
all table columns
a single column
Data was not saved before a system was accidentally powered off. This data was located in _____.
non-volatile memory
volatile memory
flash storage
magnetic storage media
volatile memory
The heap table structure is optimized for _____.
inserting new rows
deleting all rows with primary key between two fixed values
reading all rows with primary key between two fixed values
updating all occurrences of a specific value of a column, in all rows
inserting new rows
The sort column in a sorted table determines the _____ row order.
key
physical
dynamic
linked
physical
Which table structure might use the modulo function to locate rows?
Sorted
Hash
Heap
Cluster
Hash
In a multi-table, a _____ column is available in all interleaved tables.
sort
hash function
bucket
cluster key
cluster key
A _____ assigns each row to a group of linked blocks, called a bucket.
hash table
heap table
table cluster
sorted table
hash table
A single-level index is a file that contains column values and pointers to _____ containing the column _____.
tables, key
blocks, key
rows, value
tables, rows
rows, value
In order to locate rows selected by a query, an index scan reads index blocks _____.
in reverse order
randomly
sequentially
in order of key values
sequentially
When performing a search, which scan type is fastest?
Cluster
Row
Table
Index
Index
A _____ index is an index on a non-unique sort column.
clustering
primary
secondary
sorted
Clustering
When a table is updated and the index block has no free space for a new index entry, what happens?
An error results.
A new block is merged.
The block splits.
The entry is removed.
The block splits
The bottom level of a multi-level index is a _____index.
sorted single-level
unsorted single-level
bottom-level block
primary and clustering
sorted single-level
What is the fan-out for a multi-level index where index entries are 32 bytes and index blocks are 10 kilobytes?
Approximately 400
Approximately 300
Approximately 200
Approximately 500
Approximately 300
How are blocks read with a single-level index scan?
A scan is initiated to read all table blocks. Index blocks are then read.
The search reads one index block plus selected table blocks.
A scan reads all index blocks to find table blocks that contain selected rows. The table blocks are then read.
A scan is initiated to read all table blocks that contain index blocks with selected data.
A scan reads all index blocks to find table blocks that contain selected rows. The table blocks are then read.
Branches that are similar in length in an index hierarchy are _____.
sparse
primary
balanced
dense
balanced
Which of the following is a characteristic of a B-tree index, but not a B+tree index?
Pointers to table blocks appear only in the bottom level.
All column values appear in the bottom level.
Column values are occasionally repeated in the index.
Column values do not repeat at lower levels.
Column values do not repeat at lower levels.
Hash index entries are assigned to _____.
buckets
values
clusters
blocks
buckets
What are two characteristics of an efficient bitmap index?
The WHERE clause may specify any values in upper case. The column used in a WHERE clause may contain mixed upper and lower case characters.
The database can quickly determine the block containing a table row from the index row number. Any indexed column contains relatively few distinct values.
Each bucket initially has one block. Any additional blocks are allocated and linked to the initial block.
Indexes change only when primary key values are updated. Physical indexes change whenever a row moves to a new block.
The database can quickly determine the block containing a table row from the index row number. Any indexed column contains relatively few distinct values.
What is a characteristic of a logical index?
Each bucket initially has one block.
Any additional blocks are allocated and linked to the initial block.
The block containing a table row is determined from the index row number.
Index does not change when a row moves to a new block.
Index does not change when a row moves to a new block.
A column contains grades from 0 to 10, but a WHERE clause specifies values from 0 to 100. A _____ index can be used to modify the column values and process the queries.
logical
function
multi-level
single-level
function
In a logical index, pointers to table blocks are replaced with _____ values.
artificial key
primary key
foreign key
composite key
primary key
What object maps one or more tables to a single file?
Tablespace
Shard
Vertical partition
Horizontal partition
tablespace
A subset of table rows is called a _____.
horizontal partition
fragment
cluster
vertical partition
horizontal partition
How does a list partition assign rows to partition?
A value that is determined automatically by the database.
A return value from a partition expression that uses VALUES IN.
A return value from a partition expression that specifies MAXVALUE.
A specified number of partitions assigned with positive integer values.
A return value from a partition expression that uses VALUES IN.
When a table is assigned to a tablespace, where is the index stored?
In an adjacent tablespace.
Within the table.
In the same tablespace as the table.
In a separate tablespace file.
In the same tablespace as the table.
A _____ partition requires a partition expression with positive integer values.
vertical
list
hash
horizontal
hash
Which storage engine provides full support for transaction management and locking?
MEMORY
MySQL
MyISAM
InnoDB
InnoDB
In MySQL with InnoDB, how are primary and secondary indexes created?
Primary indexes are automatically created for each primary key. Secondary indexes are created manually for all foreign keys.
Primary indexes are manually created for each primary key. Secondary indexes are created manually for all foreign keys.
Primary indexes are automatically created for each primary key. Secondary indexes are created automatically for all foreign keys.
Primary indexes are manually created for each primary key. All secondary indexes are created automatically.
Primary indexes are automatically created for each primary key. Secondary indexes are created automatically for all foreign keys.
In MySQL with InnoDB, tables with a primary key have a _____ structure, while those without a primary key have a _____ structure.
cluster, heap
sorted, hash
sorted, heap
heap, sorted
sorted, heap
What approach can a database administrator use to assess the effectiveness of indexes when investigating slow queries?
Inspect query logs
Partition large tables
Change the primary key
Run EXPLAIN on queries
Run EXPLAIN on queries
A database _____ is a unit of work that is treated as a whole. It is either completed as a unit or failed as a unit.
commit
operation
rollback
transaction
transaction
In an online bank application that transfers funds from a checking account to a savings account, if a debit is made successfully from the checking account, the _____ property ensures that the corresponding credit is made to the savings account.
atomicity
isolation
consistency
durability
atomicity
In an online bank application that transfers funds from a checking account to a savings account, the _____ property ensures that another transaction sees the transferred funds in one account or the other, but not in both, nor in neither.
durability
atomicity
isolation
consistency
isolation
In an online bank application that transfers funds from a checking account to a savings account, the _____ property ensures that the changes made to each account will not be lost due to a computer failure.
durability
consistency
isolation
atomicity
durability
A ____ is a sequential order of database instructions for multiple transactions.
Query
Transaction
Schedule
Path
Schedule
Refer to the schedule below. The initial value of B is 7 and C is 3. What is the value of A after the schedule executes?
A schedule with two transactions. Line 1, T1: read B. Line 2, T1: A = B + 1. Line 3, T1: write A. Line 4, T1: commit. Line 5, T2: read C. Line 6, T2: B = C - 2. Line 7, T2: write B. Line 8, T2: commit.
4
7
8
2
8
Refer to the schedule below. The initial value of B is 7 and C is 3. What is the value of A after conflicting schedule executes?
A schedule with two transactions. Line 1, T2: read C. Line 2, T2: B = C - 2. Line 3, T2: write B. Line 4, T1: read B. Line 5, T1: A = B + 1. Line 6, T1: write A. Line 7, T1: commit. Line 8, T2: commit.
4
7
8
2
2
In which isolation level can dirty reads occur?
Repeatable read
Serializable
Read uncommitted
Read committed
Read uncommitted
Which isolation level prevents dirty, non-repeatable, and phantom reads?
Repeatable read
Serializable
Read committed
Read uncommitted
Serializable
A database administrator is updating one of the tables in the database. Which of the following techniques can prevent other database administrators from doing concurrent transactions to the same table?
Scoping
Logging
Mirroring
Locking
Locking
A _____ is a part of the concurrency system that monitors, grants, and releases locks.
Lock Optimizer
Lock Administrator
Lock System
Lock Manager
Lock Manager
In a _____, all transactions come to a halt and remain at a standstill until one of the transactions is aborted.
deadlock
locking
two-phase locking
timeout
deadlock
Which deadlock management technique automatically rolls back a transaction when a lock is not released in a fixed period of time?
Cycle detection
Timeout
Data ordering
Aggressive locking
Timeout
Refer to the table and schedule below. The UPDATE statement in transaction T1 holds an exclusive lock on the Class table. With strict two-phase locking, when does the SELECT statement in transaction T2 execute?
A schedule with two transactions. Line 1, T1: UPDATE Class. Line 2, T1: SET TeacherID = 32412. Line 3, T1: WHERE ClassID = 80;. Line 4, T2: SELECT CourseTitle. Line 5, T2: FROM Class WHERE ClassID = 80;. Line 6, T1: ROLLBACK;.
Immediately after the UPDATE statement in T1 executes
After the ROLLBACK statement in T1 executes
The SELECT statement in T2 will never execute
At the same time as the UPDATE statement in T1 executes
After the ROLLBACK statement in T1 executes
A document that sequentially writes all the database operations is known as a/an _____.
system log
task log
recovery log
application log
recovery log
A recovery system should manage which three failure scenarios?
Transaction failure, System failure, and Storage media failure
Transaction failure, Memory failure, and Storage media failure
Transaction failure, Program failure, and Storage media failure
Transaction failure, System failure, and Application failure
Transaction failure, System failure, and Storage media failure
The username and password for the database in the configuration file of a web application is incorrect, so the web application cannot connect to the database. Which failure scenario best describes this example?
System failure
Storage media failure
Transaction failure
Task failure
Transaction failure
Choose the recovery log that is generated by the schedule below.
A schedule with two transactions. Line 1, T1: read B. Line 2, T2: read C. Line 3, T1: A = B + 1. Line 4, T1: write A. Line 5, T1: commit. Line 6, T2: B = C - 2. Line 7, T2: write B. Line 8, T2: rollback.
- start T1
- start T2
- update T1, AID, Aoriginal, Anew
- update T2, BID, Boriginal, Bnew
- undo T2, BID, Boriginal
- commit T1
- rollback T2
- start T1
- start T2
- update T1, AID, Aoriginal, Anew
- commit T1
- update T2, BID, Boriginal, Bnew
- undo T2, BID, Boriginal
- rollback T2
- start T1
- update T1, AID, Aoriginal, Anew
- start T2
- update T2, BID, Boriginal, Bnew
- undo T2, BID, Boriginal
- commit T1
- rollback T2
- start T1
- update T1, AID, Aoriginal, Anew
- start T2
- commit T1
- update T2, BID, Boriginal, Bnew
- undo T2, BID, Boriginal
- rollback T2
- start T1
- start T2
- update T1, AID, Aoriginal, Anew
- commit T1
- update T2, BID, Boriginal, Bnew
- undo T2, BID, Boriginal
- rollback T2
In the recovery log below, line 6 is a/an _____.
- start T1
- start T2
- update T1, AID, Aoriginal, Anew
- commit T1
- update T2, BID, Boriginal, Bnew
- undo T2, BID, Boriginal
- rollback T2
checkpoint record
transaction record
update record
compensation record
compensation record
_____ is a recovery technique that creates a nearly synchronized backup of the primary database on another database server.
Data backup
Cold backup
Storage backup
Hot backup
Hot Backup
Refer to the sequence below. What is the isolation level of transaction E?
session begins
SET GLOBAL TRANSACTION
ISOLATION LEVEL SERIALIZABLE;
session ends
session begins
SET SESSION TRANSACTION
ISOLATION LEVEL REPEATABLE READ;
transaction A
transaction B
SET TRANSACTION
ISOLATION LEVEL READ UNCOMMITTED;
transaction C
SET TRANSACTION
ISOLATION LEVEL READ COMMITTED;
transaction D
transaction E
session ends
Read uncommitted
Read committed
Repeatable read
Serializable
Repeatable Read
A transaction _____ indicates the starting and ending statement of a database transaction.
boundary
scope
coverage
limit
boundary
Refer to the initial Class table, SQL transaction, and final Class table, below. Which SAVEPOINT identifier is used to produce the final Class table?
A table named INITIAL CLASS TABLE with 5 rows and 4 columns. The first row contains headers ClassId, CourseCode, CourseTitle, TeacherId. The second row contains entries 12, HTML1, Web Development, 32412. The third row contains entries 30, DB1, Databases, 11234. The fourth row contains entries 56, PROG1, Programming, 11234. The fifth row contains entries 80, MATH26, Algebra, NULL.
START TRANSACTION;
SELECT CourseTitle FROM Class;
SAVEPOINT S1;
UPDATE Class SET CourseTitle = “Programming in C” WHERE ClassID = 56;
SAVEPOINT S2;
UPDATE Class SET TeacherID = 32412 WHERE ClassID = 56;
SAVEPOINT S3;
DELETE FROM Class WHERE ClassID = 80;
SAVEPOINT S4;
ROLLBACK TO _____;
UPDATE Class SET TeacherID = 32412 WHERE ClassID = 80;
COMMIT;
A table named FINAL CLASS TABLE with 5 rows and 4 columns. The first row contains headers ClassId, CourseCode, CourseTitle, TeacherId. The second row contains entries 12, HTML1, Web Development, 32412. The third row contains entries 30, DB1, Databases, 11234. The fourth row contains entries 56, PROG1, Programming, 11234. The fifth row contains entries 80, MATH26, Algebra, 32412.
S3
S2
S4
S1
S2
_____ allows all executed database instructions to be rolled back and to be restored in a prior transaction state.
RELEASE SAVEPOINT
SET TRANSACTION
COMMIT
SAVEPOINT
SAVEPOINT
In MySQL, which of the following SQL operations always commits immediately?
DELETE
SELECT
CREATE
INSERT
CREATE