Week 1 - ER Model Flashcards

1
Q

What is a database?

A

Stores large amounts of data.

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

From a software perspective, what can databases do?

A

It’s an expensive piece of software that provides the following functionalities:
To model data (relational data modelling, object oriented data modelling), access data, analyse data, store data and secure data

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

From a software perspective, what can databases do?

6 things.

A

1) model data
2) access data
3) store (physically) data
4) secure data
5) maintain data consistency
6) optimize data access

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

From a user perspective, what can databases do?

A

Provides a black box for users so that they can perform:

1) data modelling
2) work with SQL (a declarative programming language) to manage and query data. Declarative means we tell the DB what to do, not how to do it.

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

If a user is using SQL to communicate with the database, what thing bridges the user to the rest of the system?

A

The application

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

What does the parser component do?

A

checks for any syntax errors

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

What does the optimiser component do?

A

Tries to find the best sequence of the underlying algorithms and how it’s going to solve the request from the user.

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

What happens after the optimiser can found the best optimisation sequence to use?

A

After finding the best optimization sequence of the processing algorithms, then the system invokes all these processing algorithms with access to the computational resources: the CPU, the memory, the data files and so on so forth. Then with an interaction with the OS, our query is executed.

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

What are the six steps that happen when a user writes a SQL query?

A

1) Application
2) parser
3) optimiser
4) processing algorithms
5) CPU/memory/data files/OS
6) Code generator

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

What are the three families of data?

A

1) Structured data
2) Unstructured data (there is no meta-data to interpret the data)
3) Semi-structured data (XML/JSON)

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

What are the two approaches to conceptual data modelling?

A

1) Entity Relationship (E-R) modelling

2) Relational Modelling (purely maths driven)

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

What is a SQL schema?

A

A SQL schema is made when we take the relational model and write down specific statements written in SQL. Once the schema is created, we can start querying in SQL.

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

What are the components of the ER model?

A

1) entities
2) attributes
3) relationships

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

How do you identify an entity in the ER model?

A

Entities are represented in a box with rounded corners

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

What is the instance of an entity?

A

It materialises an entity, e.g. “Chris” is an employee

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

How do you represent an attribute in the ER model?

A

Attributes are represented in an oval shape.

17
Q

What instantiates an attribute in the ER model?

A

A value.

e.g. name = “Chris”

18
Q

After we have instantiated an attribute by assigning it a value in the ER model, what do we get?

A

A tuple. A bunch of values where each value corresponds to a specific attribute.

19
Q

How are relationships in the Entity Relationship model represented?

A

We represent relationships between entities in diamonds. Roles are optional and are the noun for the verb relationship. They’re written on the line.

20
Q

What does relationship cardinality mean?

A

It’s the number of instances that an entity participates in a relationship.

E.g. if entity A = manager
if entity B = project
The relationship cardinality is 1 to 1, because a manager can only manage one project.

21
Q

What are four types of relationship cardinality?

A

1:M one to many
M:1 many to one
1:1 one to one
M:N many to many

22
Q

What happens when we split a many to many relationship?

A

N:M relationship always splits into two one-to-many (1:N and M:1) relationships, by transforming the original one into a new Relationship Entity.