Databases Flashcards

1
Q

What is the purpose of a primary key in a database?

A

Uniquely identifies a record in a database (will most likely have No/Ref/Id/Code in its name)

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

What is the purpose of a foreign key in a database?

A

Used to link 2 tables together

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

What are examples of field types?

A
  • Text
  • Number
  • Date
  • Time
  • Boolean
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What field type would you use for a phone number and why?

A

Text because if a number starts with 0 then it would have to be stored as text otherwise the 0 will be lost

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

What is the purpose of a data dictionary?

A

Used to describe the structure of a database

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

What is a range check?

A

Checks that the field is within a certain range
Range Check (>=1 and <= 10)

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

What is restricted choice?

A

A drop down menu so that only certain options can be picked

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

What is a length check?

A

A field has to be a certain number of characters

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

What is a presence check?

A

The field can’t be left blank, it must have a value

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

What does the crows foot represent?

A

The many (crows foot/three lines) will always be at the table with the foreign key

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

What is referential integrity?

A

A foreign key must always have a matching primary key. This is known as referential integrity.

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

What is the structure of a SELECT statement?

A

Returns information from a database
SELECT
FROM
WHERE
ORDER BY

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

What is the structure of a UPDATE statement?

A

Used to alter information in a database
UPDATE
SET
WHERE

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

What is the structure of a INSERT statement?

A

Used to add a new record
INSERT INTO
VALUES

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

What is the structure of a DELETE statement?

A

Deletes a record from a database
DELETE FROM
WHERE

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

What should you do if you only want to update/delete one record?

A

Always use the primary key in the search criteria

17
Q

What is an equi-join?

A

Using the foreign key to join the tables together
Goes in the search criteria
table1.primarykey = table2.foreign key

18
Q

Describe how you would evaluate the accuracy of the expected output from an SQL statement

A

Compare what you expect to get as an output with what you actually get as an output

19
Q

What is a data subject?

A

The people who are having their personal data stored

20
Q

What is a data controller?

A

The person who decides what personal data is stored and how it is used

21
Q

What are your rights for the GDPR?

A
  • Access your information
  • Have your information changed
  • Have your information deleted
22
Q

State the implications of the GDPR

A
  • Data is stored securely
  • Data is accurate
  • Data is not kept for longer than needed
23
Q

What is a functional requirement?

A

What the database should do

24
Q

What is an end user requirement?

A

What the users should be able to do when using the system