4.10 Fundamentals of databases

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/37

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:23 AM on 5/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

38 Terms

1
New cards

What are the 3 possible connections between enties?

one - to - one (1:1)

one - to - many (1:M)

many - to - many (M:N)

2
New cards

Which connection can’t databases handle?

many to many (M:N)

3
New cards

What must be made to resolve M:N relationships?

a LINK entity / table

4
New cards

Why can’t M:N relations be handled without a link table ?

There would be multiple values in a single cell violating 1NF, or data redundancy would occur as e.g. a students name is inserted 5 times into a single table

5
New cards

Produce an Entity description of a student which has a firstname, lastname, and date of birth

STUDENT(StudentID, FirstName, LastName, DOB)

6
New cards

How are composite primary keys or primary keys indicated in an entity description?

underline both parts

7
New cards

Define foreign key

An attribute in one table that is a primary key in another table, used to link between the two

8
New cards

What might be the ENTITIES in a library that stocks books and has members

BOOK, MEMBER

9
New cards

How are foreign keys indicated in an Entity Description?

Italics e.g. foreign_key

10
New cards

Define “Table” in regards to a database

A method of implementing an entity in a database

11
New cards

Define “entity” in terms of a database

An object about which data will be stored

12
New cards

What do the columns and rows represent in a table/entity in a database ?

Columns : Attributes → characteristics of this entity, e.g. house number

Rows : A specific instance of this entity e.g. a specific customer

13
New cards

What are the rules for : 1NF?

Each field contains atomic data (A single value that cannot be split into smaller values),

No repeating attributes

14
New cards

What are the rules for : 2NF?

Already 1NF,

All non-key attributes depend on the whole PK

15
New cards

What are the rules for : 3NF?

Already in 3NF,

All non-key attributes depend only on the key attributes

16
New cards

What is normalisation in terms of a relational database ?

A process that ensures data is structured efficiently

17
New cards

Why do we normalise databases?

Avoid data redundancy;

Improve data integrity

18
New cards

What is SQL

“Structured Query language”

A specialised language for manipulating databases

19
New cards

How do you create a table using SQL ?

CREATE TABLE Customer

(

CustomerId VarChar(5),

CustomerName VarChar(255),

PRIMARY KEY (CustomerID)

);

20
New cards

How do you update a value in a table using SQL ?

UPDATE Customer

SET CustomerName = ‘John’

WHERE CustomerID = ‘1’;

21
New cards

How do you delete a value from a table using SQL ?

DELETE FROM Customer

WHERE CustomerID = ‘1’;

22
New cards

What are the key points needed to create a table ?

Key words capitalised : CREATE, TABLE, PRIMARY KEY

Primary Key defined

Attributes defined as well as their datatypes

semicolon at the end

23
New cards

What are the key points when updating a table?

Key words capitalised : UPDATE,SET,WHERE

semicolon at the end

24
New cards

What are the key points when deleting a record from a database?

Keywords capitalised : DELETE, WHERE

The whole record is deleted

; at the end

25
New cards

How do you insert a value into a database?

INSERT INTO Customer

(CustomerId,CustomerName)

VALUES (‘V1’,’V2’);

26
New cards

What are the key points for inserting a value into a database table?

Keywords capitalised : INSERT,INTO,VALUES

List the attributes, that are being inserted, after the table name

List the instance of the attributes after the keyword VALUES

; to end

27
New cards

How do we query data (search/sort) with SQL?

SELECT CustomerName,CustomerAddress

FROM Customer

WHERE CustomerName = “John”

ORDER BY CustomerName DESC;

28
New cards

What is a Client Server Database ?

A way of implementing a database where the database is put into a server that various users can access from their own workstations

29
New cards

Where do queries run in a client-server database?

The queries run on the server

30
New cards

What allows queries run on a client-server database?

The DBMS

31
New cards

What is DBMS

Database Management System : software that enables the management of all aspects of a database including inserting/updating/querying data (how data is stored and accessed)

32
New cards

What two methods are used to prevent concurrency issues?

Record locks

Serialisation

33
New cards

What is meant by Record Locks ?

Once someone with write access accesses a record, nobody else can save to that location (sometimes they can but they must acknowledge that it may be being edited elsewhere)

34
New cards

What is meant by Serialisation ?

Only allowing actions to occur one at a time

35
New cards

What are the two methods of implementing Serialisation ?

Timestamping and Commitment Ordering

36
New cards

What is meant by Timestamping?

Every transaction has a read and a write timestamp that indicate the last time that process occurred on that record,

The DBMS uses a protocol to decide if an action can be committed depending on the timestamps,

e.g. if there was an update made at a time later than a transactions write timestamp, then this transaction will be rejected

37
New cards

What is meant by commitment ordering?

If two different transactions have a dependency or conflict with each other, they must commit in the exact same order that their conflicting actions occurred.

38
New cards

Why is commitment ordering better than record locks ?

Record locks can cause deadlocking (where T1 is waiting for T2 which is waiting for T1)

Commitment ordering doesn’t have this