In what situations would an index be helpful? Not helpful?
Indexing makes columns faster to query by creating pointers
to where data is stored within a database. With an index we can locate a few
rows in a large table without doing a linear scan of the table file. However,
in smaller tables, using and index is usually not necessary. Also, if many/most
rows in a table will be returned, using an index can actually slow you down. In
this case, a linear case may be faster.
What does consistency (the C in ACID) mean to you?
Consistency means that integrity constraints must be
maintained so that the database is consistent before and after the
transaction.
What are the 4 isolation levels and what do they mean?
Read Uncommitted – Read Uncommitted is the lowest
isolation level. In this level, one transaction may read not yet committed
changes made by other transaction, thereby allowing dirty reads. In this level,
transactions are not isolated from each other.
Read Committed – This isolation level guarantees that
any data read is committed at the moment it is read. Thus, it does not allows
dirty read. The transaction holds a read or write lock on the current row, and
thus prevent other transactions from reading, updating or deleting it.
Repeatable Read – This is the most restrictive
isolation level. The transaction holds read locks on all rows it references and
writes locks on all rows it inserts, updates, or deletes. Since other transaction
cannot read, update, or delete these rows, consequently it avoids
non-repeatable read.
Serializable – This is the Highest isolation level.
A serializable execution is guaranteed to be serializable.
Serializable execution is defined to be an execution of operations in which
concurrently executing transactions appears to be serially executing.