4.10 - Fundamentals Of Databases Flashcards

(19 cards)

1
Q

In entity notation Student(StudentID, Name, DOB) which attribute is the primary key?

A

StudentID (underlined attribute is the entity identifier).

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

What is an entity relationship diagram (ERD) used for?

A

To visualise a data model by drawing each entity as a box and connecting them with relationship lines (1-to-1, 1-to-many, many-to-many).

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

Define the database term attribute.

A

A single named data item describing a property of an entity (a column in a table).

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

Define primary key.

A

A single attribute (or minimal set) that uniquely identifies each record in a relation.

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

Define composite primary key.

A

A primary key made of two or more attributes together when no single attribute is unique on its own.

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

Define foreign key.

A

An attribute in one table that references the primary key of another table, creating a relationship.

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

State the concept of a relational database.

A

A collection of normalised tables (relations) that are linked through foreign-key relationships so that data redundancy is minimised and integrity is maintained.

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

What is the goal of normalisation?

A

To reduce redundancy and anomalies, and ensure data integrity by organising data into well-structured relations.

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

List the three anomalies removed by normalising to 3NF.

A

Insertion, deletion and update anomalies.

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

What are the three tests a relation must pass to be in Third Normal Form (3NF)?

A

1NF: No repeating groups; 2NF: No partial key dependence; 3NF: No transitive dependence (all non-key attributes depend only on the whole key and nothing else).

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

Given a relation Order(OrderID, CustomerID, CustName, CustAddress), why is it not 3NF?

A

CustName and CustAddress depend on CustomerID (a non-key) not on the whole primary key → transitive dependence.

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

Write an SQL CREATE TABLE statement that defines table Customer with CustomerID (PK) and Name.

A

CREATE TABLE Customer ( CustomerID INT PRIMARY KEY, Name VARCHAR(40) );

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

Write an SQL query to retrieve all orders placed after 1-Jan-2025 ordered by date.

A

SELECT * FROM Orders WHERE OrderDate > ‘2025-01-01’ ORDER BY OrderDate;

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

SQL to insert a new student (ID = 17, Name = ‘Jo’).

A

INSERT INTO Student (StudentID, Name) VALUES (17, ‘Jo’);

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

SQL to update a book’s price (ISBN = ‘123’) to £19.99.

A

UPDATE Book SET Price = 19.99 WHERE ISBN = ‘123’;

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

SQL to delete all sessions with a mark below 40.

A

DELETE FROM Session WHERE Mark < 40;

17
Q

How can a client–server DBMS serve many users at once?

A

The DBMS runs on a server; clients send requests over a network. The server handles queries concurrently and returns results.

18
Q

What risk occurs if two clients edit the same record simultaneously?

A

A lost update: the later write overwrites the earlier change.

19
Q

Name four techniques a DBMS can use to control concurrent access.

A

Record locking, serialisation, timestamp ordering, commitment ordering.