1.3.2: Databases Flashcards

1
Q

What is a Relational Database?

A
  • A database that recognises the differences between entities by creating different tables for each identity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an Entity?

A
  • An item of interest about which information is stored
  • (A category of object, person, an event)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Flat File?

A
  • A database consisting of a single file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What will a Flat File be based around?

A
  • Most likely be based around a single entity and its attributes
  • Are typically written out as: Entity1(Attribute1, Attribute2, Attribute3…) E.g. Car(CarID, Age, Price)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Primary Key?

A
  • The unique identifier for each record in the table
  • What is different for each row of the table
  • The Primary Key is always underlined in a table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the Secondary Key allow for?

A
  • The database to be searched quickly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Foreign Key?

A
  • A key existing as the Primary Key in one table but having travelled to another table is no longer the Primary Key
  • Foreign Keys are shown using an asterisk in the table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a One-To-One relationship?

A
  • Each entity can only be linked to one other entity
  • [A single line used to connect two entities]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a One-To-Many relationship?

A
  • One table can be associated with many other tables
  • [A single line on one side, with a branch on the other]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Many-To-Many relationship?

A
  • One entity can be associated with many other entities and vice versa
  • [Branches on both sides]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Normalisation?

A
  • The process of coming up with the best possible layout for a relational database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does Normalisation attempt to accomplish?

A
  • 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
13
Q

What is the criteria for First Normal Form?

A
  • There must be no attribute containing more than a single value
  • Field names unique
  • Field values from same domain
  • Values in fields atomic
  • Records can’t be identical
  • Must have a primary key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the criteria for Second Normal Form?

A
  • A database that doesn’t have any partial dependencies and is in First Normal Form (No attributes can depend on part of a composite key)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the criteria for Third Normal Form?

A
  • The database is in Second Normal Form and contains no non-key dependencies (The attribute only depends on the value of the Primary Key and nothing else)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Indexing?

A
  • A method used to store the position of each record ordered by a certain attribute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is Indexing used for?

A
  • Looking up and accessing data quickly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Why is the Primary Key almost never queried?

A
  • The Primary Key is automatically indexed
  • It is not usually remembered therefore almost never queried
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Why are Secondary Keys used for Indexing?

A
  • To make the table easier and faster to search through
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How is data Captured?

A
  • Data needs to be input into the database, the chosen method is always dependent on the context
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is Magnetic Ink Character Recognition used for?

A
  • To scan bank cheques: All the details excluding the amount are printed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is Optical Mark Recognition used for?

A
  • Multiple choice questions on a test
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is Optical Character Recognition used for?

A
  • Other data capturing forms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is Selecting data?

A
  • An important part of data preprocessing
  • Could involve only selecting data that fits a certain criteria to reduce the volume on input
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How can collected data be Managed?
- Using SQL to sort, restructure, and select certain sections
26
What is Exchanging data?
- The process of transferring the collected data, commonly through Electronic Data Interchange
27
What are the advantages of Electronic Data Interchange?
- Doesn't require human interaction and enables data transfer from one computer to another
28
What is Structured Query Language?
- A Declarative Language (From the Declarative Programming Paradigm) used to manipulate databases
29
What does Structured Query Language enable?
- The creating, removing, and updating of databases
30
What does SELECT mean SQL?
- To collect fields from a given table
31
What does FROM mean SQL?
- To specify from which table(s) the information will come from
32
What does WHERE mean SQL?
- To specify search criteria
33
What does ORDER BY mean SQL?
- Specifies whether the values should in ascending or descending order - Values are automatically placed in ascending order: adding 'Desc' will cause the values to be displayed in descending order
34
What does JOIN mean SQL?
- Provides a method of combining rows from multiple tables based on a common field between them
35
What does CREATE mean SQL?
- Allows for the creation of new databases
36
What is the data type CHAR(n)?
- Character string of fixed length - E.g. ProductCode CHAR(6)
36
What about each attribute needs to be specified?
- Whether it is a Primary Key - The data type of the attribute - Whether it must be filled in ('NOT NULL')
37
What is the data type VARCHAR(n)?
- Character string variable length, max. n - E.g. Surname VARCHAR(25)
38
What is the data type BOOLEAN?
- TRUE or FALSe - E.g. ReviewComplete BOOLEAN
39
What is the data type INTEGER, INT?
- Integer - E.g. Quantity INTEGER
40
What is the data type FLOAT?
- Number with a floating decimal point - E.g. Length FLOAT (10,2) - [Maximum number of digits is 10 and maximum number after decimal point is 2]
41
What is the data type DATE?
- Stores Day/Month/Year values - E.g. HireDate DATE
42
What is the data type TIME?
- Stores Hour/Minute/Second values - E.g. RaceTime TIME
43
What is the data type CURRENCY?
- Formats numbers in the currency used in the region - E.g. EntryFee #23.50
44
What does ALTER mean SQL?
- Add, delete, or modify columns in a table
45
How do you add a column (field) in SQL?
ALTER TABLE Employee ADD Department VARCHAR(10)
46
How do you delete a column in SQL?
ALTER TABLE Employee DROP COLUMN HireDate
47
How do you change the data type of a column in SQL?
ALTER TABLE Employee MODIFY COLUMN EmpName VARCHAR(30) NOT NULL
48
When do you use INSERT INTO in SQL?
- To inert a new record into a database table
49
How do you use INSERT INTO in SQL?
INSERT INTO (column1, column2) VALUES (value1, value2)
50
When do you use UPDATE in SQL?
- To update a record in a database table
51
How do you use UPDATE in SQL?
UPDATE TableName SET column1 = value1, column2 = value2 WHERE columnX = value
52
When do you use DELETE in SQL?
- To delete a record from a database table
53
How do you use DELETE in SQL?
DELETE FROM TableName WHERE columnX = value
54
What is a Transaction?
- A single operation executed on data - Sometimes a collection of operations can be considered a transaction
54
What is Referential Integrity?
- The process of ensuring consistency (Ensuring that information is not removed if it is required elsewhere in a linked database)
55
What does the 'A' in 'ACID' stand for?
- Atomicity
56
What does 'Atomicity' in 'ACID' mean?
- Requires that the transaction must be processed in its entirety or not at all
57
What must 'Atomicity' in 'ACID' guarantee?
- That in any situation, including power cuts or hard disk crashes, it is not possible to process only part of the transactions
58
What does the 'C' in 'ACID' stand for?
- Consistency
59
What does 'Consistency' in 'ACID' mean?
- Ensuring that no transaction can violate any of the defined validation rules for maintaining the integrity of the database - When a database is created, Referential Integrity rules will be specified between tables - It would not be possible to record a mark in a RESULTS table for a student who is not in the STUDENT table in the database
60
What does the 'I' in 'ACID' stand for?
- Isolation
61
What does 'Isolation' in 'ACID' mean?
- Ensuring that simultaneous execution of transaction leads to the same results as if transactions were processed one after the other
62
What does the 'D' in 'ACID' stand for?
- Durability
63
What does 'Durability' in 'ACID' mean?
- Ensuring that once a transaction has been executed, it will remain so, even in the event of a power cut
64
What is Record Locking?
- The process of preventing simultaneous access to records in a database
65
What is Record Locking used for?
- Preventing inconsistencies or loss of updates
66
How does Record Locking work?
- While one person is editing a record, the record is 'locked', preventing others from accessing the same record
67
What is 'Deadlock'?
- When different users on a database lock out records by accessing them causing no progress to be made when the different users want to access files previously accessed by other users
68
What is Redundancy?
- The process of having one or more copies of the data in physically different locations to ensure that should any damage occur to a copy the other copies remain unaffected