Relational Model- Structure Flashcards
The scalar
The smallest semantic unit of data. It’s the smallest piece of data that has meaning
Domain
A named set of scalar values, all of the same type.
In the context of relational models: domains are pools of values from which actual attribute values are drawn
Domains are more than data types given nowaday.
E.g. domain of all possible cities in the world
Relation (remember)
- set of attributes (heading) -> attribute name; domain name pairs
- set of tuples (body) -> set of attribute - name, attribute - value pairs
Relation(definition)
A relation consists of a heading and a body.
The heading is a set of attributes, where each attribute is associated with a domain.
The body is a set of tuples, where each tuple is a set of attribute values.
The attribute values come from the domain that’s associated with that attribute’s name in the heading.
NB point about Atomicity.
Attribute values are scalar.
You can only have one thing in a place
Properties of relations
- There are no duplicate tuples
- Tuples are unordered, top to bottoms
- Attributes are unordered, left to right
(1-3 important for data independence)
All attribute values are atomic (can only come from domains of scalar values so they will always be atomic)
Table vs Relation
Relations are abstract objects. They are good to express the idea of what is happening in the database.
Tables are the actualisation of the models in the relational database