Database Flashcards
FNF
Each table cell should contain a single value
Each record needs to be unique
Composite key consists of several columns
SNF
- BE in FNF
Single column primary key does not depend on any subset of candidate key relation
TNF
- Be in SNF
- No transitive functional dependencies
BCNF
If there is more than one Candidate Key
Transaction Isolation Levels
-Read Uncommitted
-Read Committed - issue exclusive locks at the time of modification. Prevents Dirty Read. However data can be changed between individual statements
-Repeatable Read - Shared locks are placed on all data read by each statement. Data that has been read cannot be modified
-Snapshot Isolation - Data read at the beginning of the transaction will be the same as the end of the transaction. Snapshot do not block transactions from reading or modifying the data.
-Serializable - the most strict level of isolation. Transactions cannot read nor write any data before the transaction finished
Clustered vs non clustered indexes
Clustered indexes are part of the table structure
Non-clustered indexes are a separate structure with pointers to the actual data
Clustered indexes are in most common cases faster