SLR 10 - DATABASES Flashcards

1
Q

Define relational database

A

allows the user to specify information about multiple tables and the relationship between those tables

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

Define flat file

A

a database that allows the user to specify data attributes (columns, databases etc.) for only one table at a time, storing those attributes independently

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

Define primary key

A

a field that uniquely identifies a record in a table

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

Define foreign key

A
  • the linking field in the foreign table formed when a relationship is made
  • the foreign key becomes by default the primary key of the new table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define composite primary key

A

when more than one field is added together to form a unique primary key for a table

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

Define secondary key

A

a key field which can be used to access a table in a different way

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

Define entity relationship modelling (ERM)

A

the process of producing a data model for describing the data or information aspects of a business domain or its process requirements, in an abstract way that lends itself to ultimately being implemented in a data such as a relation database

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

What is normalisation?

A

the formal process of optimally designing data tables by reducing data redundancy and repetition by converting them into normal forms

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

What is 1st normal form (1NF)?

A
  • no repeating attributes/groups of attributes
  • all attributes must be atomic (a single attribute can’t consist of 2 data items)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is 2nd normal form (2NF)?

A
  • table is in 1NF
  • contains no partial dependencies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is 3rd normal form (3NF)?

A
  • table is in 2NF
  • contains no non-key dependencies (all attributes are dependent on the key, the whole key and nothing but the key)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advs of normalisation

A
  • easier to maintain and change a normalised database
  • no unnecessary duplication of data
  • data integrity is maintained
  • having smaller tables with fewer fields means faster searches and savings in storage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is referential integrity?

A

the idea of keeping a database consistent by ensuring that any changes made to data or relationships 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
15
Q

What are the SQL commands/statements?

A
  • SELECT
  • FROM
  • WHERE
  • LIKE
  • AND
  • OR
  • JOIN
  • ON
  • INSERT INTO
  • UPDATE
  • SET
  • DELETE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you select everything from a section?

A

asterix (wildcard)

17
Q

What are the possible data types when creating a new table?

A
  • 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 (#dd/mm/yyyy#)
  • TIME: the time in the format Hour/Minute/Second
  • CURRENCY: sets the number as a monetary amount
18
Q

How do you create a new table in SQL?

A

CREATE TABLE tblname
(
tblID CHAR(4) NOT NULL PRIMARY KEY
description VARCHAR(20)
)

19
Q

How do you add a new column to a table?

A

ALTER TABLE tblname
ADD FieldName DATA_TYPE

20
Q

How do you delete a column from a table?

A

ALTER TABLE tblname
DROP FieldName

21
Q

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

A

ALTER TABLE tblname
MODIFY COLUMN FieldName newDATA_TYPE

22
Q

How do you insert a new record into a table?

A

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

23
Q

How do you update a record in a table?

A

UPDATE TableName
SET column1 = value1, column2 = value2 …
Where columnX = value

24
Q

How do you delete a record from a table?

A

DELETE FROM TableName
WHERE columnX = value

25
Q

What does a database management system (DBMS) do?

A

ensures that data stored in a database remains consistent

26
Q

What is data integrity?

A
  • the maintenance and consistency of data in a data store
  • the data store must reflect the reality that it represents
27
Q

What is transaction processing?

A

The idea of making sure that any logical operation or change in state of a database (transaction) conforms to ACID (Atomicity, Consistency, Isolation, Durability) rules for reliable processing

28
Q

What does ACID stand for?

A
  • Atomicity
  • Consistency
  • Isolation
  • Durability
29
Q

What does atomicity mean?

A

all transactions should either succeed or fail, and never only partially processed

30
Q

What does consistency mean?

A

each transaction must obey the defined validation rules of the database to maintain referential integrity

31
Q

What does isolation mean?

A
  • no transaction should overwrite other transactions that are simultaneously occurring
  • the same results must be obtained if transactions are concurrently or sequentially processed
32
Q

How does the DBMS enforce isolation?

A
  • implements a system of record locking
  • record(s) affected by the transaction are locked effectively placing them in a read only state
  • when the transaction is fully complete the lock will be removed
33
Q

What does durability mean?

A
  • once a transaction has begun, it must be completed under all circumstances
  • as each part of the transaction is completed, its held in a buffer/cache on a disk
34
Q

What are some methods of capturing data?

A
  • paper based forms
  • optical character recognition (OCR)
  • optical mark recognition (OMR)
  • barcodes
  • QR codes
  • sensors
35
Q

How is data exchanged?

A
  • electronic data interchange (EDI)
  • computer-to-computer exchange for documents
  • all docs must be in standard format