Transaction Concepts, ACID, Normalization Flashcards

1
Q

What are ACID transactions in a database?

A
  • A Transaction is a logical unit of work in which all steps must be performed or none.
  • ACID describes the properties of a Transaction. In the context of transaction processing, the acronym ACID refers to atomicity, consistency, isolation, and durability.
  • After a transaction successfully completes, changes to data persist and are not undone, even in the event of a system failure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Normalization?

A

A process of organizing the fields and tables of a relational database to minimize redundancy and dependency.

  1. Supports ACID Properties
  2. Reduces NULL values
  3. Enables efficient indexing
  4. Eliminates redundant data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the first three Normal Forms?

A

1NF - Removes duplicated attributes. Attribute data should be atomic and attribute should be the same kind.
2NF - Should be in 1NF and each non-key is fully dependent on the primary key.
3NF - Should be in 2NF and all the non-key attributes which are not dependent on the primary key should be removed. All the attributes which are dependent on the other non-key attributes should also be removed.

1-3NF is called Normalization and is done in OLTP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Denormalization and when would it be used?

A

Denormalization is the reverse process of Normalization. It can increase the query performance by reducing the number of joins. Denormalization can increase redundancy and is used for OLAP applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Atomicity?

A

Atomicity means the transaction finishes completely, or it will not occur at all.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Consistency?

A

Consistency means the transaction will repeat in a predictable way each time it is performed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Isolation?

A

The data in the transactions are independent of each other. The success of one transaction doesn’t depend on the success of another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Durability?

A

Durability guarantees the database will keep track of the pending changes so that the server will be able to recover if an error occurs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does @@TRANCOUNT do?

A

Returns the number of active transactions for the current user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly