Databases definitions/info Flashcards

Normalisation, SQL, ACID, transactional processing, concepts

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the conditions for first normal form (NF 1)?

A
  • data should be atomic
  • there should be a primary key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the conditions for second normal form (NF 2)?

A
  • must be in NF 1
  • No partial key dependencies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is dependency?

A

a value that varies in line with another value

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

How are partial dependencies resolved?

A

creating another table with the foreign keys which link the two other tables together

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

what is a foreign key?

A

a link to the primary key in another table

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

what are the conditions for third normal form (3 NF)?

A
  • must be in 2NF
  • no non-key dependencies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are non-key dependencies?

A

any fields which are not designated a primary key or part of a primary key

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

what is the ‘acid test’ for checking a table is in 3NF?

A

each attribute is 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
9
Q

what is SQL used for?

A
  • searching and retrieving records
  • inserting new records into databases
  • deleting records and individual items of data from tables
  • updating existing data and replacing it with new data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is SQL syntax?

A
  • SQL statements are made up of key words
  • convention to write key words in caps
  • each SQL statement is terminated with a semicolon
  • convention to write longer statements over multiple lines
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what does the DROP keyword do?

A
  • delete a table
  • delete an entire database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what does a SELECT statement do?

A

allow you to retrieve data from databases

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

what is the SELECT keyword syntax?

A

SELECT __Field/s__ FROM __Table__;

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

what SQL command can be used to return all fields from a database?

A

SELECT * FROM __Table__;

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

what is the SQL command to return fields in ascending order?

A

SELECT __Fields__ FROM __Table__ ORDER BY __selected field__;

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

what is the SQL command to return fields in descending order?

A

SELECT __Fields__ FROM __Table__ ORDER BY __selected field__ DESC;

17
Q

what is the SQL command to return records given a condition?

A

SELECT __Fields__ FROM __Table__ WHERE __condition__;

18
Q

what does the LIKE keyword do?

A

used with the WHERE keyword to return records in the table are in the same format as the given condition

19
Q

What is a JOIN/INNER JOIN?

A

a specification as to how multiple tables are joined together

20
Q

what is the syntax for a JOIN?

A

SELECT __Fields__ FROM __Table__ JOIN __second table__ ON __field that they are connected with__;

21
Q

what is the syntax for the INSERT keyword?

A

INSERT INTO __table__ VALUES __values__;

22
Q

what is the syntax for the DELETE keyword?

A

DELETE FROM __table__ WHERE __criteria__;

23
Q

what is a transaction in a database system?

A

a single logical unit of work

24
Q

what does ACID stand for?

A

A - atomicity
C - consistency
I - isolation
D - durability

25
Q

what does atomicity mean?

A

ether the whole transaction takes place or none of the transaction

26
Q

what does consistency mean?

A

the transaction does not create inconsistencies in the database

27
Q

what does isolation mean?

A

transactions do not affect other transactions

28
Q

what is durability?

A

once a transaction is complete, it is permanent and cannot be lost

29
Q

what is record locking?

A

an affected record is locked until the update is completed

30
Q

what is a field in a database?

A

used to provide category headings for each item of data in the database

31
Q

what is a record?

A

a collection of data for a set of fields

32
Q

what is a primary key?

A

a field that uniquely identifies each record