Databases Flashcards

1
Q

What is a database?

A

An organised collection of data

-there are several models of data organisation, the most common being the relational mode

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

What is data consistency

A

where the database never records the same piece of information more than once

If it did, then it would lead to data inconsistency

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

What is bad about data being held in more than one place in a database

A
  • leads to inconsistency

- waste of disk space

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

What is data redundancy

A

where the data doesn’t need to be held more than once and so any copies of the data are redundant

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

How should a database act

A

A database should act as a repository or pool of data, separate from the applications that deal with it.

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

What is data independence

A

the concept of keeping the data separate from the applications that use it

Means that it should be possible to write a new application with forms, reports, etc. That can connect to the data without having to change the way data is stored.

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

What are the properties of a flat file database

A

-very basic system that only allows a single table of data

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

What are the advantages of a flat-file database

A

can be useful if very simple information is being recorded

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

What are the disadvantages of a flat-file database over a relational database

A
  • a relational database allows data to be held in multiple tables which have relationships between them
  • a well-designed (normalised) database will not have any of the problems associated with flat-file databases

-potential inconsistency

-potential redundancy (wasting space as information is stored more than once)

-takes longer to enter information as data has to be entered more than once

Potential loss of data

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

What is an index

A

if a field is going to be regularly used as part of a search, then it can be set to indexed to allow searches to be performed much more quickly

A table can have several indexes if required

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

downside of an index

A

the more memory is required to hold each index and every time a record is added or deleted the index needs to be updated which can add a very slight delay

this is why only field which are regularly used should be indexed

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

What is a primary key

A

a field or fields that uniquely identify a record, e.g. the pin uniquely identifies a student

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

What would you use if no single field uniquely identifies a record

A

a composite primary key

e.g. in the student-subjects table on the previous slide, neither the pin nor subject id alone could be the primary key. Both are needed to identify a record and therefore the primary key would be PIN and Subject ID.

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

What is a foreign key

A

a field in a table that is the primary key in another table and is used to form a link between the two

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

LOOK AT ERD and entity description

A

do lesson 4-6 exam question video on erd for practice

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

What is the identifier known as in a relational database

A

primary key

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

What are the three types of relationship between entities

A

One-to-many

One-to-One

many-to-one

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

What is meant by the term database normalisation

A

A way of structuring data according to theoretical rules

Usually reduces data duplication / redundancy

Avoids danger of inconsistency / maintains integrity

Avoids wasting processing time

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

Describe 1st normal form

A

Makes field independent, avoids duplication of items

No repeating attributes

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

What is 2nd normal form

A

Each field depends on the whole primary key

No partial key dependencies

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

What does data normalisation do to a database

A

Reduces data duplication

If not done :

Danger of inconsistency
Danger of data being lost during update
Storage space wasted

22
Q

What is the third normal form

A

No non key dependencies

Dependent on the key, the whole key and nothing but the key

No transitive dependencies

23
Q

What is big data

A

Relatively modern term

Isn’t structured into a relational database

Used to describe large collections of data, but too large to be processed using standard database techniques

Data sets are growing rapidly because of the data being gathered by the vast number of cheap devices (cameras, sensors, mobile devices etc.)

24
Q

What are distributed databases

A

In which the data is stored across two or more computer systems located at different sites on a computer network

