14 Databases Flashcards

(19 cards)

1
Q

What is a database?

A

A large store of categorised data

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

What is a flat file database?

A

A database with only one table

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

What is normalisation?

A

The process of converting a flat file database into a relational database.

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

Describe how to convert to first normal form?

A

Split multi valued attributes into two different rows by ensuring atomic values.
E.g. if the field “subject” has values maths,science
It should be split into two different entities one with subject science and one with subject maths

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

Describe how to convert to second normal form?

A

Remove partial dependencies by splitting tables.

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

Describe how to convert to third normal form?

A

Remove transistors dependencies. (No column in a table should depend on a non key attribute in said table)

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

What are the three types of relationships between tables in an ERD?

A

1 to 1
Many to 1
Many to many

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

Show what a database schema would look like:

A

Customers (CustID, Nam, Town)
Orders (OrderID, CustID)

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

What are the three types of key?

A

Primary key
Foreign key
Composite key

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

How can you easily tell if there is a many relationship?

A

If the primary key of table 1 appears as a foreign key in table 2 then table 1 has a 1 to many relationship with table 2.

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

What is the lost update problem?

A

When two users try to update the same record simultaneously the record will be inconsistent between users after being edited.

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

What are the two methods implemented to combat the lost update problem?

A

Record locks
Transaction queueing

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

Describe how record locking works:

A

If another user is accessing a record other users are not able to access it until the user is no longer accessing it.

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

What is transaction queuing?

A

Database changes are grouped as transactions and queued.
Database software processes the transactions in FIFO order from the queue.

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

Write a generic SQL update statement

A

UPDATE table name
SET column=value, column2=value2
WHERE condition

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

Write a generic SQL fetch statement

A

SELECT column1, column2
FROM table name
WHERE condition

17
Q

Write a generic SQL delete statement

A

DELETE FROM table name
WHERE condition e.g. column=value

18
Q

Write a generic SQL write statement

A

INSERT INTO table name (column1,…)
VALUES (value1,…)

19
Q

Write a generic parameterised SQL statement

A

SELECT table1.column, table2.column
FROM table1, table2
WHERE table1.sharedColumn=table2.sharedColumn AND condition