1.3.2 Flashcards

(36 cards)

1
Q

Entity

A

A category of object, person, event or thing of interest to an organisation about which data is to be recorded

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

Attribute

A

A named piece of data about a particular entity, with an associated data type. Also known as a field.

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

Flat File database

A

Database consisting of tables which have no links to one another. Each table is entirely standalone.

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

Primary Key

A

An attribute which uniquely identifies each entity in a table.

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

Secondary key

A

An attribute which can uniquely identify an entity but hasn’t been selected as the primary key. E.g. in a customer table, the Customer ID may be the primary key but the email could be considered a secondary key. They often are used to index a table so that searching is quicker.

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

Entity relationships

A

One to one
One to many
Many to many (must be avoided, can use an intermediary table)

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

Entity Relationship Diagram

A

Show the relationships between the different entities. A single line into a box shows ‘one’ and three lines in represents ‘many’.

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

Relational database

A

A database with multiple tables which link together through the use of foreign keys.

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

Foreign key

A

Attribute which creates a join between two tables. It is an attribute that exists as a primary key in the table being linked to.

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

Composite Key

A

Primary key which consists of more than one field.

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

Referential integrity

A

Making sure that the links between tables are always kept valid when records are added, updated or deleted. E.g. A User makes many IT Requests. If a User is deleted, all its IT Requests should also be deleted.

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

Normalisation

A

Process used to come up with the most efficient design for a relational database
- No data is unnecessarily duplicated
- Data is consistent throughout database
- Structure of the table is flexible enough to allow you to enter as many or as few items as required
- The structure should enable a user to make all kinds of complex queries relating data from different tables

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

First normal form

A

Table has a primary key. No duplicate attributes. No repeating groups and no composite attributes.

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

Second normal form

A

Contains no partial key dependencies. A partial key dependency is when an attribute depends on only part of the composite primary key. Must have no Many-to-Many relationships. Must also be in 1NF.

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

Third normal form

A

Contains no non key dependencies. Every attribute must depend on only the primary key and nothing but the primary key. Must also be in 2NF.

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

SQL

A

Structured Query Language, declarative language used to query and update tables in relational databases.

17
Q

SELECT…FROM…WHERE

A

Using the WHERE clause with SELECT…FROM allows you to specify conditions that must be met for data to be selected.
SELECT CityName FROM City
WHERE Country = ‘Scotland’
Would return the CityName field of records from the city table with the value Scotland held in the country field.

18
Q

ORDER BY

A

A SQL clause that is useful for ordering the output of a SELECT query (for example, in ascending or descending order). Multiple fields can be used to order and will be ordered in the order that they are presented.

19
Q

JOIN

A

A method of combining rows from two or more tables based on a common field.

20
Q

Defining a sql table

A

CREATE TABLE _____
(
value datatype
“ “
“ “
)

21
Q

SQL Datatypes

A

CHAR string of fixed length n
VARCHAR string of variable length max n
BOOLEAN
INTEGER
FLOAT
DATE
TIME
CURRENCY

22
Q

ALTER TABLE

A

The SQL command used to make changes to table structure. When the command is followed by a keyword (ADD, DROP or MODIFY), it adds a column, deletes a column or changes column characteristics.

23
Q

Creating links between tables via Foreign Key Constraints

A

When defining a table add - FOREIGN KEY key REFERENCES table(key)

24
Q

Inserting, updating and deleting SQL

A

INSERT - inserts an entity
UPDATE - updates and entity
DELETE - deletes an entity

25
Atomicity
Requires a transaction must be processed in its entirety or not at all. Must ensure that in any situation it is not possible to complete part of a transaction
26
Consistency
Ensures that no transaction can violate any of the defined validation rules for maintaining the integrity of a database. E.g. You shouldn't be able to update an attribute of type INT with a value of type VARCHAR.
27
Isolation
Ensures that concurrent execution of transactions leads to the same results as if transactions were processed one after the other. Each transaction should be independent of all other transactions.
28
Durability
Ensures that once a transaction has been comitted it will remain so even in the event of a power cut or DB Server failure. Each part of a transaction is held in a buffer until all elements of a transaction have been completed. Non-volatile storage must be used.
29
Record locks
Prevents simultaneous access to objects in a database in order to prevent updates being lost or inconsistencies in the data arising. Anyone who tries to access the database while someone else is using it is locked out.
30
Deadlock
When two people are locked out of a database, because each transaction is waiting for a lock held by the other transaction. Serialisation, timestamp ordering or commitment ordering may be used to address this.
31
Serialisation
Creating a copy of a data item which is stored and amended locally before uploading a copy of this clone to the database again.
32
Timestamp ordering
When a transaction starts it is given a timestamp so that the transaction with the earlier timestamp will be given access first. Assumes that timestamps are always unique (e.g. no transactions happening at EXACTLY the same time)
33
Redundancy
The use of backup database copies or duplicated data in different geographical locations in case one copy is compromised. This has an impact on data integrity and so should be minimised.
34
DDL (Data Definition Language)
The subset of SQL commands used to manipulate Database structures, including tables. E.g. CREATE, ALTER, DROP
35
DML (Data Manipulation Language)
The subset of SQL commands used to query, add or modify content of database tables
36