1.3.2 Databases Flashcards

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

Whats a database?

A

An organised collection of related data

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

What’s a flat file database?

A

A database in 0NF, where all data is stored in a single table, about a single entity. It’s useful for static (non-changing) data

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

What’s an entity

A

A category about which data needs to be recorded e.g. a person, or thing. (A table in the conceptional phase)

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

What’s a table

A

A Two-dimensional representation of data that is stored in rows and columns

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

What’s a field

A

A single piece of data about an entity

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

What’s a record?

A

A group of fields about a specific entity (AKA a row)

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

What’s a relational database?

A

Where data is held in multiple tables that are linked via relationships.

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

What’s a primary key?

A

A field used to uniquely identify each record in the table

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

What’s a feature of a primary key field?

A

It’s automatically indexed

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

What’s a composite primary key

A

When multiple fields are used to uniquely identify each record in the table

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

What are the three types of relationships between entities?

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
12
Q

What’s a foreign key?

A

A field that creates a relationship between two tables, appearing as the primary key in another table.

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

What are the benefits of foreign keys?

A

They maintain the relationship between tables

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

Why do we use junction tables?

A

To eliminate many-to-many relationships

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

What are junction tables?

A

A junction table contains the primary key columns of the two or more tables you want to relate.

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

What is data integrity

A

Maintaining and ensuring the reliability of data

17
Q

What needs to be considered when reinforcing data integrity in a database

A

Accuracy, completeness, consistency over lifecycle

18
Q

What is Entity integrity

A

Stipulating that every table must have a primary key

19
Q

What is domain integrity

A

Ensuring every attribute in a relational database is associated with a domain

20
Q

What’s a domain

A

The set of allowed values that an attribute can contain, e.g. numerical

21
Q

What is referential integrity

A

It’s a data quality concept that prevents data redundancy and inaccuracies

It a rule that foreign keys in one table can only refer to primary keys in
another table.

22
Q

What’s data validation?

A

Ensuring that data entered into a program is as accurate as possible

23
Q

What’s data verification?

A

A method of recognizing and preventing human errors, by ensuring info is entered correctly

24
Q

What are the two types of data verification?

A

Visual check and Double entry

25
Q

What’s Visual Check data verification?

A

When a person checks that the data being entered from one document to another is the same

26
Q

What’s Double Entry data verification?

A

Requires same info to be input twice into 2 separate fields

The two values are then compared to check they’re the same

27
Q

What’s data accuracy?

A

A term used to describe the validity of the process used to ensure the data stored is trustworthy and the validity of the data itself.

28
Q

What’s normalization?

A

The concept of splitting tables in a database and arranging the data to move it from 1NF - 3NF

29
Q

At what point is a database considered normalized

A

When it meets third normal form

30
Q

What’s 0NF

A

A flat file prior to normalization

31
Q

Define 1NF

A

When…

Each record has a primary key

Data is of a single value type (atomic)

There are no repeating groups of attributes

Values in fields are from the same domain

32
Q

Define 2NF

A

No partial dependencies- each field depends on primary key

Data in 1NF already

33
Q

Define 3NF

A

Data already in 2NF

No non-key (transitive) dependencies

All fields depend on the key, the whole key and nothing but the key

34
Q

What are the steps in eliminating many-to-many relationships?

A

Create a junction table

Assign primary keys to initial tables

Create a composite key for junction table (and provide foreign keys)

Initial tables will both have one to many relationships with junction table

35
Q

What does SQL stand for?

A

Structured Query Language

36
Q

What are the different SQL commands and their uses?

A

SELECT- List of fields to be displayed

FROM- List the table(s) data will come from

WHERE- List of the search criteria (operators used here)

ORDER BY- List the fields that data is to be sorted in (e.g. price ASC)

  • / (Wild Card) = ‘All’

LIKE- Used to search for a pattern

BETWEEN- Used to search in an inclusive range

IN- Used to search in a specific column/ field

37
Q

Why is a join clause used in SQL?

A

To combine data from two or more tables into one data set, by identifying the primary-to-foreign key relationship.

38
Q
A