10: Fundamentals of Databases Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Relational Database

A

A database where data is held in multiple tables, which are linked together by relationships

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

Primary Key

A

An attribute in a database table, that acts as a unique identifier for each record

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

Composite Primary Key

A

A primary key that consists of multiple attributes

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

Attribute

A

A category heading for each item of data in a column of a table

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

Foreign Key

A

A primary key of one table, that appears in another table to create a relationship between them

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

First Normal Form (3)

A
  • Each record has a primary key
  • Data is atomic
  • No repeating group of attributes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Second Normal Form

A

No partial dependencies (where a non-key attribute varies with only part of a composite primary key, a new table must be created)

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

Third Normal Form

A

No non-key dependencies (where one non-key attribute varies with another, a new table must be created)

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

Benefits of Normalised Databases (3)

A
  • Reduction in the amount of duplicated data
  • Improved data and referential integrity
  • Elimination of insertion, update and deletion anomalies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

SQL Retrieve Command

A

SELECT column_1, column_2, …
FROM table
WHERE condition[s]
ORDER BY column [DESC]
LIMIT num_limit
OFFSET num_offset

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

SQL Update Command

A

UPDATE table
SET column_1 = new_value_1, column_2, = new_value_2, …
WHERE condition[s]

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

SQL Insert Command

A

INSERT INTO table [(column_1, column_2, …)]
VALUES (value_1, value_2, …)

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

SQL Delete Command

A

DELETE FROM table
WHERE condition[s]

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

SQL Create Table Command

A

CREATE TABLE table (
column_1 datatype_1 [PRIMARY KEY],
column_2 datatype_2,

[FOREIGN KEY (foreign_key_1) REFERENCES other_table (primary_key),
…]
)

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

A Client Server Database System Provides ____

A

Simultaneous access to the database for multiple clients

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

Concurrent Access Can Result In ____ If Two Clients ____

A

The problem of updates being lost, edit a record at the same time

17
Q

Record Locks (4)

A
  • A record is locked whenever a user retrieves it for updating
  • Another user trying to retrieve the same record is denied access until the transaction is complete
  • If two users are trying to update two records, deadlock can occur
  • Deadlock is where user 1 locks record 1 and tries to update record 2 in the same transaction, but user 2 has locked record 2 and is trying to update record 1 so neither user can proceed
18
Q

Serialisation (3)

A
  • Serialisation ensures transactions do not overlap in time so cannot interfere
  • A transaction cannot start until the previous one has finished
  • Serialisation can be implemented using timestamp or commitment ordering
19
Q

Timestamp Ordering (5)

A
  • Whenever a transaction starts, it is given a timestamp
  • If two transactions affect the same object, the transaction with the earlier timestamp is applied first
  • To ensure transactions are not lost, every object has read and write timestamps, which are updated whenever it is read or written to
  • When a transaction starts, it reads data, setting a read timestamp
  • Before it writes back, if the read timestamp is different, it knows another transaction is taking place, avoiding problems
20
Q

Commitment Ordering (2)

A
  • Transactions are ordered in terms of their dependencies on each other
  • Where one request would cause a deadlock, it is blocked until another is completed