4.10 Fundamentals Of Databses Flashcards

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

Explain the concept of a relational database

A

more than one related table
normalised so no data is repeated

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

How are tables linked together in databases

A

one to many
using a crows foot

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

Define what an attribute is.

A

a characteristic of the data in the column

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

Define what a primary key is

A

ensures that every piece of data is unique

e.g. if two people have the same name they will have a different id.
the id is the primary key

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

Define what a composite key is

A

A combination of two or more columns in a table to act as a primary key

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

Define what a foreign key is

A

A foreign key is a set of attributes in a table that refers to the primary key of another table, linking these two tables.

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

Understand why databases are normalised

A

in order to remove any unnecessary or repeating pieces of data.
- Saves memory space
- Data is easier to change (don’t have to go to more than one location to change it)
- more efficient, no wastage

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

How do you normalise relations to third normal form

A

get rid of any groups with multiple pieces of data in one field (e.g. multiple subjects)

seperate atomic attributes (name into firstname lastname)

identfy a primary key

split partial dependencies into different tables. (course name and teacher name will depend on course id so we can split these up into a new table)
- only do this if the dependency (course id) is part of your composite key

change many to many relationships into 2 different one to many relationships in a new table (e.g. student id and course id)

REMEMBER: “ALL ATTRIBUTES ARE DEPENDANT ON THE KEY, THE WHOLE KEY, AND NOTHING BUT THE KEY

make sure no data is repeating

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

How do you select data from a database,
if we wanted to select the dob regarding ‘James Chadwick’

A

SELECT dob
FROM students
WHERE firstName =’James’ and lastName =’Chadwick’

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

How do you update data in a database,
if we wanted to change james chadwick subject to computing instead of maths. Table name is students

A

UPDATE Students
SET subject = “computing”
WHERE firstName = ‘James’, lastName = ‘Chadwick’

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

How do you insert data into a database,
if we wanted to insert a person called james chadwick into student table

A

INSERT
INTO students
VALUES (‘James,’Chadwick’)

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

How do you delete data from a database,
if we wanted to delete a person called james from student table

A

DELETE
FROM names
WHERE firstName = ‘James’

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

How do you use SQL to create a database table named Students with studentid, first and last name and dob

A

CREATE TABLE “Students” (
“StudentID” INT PRIMARY KEY
“FirstName” VARCHAR(30)
“LastName” VARCHAR(50)
“DOB” VARCHAR(10)
);

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

How does a client server database system provide simultaneous access to the database for multiple clients.

A

Transaction processing -
Any information processing which is an individual operation. Each operation must completely succeed or it will fail.

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

How can concurrent (multiple) access be controlled in a database

A

ACID RULES

Atomicity - a change to a database must be completely performed or it won’t be saved to the database

Consistency - Any change in the database must retain the overall state of the database

Isolation - Change in database cannot be interrupted by another change in database. Done using record locking, where it locks the records or fields of data concerned until change is completed.

Durability - Once a change has been made to a database it must not be lost due to a system failure
Done by writing changes into secondary storage as soon as change is made

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

Why does concurrent (multiple) access need to be controlled

A
  • Updates are lost if 2 people change data at the same time