Databases Flashcards

1
Q

What is a data model?

A

An abstract model of which things to store and what information about them should be recorded.

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

What is an Entity?

A

An object, event, person or thing about which data is to be stored

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

What is an attribute?

A

Attributes are characteristics or other information about entities

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

How are databases formed?

A

They are formed of tables which are used to store multiple entities

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

What is the notation for an entity description?

A

Entity1 (Attribute1, Attribute2 ….)
-The primary key is always underlined

Example: Patient (Title, Firstname, Surname, Address, Email)

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

What is an entity identifier?

A
  • An attribute given to each entity which is unique within that table.
  • Also known as the primary key.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a requirement of primary keys (entity identifiers)?

A

They must be unique

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

What are the three types of relationships entities can have with each other?

A

One-to-one
One-to-many
Many-to-many

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

What is an Entity relationship diagram?

A

They graphically represent the relationships between tables/entities in a database

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

What does it mean when entities have a link between them in an Entity relationship diagram?

A

That the two entities are related in some way,

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

What 2 things show a relationship in an Entity relationship diagram?

A
  • Both the degree and the name of the relationship need to be specified
  • For example: Head teacher ——————– School
    The degree: One-to-one
    The name: In charge of
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What type of key is formed of multiple attributes, combined to form the primary key?

A

A composite key

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

What is a composite primary key?

A

A key formed of multiple attributes, combined to form the primary key
(also known as just a composite key)

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

What is a primary key?

A

an attribute that uniquely identifies every entity in a database

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

What is a foreign key?

A
  • An attribute that is a primary key in another table

- The attribute exists in both tables

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

How is the primary key and foreign represented in an entity description?

A

-The primary key has an asterisk next to it
For example: PatientID *
-The foreign key is in italics

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

When is a link table used?

A
  • It’s used to represent many-to-many relationships

- It creates a third table (the linking table) as many to many relationships are impossible to represent on a computer

18
Q

What is a relational database?

A

A database that is formed of multiple tables that are linked together by common attributes

19
Q

How is a record with a primary key quickly located?

A

An index of the primary key and is automatically maintained by the database software, it gives the position of every record according to its primary key

20
Q

What is Normalisation?

A

The process used to make the design of a database the most efficient without compromising the integrity of the data

21
Q

What are the advantages of normalising a database

A
  • It allows for faster searching and sorting and saves storage space as it creates smaller tables
  • They are easier to maintain.
  • Data consistency is improved, reducing the number of anomalies that occur.
  • Data integrity is maintained as there is no unnecessary duplication of data.
22
Q

When is a database in first normal form?

A

If the database contains no repeating attribute/group of attributes

23
Q

What does atomic mean?

A

It means that no single column contains more than one value

24
Q

When is a database in second normal form?

A
  • It must satisfy first normal form

- Contains no partial key dependencies

25
Q

What is a partial key dependency?

A

When attributes depend on only one part of the primary key (only happens when the primary key is a composite primary key)

26
Q

When is a database in third normal form?

A
  • It must satisfy second normal form

- It must have no non-key dependencies

27
Q

What is a non-key dependency?

A

Where the value of an attribute is determined by the value of another attribute which is not part of the key

28
Q

What does a client server database system provide?

A

It provides simultaneous access to a database for multiple clients

29
Q

What is concurrent access?

A

It’s a problem caused when multiple users attempt to access/update the same field in database at the same time

30
Q

What problems can concurrent access lead to?

A

It can result in updates being lost if two users edit a record at the same time

31
Q

What are the 4 methods for dealing with concurrent access?

A
  • Record locks
  • Serialisation
  • Timestamping
  • Commitment ordering
32
Q

How does record locks solve the problem of concurrent access?

A
  • When a user accesses a record, it is immediately locked to other users until the first user has finished using it.
    Other users can’t access the content of a field until it has been unlocked
33
Q

How does Serialisation solve the problem of concurrent access?

A
  • Requests from other users are placed in a queue.

- Once the first user has finished, the next command in the queue is executed

34
Q

How does Timestamp ordering solve the problem of concurrent access?

A
  • When multiple commands are sent to the same field in a database, each is assigned a timestamp which marks the point in time at which the command was initiated.
  • Commands are carried out on the field in the order of their timestamps.
35
Q

How does Commitment ordering solve the problem of concurrent access?

A
  • Uses an algorithm work out the optimum order in which to execute commands for a field.
  • The algorithm takes into account the impact of commands on the rest of the database
  • It attempts to minimise issues occuring.
36
Q

What are the characteristics of serial files?

A
  • Data is stored in the order in which it was entered
  • No order to the data is maintained
  • useful for storing transactional data or initialisation files
37
Q

What are the characteristics of serial files?

A
  • Store data in order of a key field
  • The order is maintained when new records are added
  • useful for storing master files
38
Q

What is a flat file database?

A

A database composed of one table/file

39
Q

What is a database?

A

Structured, persistent collections of data

40
Q

What are the advantages of using databases?

A
  • Makes processing more efficient
  • Avoids redundancy
  • Allows users to only see relevant data
  • Saves Storage space
41
Q

What do database management systems (DBSM) provide?

A
  • Additional security, provides a centralised automatic backup
  • Program/data independence
  • Integrity to ensure efficiency and structure is not compromised
  • A manipulation language to access/change the data
42
Q

What does program/data independence mean?

A
  • Data is separated from programs that can access it

- Advantage being that software tools that control the database can be modified without affecting the data