Lecture 1 - Relational Model Flashcards

1
Q

Any entity and any relationship are modelled as a …

A

relation, which maps to a 2D table.

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

What does a 2d table in a relational model have and what do these represent?

A
  • an ordered set of attributes (columns)
  • a set of tuples representing instances (rows)
  • a specific unique attribute that identifies a tuple in a relation (could be sequential or logical)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a query?

A

attributes of interest to be retrieved and constrained attributes to filter out irrelevant or unncessary tuples in the context

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

Bank account context example of a select all query with active accounts that have over 500 pounds?

A

SELECT name FROM BankAccount
WHERE balance > 500 AND status = ‘active’

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

Formally how is a relation represented?

A

Rname (attr1 , attr2 , …. , attrn) with each attribute being within a specific domain e.g. int or text

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

What is a schema?

A

A relation schema can be thought of as the basic information describing a table or relation.

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

What is a relation?

A

The conceptual model for storing contextual data

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

What is a tuple?

A

ordered set of values corresponding to attributes of the relation and satisfying the domain constraints

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

Relation vs schema

A

Relation is the model for an entity and its relationships, it is conceptual. A schema is how the relation will be placed in a table (i.e. table design )

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

What is an instance?

A

A set of tuples -> populated table / rows in the table

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

What is NULL?

A

represents an unknown, or inapplicable, or uncertain, or missing value

-> the meaning behind NULL for a certain attribute comes with context

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

Relational Database Schema

A

set of relations (design of the tables for the whole database (how should each relation be implemented))

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