1.3.2 Databases Flashcards

1
Q

Define a database

A

An organised collection of data

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

Define a table

A

Stores data about a type of entity

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

Define an attribute

A

A column in a table, called a field

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

Define a primary key

A

An entirely unique identifier for an entity

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

Define a composite key

A

A pair of two attributes to make a primary key

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

Define a foreign key

A

A non-primary key attribute in one table which links to the primary key field in another table

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

Define data integrity

A

This refers to the accuracy and reliability of data

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

Define referential integrity

A

This refers to the data integrity in relational databases. It tidies up any effected records.

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

What are the types of entity relationships?

A

1 to 1

1 to many

Many to many

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

Define a flat-file

A

A single table which contains all the data, which can have repeating data or data which extends over multiple lines

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

Define the stages of 1st Normal Form

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

Define the stages of 2nd Normal Form

A
  • Data is in 1NF
  • There are no partial dependancies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define the stages of 3rd Normal Form

A
  • Data is in 2NF
  • There are no non-key dependencies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is SQL?

A

The standard tool for working with databases. It is a declarative language

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

Explain the DELETE SQL command

A

DELETE FROM tblName

WHERE [criteria];

This deletes from the table any record which matches the criteria

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

Explain the INSERT SQL command

A

INSERT INTO tblName (field-list)

VALUES (value-list);

This adds a record into the table with the specified values

17
Q

Explain the SELECT SQL command

A

SELECT field-list

FROM tblName

18
Q

Explain the DROP SQL command

A

DROP TABLE tblName

or DROP DATABASE dbName

or DROP INDEX field-name ON tblName

This will delete the item named

19
Q

Explain the JOIN SQL command

A

SELECT field-list

FROM tblName1

JOIN tblName2

On join-criteria

This allows data from 2 different tables to be selected, where the tables are linked with a foreign-primary key pair

20
Q

Explain the ORDER BY SQL command

A

… ORDER BY field1 [ASC/DESC];

This orders the selected data in either ascending or descending order according to the criteria

21
Q

What is the SQL wildcard?

A

*

This states to disregard what comes before/after the * for the given text

22
Q

What is a client-server database?

A

A database residing on a server, with client applications written to access the database

23
Q

What is concurrent requests?

A

When a request is made at the same time as another request

24
Q

What is a problem with concurrent requests?

A

If one request is to update data, while another is to read or update data, then a problem can arise

25
What is a transaction in regards to client-server databases?
A single logical action / unit of work
26
What are the features of a good database?
Atomicity Consistency Isolation Durability
27
Describe atomicity in regards to databases
The components of a transaction are atomic, it must succeed or fail
28
Describe consistency in regards to databases
Ensuring an illegal transaction is rejected so that the integrity is upheld
29
Describe isolation in regards to databases
Each transaction is dealt with in a way that doesn't affect others
30
Describe durability in regards to databases
Ensuring data is saved once a transaction is completed
31
Define serialisation
The concept of multiple transactions executing concurrently with the effect of them executing serially
32
Define record locking
The DBMS (Database Management System) will lock an affected record while it is involved in a transaction
33
Define a deadlock in regards to databases
When two transactions are trying to access records being used by each other transaction, but both are locked
34
Describe timestamp ordering in regards to databases
* Each record has timestamps for when it was last read and last updated * Each transaction has timestamps for when it starts and ends * The transactions are carried out in timestamp order * The transaction will not go through if the timestamp of a record being updated is after the timestamp of a transaction starting