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
Explain capturing data using OMR?
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
What are some examples of OMR?
Magnetic stripes Chips and pin Barcodes QR codes Sensors
27
What is SQL?
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
What is QBE?
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
What is a pro of using QBE over SQl?
By ultising QBE, the user doesnt need to remember the finer details of SQL syntax
29
What are the similarities between SQL and QBE?
Specify tables Specify fields Specify critirea Specify output sorting Use boolean expressions
30
What is DBMS?
Database management system
31
What does DBMS provide?
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
Describe CSV ( comma seperated values)
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
What are similairities between JSON and XML?
Both are human-readable, open formats for structuring data Both common standards for storing and transporting data
34
What are some manual ways to exchnage data?
Memory stick Optical media Email Removable hard disk Paper based
35
What are the 12 SQL commands?
SELECT FROM AND OR WHERE LIKE JOIN ON DELETE INSERT DROP ORDER BY UPDATE CREATE
36
Explain the select command
SELECT (attributes you want) Seperate attributes by commas * means all attributes
37
Explain the from command
FROM (table name)
38
Explain the where command
WHERE (condition)
39
Explain the like command
LIKE LIKE ‘J%a’ means words starting with J and ending with a
40
Explain the and / or commands
AND ( add to your condition) OR ( add to your condition)
41
Explain the delete command
DELETE FROM WHERE =
42
Explain the insert command
INSERT INTO
(,,<.....>) VALUES (,,<......>)
43
Explain the drop command
DROP TABLE
Used to delete an existing table in a database
44
Explain the join command
JOIN
ON
, =
, Can be used to combine data from two or more tables by specifying common field between them
45
Explain the order by command
ORDER BY ( ASC or DSC) Default is ascending
46
Explain the update command
UPDATE
SET = , <.....>, <.....>, WHERE =
47
Explain the create command?
CREATE TABLE
( , , ... )
48
What details must be specified abput each attribute when creating a table?
Whether it is the primary key Its data type Whether it must be filled in (‘Not Null’)
49
What are the possible data types of a database?
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