Databases Flashcards

1
Q

State what is meant by the end user requirements of a database?

A

The end user requirements are the tasks that the database must be able to perform

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

State what is meant by the functional requirements of a database?

A

The functional requirements of a database relates to the tasks that the database will be able to perform. The functional requirements take into account the inputs processes and outputs that a database is required to perform in order to function correctly.

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

State what is meant by a data dictionary and why one might be used?

A

Data dictionaries are created to define the structure of a database, they are created during the design phase and act as an efficient reference point during the implementation stages.

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

State the purpose of relational databases?

A

Relational databases allow information to be stored across multiple tables.

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

Describe issues that using a relational database can mitigate?

A

Using relational databases that use primary and foreign keys helps us to avoid issues such as insertion, deletion, or update anomalies in a database

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

State the types of relationships that can exist in a database?

A
  • One to One relationship
  • One to Many relationship
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain what is meant by a One to Many cardinality in relationships involving entities?

A

One to Many relationships occur when one entity is able to be present across many other related entities.

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

State the role of an entity occurrence diagram?

A

Entity occurrence diagrams show the relationship between the occurrences of a particular entity

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

State what is meant by an entity occurrence?

A

An entity occurrence is an example of a particular entity. E.g Maths, Computing, and Physics are all entity occurrences of the subjects entity

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

State what is meant by a primary key?

A

A primary key can be defined as a piece of information that uniquely identifies each record in a table or in a relational database

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

State the purpose of a foreign key?

A

A foreign key is a key that links two tables together and creates the relationship between the two tables.

Care must be taken when making changes to the foreign key as foreign keys being deleted can destroy the relationship between two entities in a relational database

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

Explain what is meant by a surrogate key?

A

A surrogate key is a type of key that is used when an entity does not have a naturally occuring primary key, in this case it is possible to create a new field that acts as a unique identifier for each record in the table

Typically an autonumber field will be used as a surrogate key

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

Explain what is meant by a composite key?

A

A composite key is a specific type of primary key that uses information from two fields in a table to create a new field that acts as a primary key.

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

Explain what is meant by a compound key?

A

A compound key is a type of primary key that is created from two or more primary keys of other tables

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

State the different aggregate functions that you are expected to know for higher?

A
  • SUM()
  • AVG()
  • MAX()
  • MIN()
  • COUNT()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain where you would use the SUM aggregate function?

A

The sum aggregate function could be used to return the total sum of a numeric column or expression

17
Q

Explain where you would use the COUNT aggregate function?

A

The count aggregate function could be used to total the number of values stored in a given column

18
Q

Explain where you could use the AVG aggregate function?

A

The average aggregate function could be used to calculate the mean average value for a given numerical column or expression.

19
Q

Explain where you could use the MAX aggregate function?

A

The max aggregate function would display the largest numerical value found in a given column or expression

20
Q

Explain where you could use the MIN aggregate function?

A

The min aggregate function can be used to find the smallest numerical value in a given column or expression

21
Q

Describe some of the things that you should know about using aggregate functions?

A
  • Aggregate functions can only be used in the SELECT clause of SQL
  • You are able to use more than one aggregate function in the same select statement
  • When you wish to include the field you are running an aggregate function on in the where clause you must include the complete aggregate function unless you are using multiple queries.
22
Q

State what aliases are used for?

A

Aliases can be used to temporarily change the name of something this can be useful if

  • A field name is too long
  • A field name would not make any sense to a user of the database
23
Q

Describe how to use an alias?

A

An alias uses the function word AS e.g

SELECT forname AS [‘FIRST NAME’]

24
Q

Explain how a GROUP BY statement is used in SQL?

A

A GROUP BY statement that we can use to group a set of records in our query together based on some set of criteria that depends on the question being asked

25
Q

State which order each SQL statement should be placed in to run a query?

A

SELECT
FROM
WHERE
GROUP BY
ORDER BY

26
Q

State what is meant by a wildcard?

A

A wildcard is a character that can be used to substitute for another character or indeed another set of characters

27
Q

What operator must we use when we are using a wildcard in SQL?

A

We have to use a LIKE operator for example

WHERE forname LIKE ‘L*’

28
Q

State what a * reperesents in SQL?

A

A * denotes a missing set of characters

29
Q

State what a ? represents in SQL?

A

A ‘?’ denotes a missing character in SQL

30
Q

Describe when a database can be described as fit for purpose?

A

A database is fit for purpose when it meets all of the requirements set out for it in the analysis stage meaning that it meets all of its functional requirements and its end user requirements