25
What is data warehousing
Where large quantities of data are collected together from a variety of locations for efficient analysis
26
What is the pros and cons of a relational database
Pros Avoids data duplication Avoids inconsistent records Saves storage space Cons Data complexity Maintaining / modifying relational databases can be difficult
27
Advantages of relational database over flat file
Relational databases allows data to be held in multiple tables that can have relationships between them A well designed (normalised) database will not have any of the problems associated with flat-file databases (redundancy, inconsistency etc.) By splitting the tables it is possible to hold exactly the same information without the problems we have previously identified
28
Composite primary key
Used when no single field uniquely identifies a record E.g. Two fields need to be used together to make a composite primary key to identify a record
29
Define entity
A category of object, person, event or thing of interest about which data needs to be recorded Each entity has attributes (fields) Needs an identifier(primary key) which uniquely identifies a record
30
What are the relationships between entitites
One to one One to many Many to many If there is a many to many relationships a new entity must be made and two one to many links are made instead
31
Define validation and the 6 types
Checking how appropriate the data being entered is Range check - used to ensure input data lies between a specific range Presence check - used to prevent further progress if a required field is left blank Format check - used to ensure data matches a specific pattern, e.g. dd/mm/yyyy Data type check - Used to ensure input data is a particular data type Length check - used to ensure an input data string is a sensible length
32
What is restricted validation
Where fields in a database have a definite amount of data that can be entered into them e.g. days of the week limited to Sunday, Monday etc. Programming a database to accept only one of a series of valid choices can prevent errors and lessen the time it takes to input data This has different forms like listbox, combobox, radio button
33
What is verification
Checking that what has been entered is what was intended To make sure there isn't mistakes May make you input the data twice E.g. when creating a password it makes you enter it twice
34
Data dictionary
Data dictionary is a database which holds information about the database E.g. there will be a table that holds information about every table in the database. A table that holds information about every field in the database Other information: - characteristics of each data item such as length and data type - any restrictions on the value of certain columns (validation rules) - the relationships between data items - which programs access which item of data, and whether they read the data or change it.
35
What is SQL used for
To search for data and optionally sort it It can also search and provide a result in the form of a table of results These results can potentially be used is different graphs e.g. graphs, charts, reports, etc. Is a text based query language The query is sent to the databse management system and it produces a result in the form of a temporary table
36
What are the commands used in a query when showing something with specific conditions and can be ordered
SELECT FROM WHERE ORDER BY [fieldname] ASC/DESC
37
What are SQL sub queries
It is possible to have the result of one query be used in the where clause of another (When doing questions recommended to do the sub query first)
38
what is SQL order by
39
What is SQL insert into
Used to add new rows of data to a table E.g. INSERT INTO VALUES( , , )
40
What is SQL update
Used to modify existing data in a table UPDATE SET WHERE
41
What is SQL query delete
DELETE FROM WHERE
42
What is SQL query create table
CREATE TABLE [tablename] ( [fieldname] INT PRIMARY KEY NOT NULL, [Fieldname] CHAR(40) NOT NULL, [Fieldname] DATETIME, [Fieldname] NUMERIC(7,2) for numeric(7,2) 7 digits total, 2 digits to the right of the decimal place
43
What is big data
Used to describe large collections of data (similar to data warehouse) But too large or complex to be processed by standard database techniques Isn't structured into a relational database like a data warehouse would be and can't be queried (e.g. using SQL) In traditional ways in acceptable time frames Data sets growing rapidly due to all the data being gathered by the vast number of cheap devices e.g. cameras, sensors, mobile devices etc. Size of these data sets grow rapidly as the Internet continues to grow
44
Difference between big data and data warehousing
Big data is largely unstructured and not stored in a formal well designed data warehouse
45
What is data warehousing
Data warehousing represents an ideal vision of maintaining a central repository of all the useful data in an organisation Very structured, large scale relational databases that can be queried in traditional ways e.g. SQL Transactions, daily operational data etc. Are fed into the data warehouse These transactions will usually come from multiple very different sources and systems, often on a national or world-wide level The data isn't generally overwritten so that patterns and trends over long periods can be considered. Data mining can be used to search through the data warehouse to look for patterns or trends
46
Define data mining and what It does
The analysis of large amounts of data (in a data warehouse) Analysing from different perspectives and summarising it into useful information for firms used to cut costs + increase revenue E.g. supermarkets look for patterns in buying and track what individuals buy (through loyalty cards) and target them with special offers. Insurance companies can use data mining to spot customers who have regular patterns of claims which may be fraudulent, or identify customers who may be interested in particular insurance policies
47
Define predictive analysis
A combination of statistics and data mining and using statistical techniques and AI to analyse current and historical facts to predict future events. Can forecast (with probabilities) what may happen in the future and therefore make decisions based on those predictions e.g. economic forecasting A probabily score is assigned for the likelihood of a thing e.g. a customer will behave a certain way
48
Database management systems
Programs that provides an interface between the OS and the user in order to make access to the data as simple as possible Other functions: Data storage, retrieval and update Allows access to queries and reports Creation and maintainance of the data dictionary Managing the facilities for sharing the database Backup and recovery - must provide the ability to recover the database in the event of failure Security - The DBMS must handle password allocation and checking, and view the database that a given user is allowed
49
Define distributed databases
Databases where the data is stored across two or more computer systems located at different sites on a computer network It is also likely that the processing (DBMS) is distributed too This is a single database where parts of the database can be held on different servers on the network, perhaps over a wide geographical area Either involves having parts of the databse at different locations or the whole database in different locations
50
Benefits of distributed databases
Having databases spread out can maximise performance and there will be less data required to pass across a network/Internet so data can be recorded/read more quickly
51
Concerns of distributed databases
Need to be powerful systems that can cope with the synchronisation of the data between the branches to ensure data inconsistency doesn't occur and to make sure data is kept upto date where it is a requirement
52
Benefits of cloud services
Organisations will run their database systems on the servers in data centres owned by very large cloud providers e.g. amazon meaning organisations don't need to invest as much money into money/time/staffing in their own data centres Organisations use cloud services to deal with issues e.g. security, upgrades, backups, etc.