10 - Fundamentals of Databases Flashcards

1
Q

What does it mean for relations to be in Third Normal Form.

Why is it important that the relations in a relational database are in Third Normal Form?

A

3NF means every non-key attribute is dependent on the key, the whole key and nothing but the key. There are also no repeating groups.

This is important to eliminate update anomalies, eliminate insertion anomalies, eliminate deletion anomalies, eliminate data inconsistency and minimise data duplication.

So help me COD!!!! :()

Footnote - ooo my foot hurts

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

State the properties that the relations in a fully normalised database must have.

A
  • There are no repeating groups of attributes.
  • All non-key attributes depend on the whole key.
  • All non-key attributes depend on nothing but the key.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the name given to a key that is made up of multiple attributes?

A

Composite key

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

Why is it important for a database to be in third normal form?

A
  • Eliminate update anomalies
  • Eliminate insertion anomalies
  • Eliminate deletion anomalies
  • Reduce data redundancy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Relational Database?

A

A Relational Database is a Database which stores information in Relations/Tables. Each Relation will consist of Records/Rows and Attributes/Columns.

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

What is SQL?

A

SQL is Structured Query Language, a language for communicating with Relational Databases.

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

What is a Primary Key?

A

A Primary Key is a unique identifier for each Record in a Relation.

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

What is a Foreign Key?

A

A Foreign Key is an identifier for a Record in another Relation.

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

What is a Composite Key?

A

A Composite Key is a Key (Primary or Foreign) which consists of multiple Attrributes.

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

What is First Normal Form?

A

A Relation is in First Normal Form if it has no repeating Attribute or group of Attributes.

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

What is Second Normal Form?

A

A Relation is in Second Normal Form if it is in First Normal Form and there are no Partial Key Dependencies.

A Partial Key Dependency is when an Attribute is dependent upon only part of a Composite Key.

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

What is Third Normal Form?

A

A Relation is in Third Normal Form if it is in Second Normal Form and there are no Non-Key Dependencies.

A Non-Key Dependency is when an Attribute is dependent upon another Attribute which is not part of the Primary Key.

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

Why do Databases implement Record Locks?

A

Record Locks prevent multiple users from changing the same Record in a Relation at the same time which can lead to inconsistent results or corrupt data.

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

What is DeadLock?

A

DeadLock is when cyclical dependency appears between the Record Locks that users have created whilst interacting with a Database. For example user A may have locked Table 1 whilst waiting for user B to unlock Table 2, whilst user B is waiting for Table 1 to be unlocked to continue.

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

What is an entity

A

Any real world object or conceptual object defined inside a database

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

What is a record

A

A collection of data for one object / person or thing. (This is usually the row for visual reference)

17
Q

What is a field

A

Used to provide a database with category headings for each item

18
Q

What is a primary key

A

A field in a database that acts as a unique identifier for each record

19
Q

What is a composite primary key

A

The combination of 2 attributes which are unique identifiers for the record.

20
Q

What is referential integrity

A

When a record is added to a table and a value is entered into a foreign key field/ the value exists in the primary key field of the related table. That forms a relationship between the two tables.

21
Q

What is Data integrity

A

The accuracy and reliability of data

22
Q

What is data inconsistency

A

Data that isn’t updated correctly or updated at all leads to data becoming inconsistent and lacks integrity

23
Q

What is data redundacy

A

Unnecessary data repetition

24
Q

What is a DBMS

A

a software package that allows the database administrator to maintain one or more relational databases. Some provide user interface.

25
Q

What are the advantages of relational databases

A

Data is more consistent and avoids redundant data. This also means that chance of errors being inputted are less likely.

26
Q

What is normalization (databases)

A

a technique used to help reduce data duplication when designing data structures/ also resulting in an improvement in data integrity.

27
Q

What is SQL?

A

Structured Query Language

28
Q

Give an example of The command CREATE TABLE with 3 fields ( name/ species/ PetID)

A

CREATE TABLE tbAnimals (PRIMARY PetID VARCHAR(10)/ species VARCHAR(10)/ species VARCHAR(10));

29
Q

Use a select statement to select all names in alphabetic order where age

A

SELECT tblAnimals.name/From tblAnimals/ORDER BY tblAnimals.name ASC;

30
Q

Use an insert into statement to insert a new dog called Barry with the Pet id of 2A

A

INSERT INTO tblAnimals(PetID/ name/ species)VALUES (“2A”/ “Barry”/ “Dog”);/Use an UPDATE statement to change a a dog called Barry’s pet id to 2D/UPDATE PetID/SET PetID = “2D”/WHERE name = “Barry”;

31
Q

Use a delete statement to delete Barry the dog (2D) from the database

A

DELETE FROM tblAnimals/WHERE PetID = “2D”;

32
Q

Use a drop statement to Drop the table tblAnimals

A

DROP TABLE tblAnimals;

33
Q

Use an ALTER STATEMENT to add a new field/ OwnerName Varchar

A

ALTER TABLE tblAnimals ADD OwnerName VARCHAR(10);