4.10 SQL Flashcards

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

What is Normalisation, and how many forms of it are there?

A

Normalization is the process that is used to come up with the best possible design for a relational database, there are three forms:
1) 1st Normal Form

2) 2nd Normal Form
3) 3rd Normal Form

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

How should a Normalised Database look like?

A

1) No Duplicated Information
2) Consistent Data throughout the Data-Base
3) Flexibility so as many items can be added and removed as needed
4) Queries should be able to be processed and an answer returned

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

How do you know if a table is in First Normal Form

A

It contains NO repeating attributes or group of attributes

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

How do you know if a table is in Second Normal Form

A

1) It must be ALREADY in 1st Normal Form
2) Contain No Partial Dependencies (remove attributes that depend on only part of the primary key by creating additional tables)

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

How do you know if a table is in Third Normal Form?

A

1) It must ALREADY be in 1st and 2nd Normal Form

2) All attributes must be 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
6
Q

What is a Foreign Key?

A

A Foreign Key is an attribute that creates a join between two tables

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

What types of Relationships between Entities are there?

A

1) One-to-One
2) One-to-Many
3) Many-to-Many

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

What are the benefits of having a Normalised database over a Non-Normalised one?

A

1) Easier to maintain and modify
2) Data Integrity is maintained as there is no duplication of data
3) Customers who aren’t in the database cannot input their data
4) Faster searching and Sorting as the tables are smaller

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

What is a Primary Key?

A

An entity identifier, which uniquely identifies every entity in the table

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

What is an Entity?

A

An Entity is a category, object, person, event or thing that can be recorded in a Database
E.g Employee, Firm, Actor

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

What is an Attribute?

A

An Attribute is a specific detail about an Entity E.g. A Dentist is an Entity but FirstName Surname of the Dentist are Attributes

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

What is a Relational Database?

A

A Relational Database is where a separate table is created for each entity identified in the system

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

What is a Composite Key?

A

A Composite Key uses more than one Attribute combined together

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

What is an Entity?

A

An Entity is information that is stored in Relational Data-Base

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

What is a Client-Server Database?

A

A Client-Server Database provides simultaneous access to the database for multiple clients

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

What is Concurrent Access?

A

Concurrent Access occurs if updates are lost when if two clients edit a record at the same time, this problem can be solved using

1) Record Locks
2) Serialisation
3) TimeStamp Ordering
4) Commitment Ordering

17
Q

What are Record Locks?

A

A record lock is a lock on the data where as soon as a user with right access takes an item of data a lock is put on that data item so no user can save to that location

18
Q

What is Serialisation?

A

The Process of only allowing transactions on a particular database to take place at one time this process is managed by the DBMS

19
Q

What is Timestamp ordering?

A

Every Transaction that takes place has a read and write timestamp that indicated the last time the record was written to or recorded from

20
Q

What is Commitment Ordering?

A

The system looks at each command that has been asked to take place and works out which one should take precedence over other commands