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
Q

What is second normal form?

A

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
Q

What is third normal form?

A

If the database is in second normal form and contains no non-key dependencies

27
Q

What does non key dependency mean?

A

Means the attribute only depends on the value of the primary key nothing else

28
Q

What is indexing?

A

Stores positions of each record in order by a certain attribute
To look up and access data quickly

29
Q

How does indexing work?

A

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
Q

What is SQL?

A

Structured Query Language and is a declarative language used to manipulate databases

31
Q

What is a SELECT sql statement used for?

A

SELECT statement is used to collect fields from a given table

32
Q

What is FROM sql statement used for?

A

FROM statement is used to specify which table the information will come from

33
Q

What is the WHERE sql statement for?

A

Used in conjunction with SELECT and FROM to specify the search criteria

34
Q

How is an SQL statement written?

A

SELECT (Attribute1, Attribute2) FROM (Entity) WHERE (Attribute=search criteria)

35
Q

What is the ORDER BY sql statement for?

A

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
Q

What is the JOIN sql statement for?

A

JOIN provides a method of combining rows from multiple tables based on a common field between them

37
Q

What does the CREATE sql statement do?

A

CREATE function allows you to create a new database

38
Q

How do you use the CREATE function in sql?

A

CREATE TABLE (Tablename)
(
Attribute1 INTEGER NOT NULL,PRIMARY KEY,
Attribute2 VARCHAR(20) NOT NULL,

)

39
Q

How do you use the JOIN function in sql?

A

JOIN (Tablename2)
ON (Tablename1.Attribute1) = (Tablename2.Attribute1)

40
Q

What are the 8 sql datatypes?

A

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
Q

What is ALTER sql statement used for?

A

ALTER is used to add delete or modify columns in a table

42
Q

How do you use ALTER statement in sql to add a column?

A

ALTER TABLE(Tablename)
ADD(AttributesX datatypes)

43
Q

How do you use ALTER statement in sql to delete a column?

A

ALTER TABLE (Tablename)
DROP COLUMN (Column)

44
Q

How do you use ALTER statement in sql to modify data of a column?

A

ALTER TABLE (Tablename)
MODIFY COLUMN (Column NewDataType)

45
Q

What does the INSERT INTO sql statement do?

A

INSERT INTO is used to insert a new record into a database table

46
Q

How do you use the INSERT INTO statement in sql?

A

INSERT INTO (Column1, Column2,…)
VALUES(value1,value2,…)

47
Q

What does the UPDATE sql statement do?

A

UPDATE is used to update a record in a database table

48
Q

What does the DELETE sql statement do?

A

DELETE is used to delete a record from a database table

49
Q

What is a transaction?

A

A single operation execution operated on data or a collection of operations

50
Q

What is Atomicity?

A

A transaction must be processed entirely or not at all

51
Q

What is Consistency?

A

A transaction must maintain the referential integrity rules between linked tables

52
Q

What is Isolation?

A

Simultaneous executions of transactions should lead to the same result as if they were executed one after another

53
Q

What is Durability?

A

Once a transaction has been executed it will remain so regardless of the circumstances surrounding it, such as a power cut

54
Q

What is record locking?

A

The process of preventing simultaneous access to record in a database

55
Q

Why do we use record locking?

A

To prevent inconsistencies or a loss of updates
Improves database performance by disabling multiple user to access data simultaneously

56
Q

How does record locking work?

A

While one person is editing a record, this locks the record so prevents others from accessing the same record

57
Q

What is a problem with record locking?

A

Deadlock- A situation in which two or more transactions are waiting for one another to give up locks

58
Q

What is redundancy?

A

The process of having one or more copies of data in physically different locations

59
Q

Why is redundancy important?

A

If there is any damage to one copy the others will remain unaffected and can be recovered