Database fundamentals Flashcards

1
Q

Name five features of a relational database.

A
  1. Consists of tables with columns and rows.
  2. Uses keys: primary, foreign.
  3. Uses relationships: one-to-many.
  4. Uses transactions.
  5. Uses SQL.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do columns and rows in a database table represent?

A

Columns: Represent the data that should be in the DB. These are the structure and rules for the data.
Rows: The actual data.

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

What is a primary key?

A

A unique piece of data. Can be naturally unique or system generated piece of data. It is identified by the column and makes each row unique. Allows you to connect tables together (form relationships between tables).

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

What are the three kinds of table relationships?

A
  1. One-to-many: most common
  2. Many-to-many: not too common but used. Uses a junction or linking table between the two tables.
  3. One-to-one: not common
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is a transaction defined?

A

A transaction is a combined unit of work. Think of a simple money transfer.

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

What is the ACID test?

A

A: Atomic (indivisible) - All or nothing.
C: Consistent - Take the DB from one valid state to another valid state based on the rules of the DB.
I: Isolated - The data and the transaction are locked while the transaction is occurring.
D: Durable - Robust. Once the transaction is done, it is guaranteed.
All transactions must pass the ACID test.

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

What is SQL?

A

Structured Query Language. It is a declarative query language so you describe what you want and the DMS figures out the procedural stuff: SELECT * FROM Books WHERE ListPrice > 40.
Uses C-R-U-D.
PLSQL: Oracle SQL
T-SQL: Microsoft SQL server

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