Databases Flashcards

1.3.1

1
Q

What is an entity?

A

An item of interest about which information is stored

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

What is a relational database?

A

Database which recoginses the differences between entities by creating different tables for each entity

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

What are attributes?

A

The characteristics of an entity
These are categories about which data is collected

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

What is a flat file database?

A

Database that consists of a single file and based around a single entity and its attributes

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

How are flat files written out typically?

A

Entity1(Attribute1,Attribute2,Attribute3…)

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

What is a primary key?

A

A unique identifier for each record in the table

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

How is the primary key shown?

A

By underlining it

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

What is a foreign key?

A

An attribute that links two tables together
Acts as the primary key in one table and the foreign key in another

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

How is the foreign key shown?

A

With an asterisk (*)

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

What is a secondary key used for?

A

Allowing a database to be searched quickly

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

What is a one to one relationship?

A

Each entity can be linked to one other entity

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

What is a one to many relationship?

A

One table can be associated with many other tables

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

What is a many to many relationship?

A

One entity can be associated with many other entities and the other way round

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

How can banks capture data when they scan cheques?

A

Using Magnetic Ink Character Recognition (MICR)
All details excluding the amount written are printed in a special magnetic ink which can be recognised by a computer but amount must be entered manually

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

What method of capturing data is used in multiple choice question tests?

A

Optical Mark Recognition(OMR) or Optical Character Recognition(OCR)

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

What is data preprocessing?

A

Only selecting data that fits a certain criteria to reduce volume of input

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

What is exchanging data?

A

Process of transferring the collected data

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

What is a common way exchanging data is done?

A

Electronic Data Interchange(EDI) and it does’nt require human input and enables data transfer from one computer to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
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
20
Q

What is a composite key?

A

A primary key that consists of more than one attribute

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

What is referential integrity?

A

When tables are linked it ensures that a particular component isn’t deleted if it is used in a product in product table

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

What is normalisation?

A

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
23
Q

What does normalisation have to try accomplish?

A

No redundancy(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
24
Q

What is first normal form?

A

A table that has no repeating attributes or groups of attributes

25
What is second normal form?
Database which doesn't have any partial dependencies and is in first normal form Meaning no attributes an depend on part of a composite key
26
What is third normal form?
If the database is in second normal form and contains no non-key dependencies
27
What does non key dependency mean?
Means the attribute only depends on the value of the primary key nothing else
28
What is indexing?
Stores positions of each record in order by a certain attribute To look up and access data quickly
29
How does indexing work?
Primary key is automatically indexed however is almost never queried because its not remembered So we index secondary keys to make table easier and faster to search through on particular attributes
30
What is SQL?
Structured Query Language and is a declarative language used to manipulate databases
31
What is a SELECT sql statement used for?
SELECT statement is used to collect fields from a given table
32
What is FROM sql statement used for?
FROM statement is used to specify which table the information will come from
33
What is the WHERE sql statement for?
Used in conjunction with SELECT and FROM to specify the search criteria
34
How is an SQL statement written?
SELECT (Attribute1, Attribute2) FROM (Entity) WHERE (Attribute=search criteria)
35
What is the ORDER BY sql statement for?
ORDER BY specifies whether you want it in ascending or descending order Values are automatically put in ascending order so write 'Desc' for descending
36
What is the JOIN sql statement for?
JOIN provides a method of **combining rows from multiple tables based on a common field** between them
37
What does the CREATE sql statement do?
CREATE function allows you to create a new database
38
How do you use the CREATE function in sql?
CREATE TABLE (Tablename) ( Attribute1 INTEGER NOT NULL,PRIMARY KEY, Attribute2 VARCHAR(20) NOT NULL, ... )
39
How do you use the JOIN function in sql?
JOIN (Tablename2) ON (Tablename1.Attribute1) = (Tablename2.Attribute1)
40
What are the 8 sql datatypes?
CHAR(n):String of fixed length n VARCHAR(n):String of variable length with max n BOOLEAN:True or false INT:Integer FLOAT:Number with decimal DATE:Date in format date/month/year TIME:Time in format Hour/minute/second CURRENCY:Sets number as monetary amount
41
What is ALTER sql statement used for?
ALTER is used to add delete or modify columns in a table
42
How do you use ALTER statement in sql to add a column?
ALTER TABLE(Tablename) ADD(AttributesX datatypes)
43
How do you use ALTER statement in sql to delete a column?
ALTER TABLE (Tablename) DROP COLUMN (Column)
44
How do you use ALTER statement in sql to modify data of a column?
ALTER TABLE (Tablename) MODIFY COLUMN (Column NewDataType)
45
What does the INSERT INTO sql statement do?
INSERT INTO is used to insert a new record into a database table
46
How do you use the INSERT INTO statement in sql?
INSERT INTO (Column1, Column2,...) VALUES(value1,value2,...)
47
What does the UPDATE sql statement do?
UPDATE is used to update a record in a database table
48
What does the DELETE sql statement do?
DELETE is used to delete a record from a database table
49
What is a transaction?
A single operation execution operated on data or a collection of operations
50
What is Atomicity?
A transaction must be processed entirely or not at all
51
What is Consistency?
A transaction must maintain the referential integrity rules between linked tables
52
What is Isolation?
Simultaneous executions of transactions should lead to the same result as if they were executed one after another
53
What is Durability?
Once a transaction has been executed it will remain so regardless of the circumstances surrounding it, such as a power cut
54
What is record locking?
The process of preventing simultaneous access to record in a database
55
Why do we use record locking?
To prevent inconsistencies or a loss of updates Improves database performance by disabling multiple user to access data simultaneously
56
How does record locking work?
While one person is editing a record, this locks the record so prevents others from accessing the same record
57
What is a problem with record locking?
Deadlock- A situation in which two or more transactions are waiting for one another to give up locks
58
What is redundancy?
The process of having one or more copies of data in physically different locations
59
Why is redundancy important?
If there is any damage to one copy the others will remain unaffected and can be recovered