1.3.2 Databases Flashcards

(27 cards)

1
Q

What is an entity

A

An item of interest in which data is stored

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

Flat File

A

() Single file about single entity and its attributes

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

Primary key

A

() A unique identifier
() Field that does not repeat

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

Foreign key

A

Attribute that links two tables

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

Secondary Key

A

() Enables data base to search quickly through indexing

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

What does normalisation aim to do

A

() No redundancy
() Consistent data through linked tables
() Records changed without issue (add and delete)
() Complex queries can be done

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

1NF:

A

Contains atomic values (no more than a single value)
Unique column names
Primary key present

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

2NF:

A

No partial dependancies (Compostite key)
in 1NF

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

3NF:

A

() In 2NF
() No non-key dependencies

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

Indexing

A

() Method use to store the position of each record when ordered by a certain attribute
() Used to look up data quickly
() Primary key is automaticlly indexed

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

Capturing data methods:

A

Forms
OMR
OCR
Sensors
Barcodes
Data Mining

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

All sensors

A

OCR
OMR
Temperature
Pressure
Proximity
Light
Motion
Humidity
Gas
Force
Acoustic
Magnetic

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

Exchanging Data:

A

CSV: Plain text, commas to seperate
EDI: Doesn’t require human interaction
Memory sticks
Email

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

Selecting and managing data:

A

SQL

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

Select data SQL

A

SELECT Attributes
FROM Tablename
WHERE Attribute BETWEEN/LIKE Something
ORDERBY Attribute

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

Combine rows from databases based on common field

A

SELECT Attributes
FROM Tablename
JOIN Othertablename
ON Tablename.attribute = Othertablename.attribute

17
Q

SQL Create

A

CREATE TABLE Tablename
(
Attribute 1 INTEGER NOT NULL, PRIMARY KEY,
Attribute 2 VARCHAR(20) NOT NULL
)

Is it primary key
Its data type
Does it need to be filled in?

18
Q

ALTER

A

Adding column:
ALTER TABLE Tablename
ADD Attribute and their data types

Deleting a column:
ALTER TABLE Tablename
DROP COLUMN Attribute

Modify column:
ALTER TABLE Tablename
MODFIY COLUMN Attribute Newdatatype

19
Q

Data types:

A

CHAR(n): Fixed length
VARCHAR(n): Upper limit
DATE
TIME
CURRENCY

20
Q

Insert record

A

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

21
Q

DELETE

A

DELETE FROM Tablename
WHERE Attribute = value

22
Q

Nested Select Example

A

SELECT*
FROM Employees
WHERE Salary > (SELECT AVG(salary) FROM Employees)

23
Q

Referential integrity

A

() Process of ensuring consistency
() Makes sure information isnt removed if it is needed elsewhere in a linked database

24
Q

Transaction

A

A single operation executed on data
Must be in line with ACID

25
ACID:
Atomicity: () No partial transactions (Must be completely processed or not at all) Consistency: () Keep database rules before and after transaction Isolation: () Simultaneous actions lead to result as if one was after another Durability: Once a transaction has been executed it will remain so even in case of system failiures
26
Record Locking:
() Preventing simultaneous access of records () To prevent inconsistencies or loss of updates () Data being modified cannot be used elsewhere Can lead to deadlock: Simultaneous locking
27
Redundancy:
() Copies of daata in different physical locations () Damage to one location been others can be recovered