1.3.2 Databases Flashcards

1
Q

What is a relational database?

A

A database where separate tables are made for each entity and relationships between entities are represented by foreign keys

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

What is an attribute?

A

A characteric of an entity, it is also the column of a database

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

What is a flat-file database?

A

A data base where a single table data structure is used to store all the data

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

What is a primary key?

A

A primary key is a unique identifier for each record in the table.

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

What is a record?

A

A record is a row in a data base, typically about one entity

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

How do we show which attribute is the primary key?

A

By underlining it

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

What is a foreign key?

A

A foreign key is the attribute which links two tables together.
The foreign key will exist in one table as the primary key and act as the foreign key in another.

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

How do we show which attribute is the foreign key?

A

By using an asterick

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

What is a secondary key?

A

A key that can be used as an alternative index to access or sort records in the table in a quicker, but less accurate way than the primary key

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

What is entity-relationship modelling?

A

A mthod of abstractly describing the data tables and the relationships between them visually.
They can be used to reduce redundacy and construct a relational database

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

What is a one-to-one entity relationship?

A

Each entity can only be linked to one other entity, such as the relationship between a husband and wife.
The husband entity can only be associated with one wife entity and vice versa.

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

What is a one-to-many entity relationship?

A

One table can be associated with many other tables, such as a mother having multiple children.
Similarly, multiple child entities can be linked to the same mother entity.

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

What is a many-to-many entity relationship?

A

One entity can be associated with many other entities and the same applies the other way round.
An example is students and courses - each student can enrol in more than one course and each course can have more than one student

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

What is normalisation? (databases)

A

Normalisation tries to accomplish the following things:
● No redundancy (unnecessary duplicates).
● Consistent data throughout linked tables.
● Records can be added and removed without issues.
● Complex queries can be carried out.

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

What is indexing?

A

The process of creating an index of primary keys such that the location of any record can be retrieved given its primary key

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

What is referential integrity?

A

The idea of keeping a database consistent by ensuring that any changes made to data or relationsips associated with a table are accounted for in all the linked tables

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

What are 3 benefits of electronic databases?

A

Easier to retrieve, add, delete, update and modify data
Easier to back up and make copies of data
Can be accessed by, multiple people at the same time

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

How can tou capture data?

A

Paper base forms
OCR
OMR

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

Explain capturing data using paper based forms?

A

Data input via this method is manual. It involves a human reading the form and typing the infomation into a computer based system.

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

How can you try avoid errors when using paper based forms to capture data? (5 points)

A

Every part of the form is clearly labelled
Instructions to complete the form in black pen
Instructions to complete the form in capitial letters
Use of tick boxes
Squares for entering each letter separately

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

Explain capturing data using OCR?

A

To help speed up and automate data input, you can use optical character recognition.
This automatically reads text by interpreting the shape of the letters, its works better with printed text than handwriting.

22
Q

What does OCR stand for?

A

Optical character recognition

23
Q

What are 2 examples of OCR being used?

A

The post offcie uses OCR software to read postcodes and route mail
Road cameras use automatic number plate recognition software to handle congestion charging and identify drivers who are speeding

24
Q

What does OMR stand for?

A

Optical mark recognition

25
Q

Explain capturing data using OMR?

A

This is often used for multiple choice tests and lottery tickets.
It is very fast and efficent way of collecting data and inputing it in a databse while signifcantly reducing the possibility of human error

26
Q

What are some examples of OMR?

A

Magnetic stripes
Chips and pin
Barcodes
QR codes
Sensors

27
Q

What is SQL?

A

A common query langague for all databases is the structured query language (SQL). It allows for retrieval of data using commands like SELECT, FROM and WHERE.

28
Q

What is QBE?

A

Developed alongside sql, QBE was the first graphical query language making use of visual tables where the user would enter commands and conditions.
Once a query is built using QBE, it is converted into statements that can be excuted agaisnt the database.

29
Q

What is a pro of using QBE over SQl?

A

By ultising QBE, the user doesnt need to remember the finer details of SQL syntax

29
Q

What are the similarities between SQL and QBE?

A

Specify tables
Specify fields
Specify critirea
Specify output sorting
Use boolean expressions

30
Q

What is DBMS?

A

Database management system

31
Q

What does DBMS provide?

A

It hides the underlying structure of the data and ensures it remains integral by:
Preventing the creation of duplicate primary keys
Enforcing validation keys
Providing secure access
Providing encryption
Providing program data independence
Managing multiple users

32
Q

Describe CSV ( comma seperated values)

A

Each record is stored on a seperate line in the filem and each field is seperated by a comma
As the structure is fixed and known, import routines can be written to extract the data from a CSV file
Many systems allow data to be output in CSV format

33
Q

What are similairities between JSON and XML?

A

Both are human-readable, open formats for structuring data
Both common standards for storing and transporting data

34
Q

What are some manual ways to exchnage data?

A

Memory stick
Optical media
Email
Removable hard disk
Paper based

35
Q

What are the 12 SQL commands?

A

SELECT
FROM
AND OR
WHERE
LIKE
JOIN ON
DELETE
INSERT
DROP
ORDER BY
UPDATE
CREATE

36
Q

Explain the select command

A

SELECT (attributes you want)
Seperate attributes by commas
* means all attributes

37
Q

Explain the from command

A

FROM (table name)

38
Q

Explain the where command

A

WHERE (condition)

39
Q

Explain the like command

A

LIKE
LIKE ‘J%a’ means words starting with J and ending with a

40
Q

Explain the and / or commands

A

AND ( add to your condition)
OR ( add to your condition)

41
Q

Explain the delete command

A

DELETE FROM <table name>
WHERE <field> = <condition></condition></field>

42
Q

Explain the insert command

A

INSERT INTO <table name> (<field1>,<field2>,<.....>)
VALUES (<value1>,<value2>,<......>)</value2></value1></field2></field1>

43
Q

Explain the drop command

A

DROP TABLE <table name>
Used to delete an existing table in a database

44
Q

Explain the join command

A

JOIN <table name>
ON <table name>, <field> = <table name>, <field>
Can be used to combine data from two or more tables by specifying common field between them</field></field>

45
Q

Explain the order by command

A

ORDER BY ( ASC or DSC)
Default is ascending

46
Q

Explain the update command

A

UPDATE <table name>
SET <field> = <value>, <.....>, <.....>,
WHERE <field> = <condition></condition></field></value></field>

47
Q

Explain the create command?

A

CREATE TABLE <table name>
(
<attribute 1> <data> <primary>,
<attritube 2> <data> ,
...
)</data></primary></data>

48
Q

What details must be specified abput each attribute when creating a table?

A

Whether it is the primary key
Its data type
Whether it must be filled in (‘Not Null’)

49
Q

What are the possible data types of a database?

A

CHAR(n): this is a string of fixed length n VARCHAR(n): this is a string of variable length with upper limit n
BOOLEAN: TRUE or FALSE values INTEGER/INT: integer
FLOAT: number with a floating decimal point DATE: the date in the format Day/Month/Year TIME: the time in the format Hour/Minute/Second
CURRENCY: sets the number as a monetary amount