1.3.2: Databases Flashcards

You may prefer our related Brainscape-certified 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
Q

How can collected data be Managed?

A
  • Using SQL to sort, restructure, and select certain sections
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is Exchanging data?

A
  • The process of transferring the collected data, commonly through Electronic Data Interchange
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are the advantages of Electronic Data Interchange?

A
  • Doesn’t require human interaction and enables data transfer from one computer to another
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is Structured Query Language?

A
  • A Declarative Language (From the Declarative Programming Paradigm) used to manipulate databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What does Structured Query Language enable?

A
  • The creating, removing, and updating of databases
30
Q

What does SELECT mean SQL?

A
  • To collect fields from a given table
31
Q

What does FROM mean SQL?

A
  • To specify from which table(s) the information will come from
32
Q

What does WHERE mean SQL?

A
  • To specify search criteria
33
Q

What does ORDER BY mean SQL?

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

What does JOIN mean SQL?

A
  • Provides a method of combining rows from multiple tables based on a common field between them
35
Q

What does CREATE mean SQL?

A
  • Allows for the creation of new databases
36
Q

What is the data type CHAR(n)?

A
  • Character string of fixed length
  • E.g. ProductCode CHAR(6)
36
Q

What about each attribute needs to be specified?

A
  • Whether it is a Primary Key
  • The data type of the attribute
  • Whether it must be filled in (‘NOT NULL’)
37
Q

What is the data type VARCHAR(n)?

A
  • Character string variable length, max. n
  • E.g. Surname VARCHAR(25)
38
Q

What is the data type BOOLEAN?

A
  • TRUE or FALSe
  • E.g. ReviewComplete BOOLEAN
39
Q

What is the data type INTEGER, INT?

A
  • Integer
  • E.g. Quantity INTEGER
40
Q

What is the data type FLOAT?

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

What is the data type DATE?

A
  • Stores Day/Month/Year values
  • E.g. HireDate DATE
42
Q

What is the data type TIME?

A
  • Stores Hour/Minute/Second values
  • E.g. RaceTime TIME
43
Q

What is the data type CURRENCY?

A
  • Formats numbers in the currency used in the region
  • E.g. EntryFee #23.50
44
Q

What does ALTER mean SQL?

A
  • Add, delete, or modify columns in a table
45
Q

How do you add a column (field) in SQL?

A

ALTER TABLE Employee
ADD Department VARCHAR(10)

46
Q

How do you delete a column in SQL?

A

ALTER TABLE Employee
DROP COLUMN HireDate

47
Q

How do you change the data type of a column in SQL?

A

ALTER TABLE Employee
MODIFY COLUMN EmpName VARCHAR(30) NOT NULL

48
Q

When do you use INSERT INTO in SQL?

A
  • To inert a new record into a database table
49
Q

How do you use INSERT INTO in SQL?

A

INSERT INTO (column1, column2)
VALUES (value1, value2)

50
Q

When do you use UPDATE in SQL?

A
  • To update a record in a database table
51
Q

How do you use UPDATE in SQL?

A

UPDATE TableName
SET column1 = value1, column2 = value2
WHERE columnX = value

52
Q

When do you use DELETE in SQL?

A
  • To delete a record from a database table
53
Q

How do you use DELETE in SQL?

A

DELETE FROM TableName
WHERE columnX = value

54
Q

What is a Transaction?

A
  • A single operation executed on data
  • Sometimes a collection of operations can be considered a transaction
54
Q

What is Referential Integrity?

A
  • The process of ensuring consistency (Ensuring that information is not removed if it is required elsewhere in a linked database)
55
Q

What does the ‘A’ in ‘ACID’ stand for?

A
  • Atomicity
56
Q

What does ‘Atomicity’ in ‘ACID’ mean?

A
  • Requires that the transaction must be processed in its entirety or not at all
57
Q

What must ‘Atomicity’ in ‘ACID’ guarantee?

A
  • That in any situation, including power cuts or hard disk crashes, it is not possible to process only part of the transactions
58
Q

What does the ‘C’ in ‘ACID’ stand for?

A
  • Consistency
59
Q

What does ‘Consistency’ in ‘ACID’ mean?

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

What does the ‘I’ in ‘ACID’ stand for?

A
  • Isolation
61
Q

What does ‘Isolation’ in ‘ACID’ mean?

A
  • Ensuring that simultaneous execution of transaction leads to the same results as if transactions were processed one after the other
62
Q

What does the ‘D’ in ‘ACID’ stand for?

A
  • Durability
63
Q

What does ‘Durability’ in ‘ACID’ mean?

A
  • Ensuring that once a transaction has been executed, it will remain so, even in the event of a power cut
64
Q

What is Record Locking?

A
  • The process of preventing simultaneous access to records in a database
65
Q

What is Record Locking used for?

A
  • Preventing inconsistencies or loss of updates
66
Q

How does Record Locking work?

A
  • While one person is editing a record, the record is ‘locked’, preventing others from accessing the same record
67
Q

What is ‘Deadlock’?

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

What is Redundancy?

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