1. General
Database
Collection of permanently and digitally stored data.
Database model
A collection of rules to describe the possible structure consistency rules and behaviour of a
database.
Database Management System (DBMS)
A system that manages multiple databases and allows multiple applications to access data at
the same time.
NoSQL database
● Column-oriented database: data is stored in columns.
● Document-oriented database: data is stored in documents following some standard (i.e.
JSON, XML, etc.).
● Key-value database: data is stored in dictionaries or hash tables.
● Graph database: data is stored in nodes and edges (connections).
Types of data
● Structured data: tabular data (row & columns) in a strict format.
● Unstructured data: raw data (i.e. text files).
Relation
Table with rows and columns.
Attribute
Named columns of relation.
Value range
Set of valid values for one or more attributes.
Tuple
Row of a relation.
Super key
Attribute or a set of attributes used to uniquely identify tuples in a relation.
● Key candidate: minimal required attributes to maintain unique identification.
Primary key
The key candidate selected to uniquely identify tuples of a relation.
1
, Foreign key
Attribute which corresponds with the primary key of another relation.
Relation schema
Schema composed of the relation name, attributes and the primary key.
Relation database
Collection of normalized relations.
Integrity types
● Attribute integrity: Constraints based on an attribute i.e. limiting attribute values to a
specified range.
● Static tuple integrity: Limit the possible combination for values in a tuple.
● Static relation integrity: Constraints based on a relation ie.e the simultaneous occurrence
of certain tuples in a relation.
● Static database integrity: Constraints based on a database i.e. the primary key of relation
must exist if a foreign key references this attribute.
● Referential Integrity
● Restricted: reject update/delete action.
● Cascade: propagate into child relation on update/delete action.
● Nullify: set corresponding value to NULL on update/delete action.
Integrity conditions
● Static Integrity Condition: Limit the database status i.e. name must always be entered
(can be created with regular constraints).
● Dynamic Integrity Condition: Limit status changes or their consequences (can be created
with trigger constraints) i.e. single → married → {divorced, widowed}.
SQL types
● DDL: data definition language, defines database structure & schema.
● DML: data modification language, manages data within schema objects.
● DCL: data control language, manages data access, authentication & authorization.
● TCL: transaction control language, manages transactions within the DML language.
Static Constraints
● Primary key
● Foreign key
● Not null
● Unique
● Check
Transaction
Consists of one or more statements that are executed by one database client and select, insert,
update or delete data in the database.
2
Database
Collection of permanently and digitally stored data.
Database model
A collection of rules to describe the possible structure consistency rules and behaviour of a
database.
Database Management System (DBMS)
A system that manages multiple databases and allows multiple applications to access data at
the same time.
NoSQL database
● Column-oriented database: data is stored in columns.
● Document-oriented database: data is stored in documents following some standard (i.e.
JSON, XML, etc.).
● Key-value database: data is stored in dictionaries or hash tables.
● Graph database: data is stored in nodes and edges (connections).
Types of data
● Structured data: tabular data (row & columns) in a strict format.
● Unstructured data: raw data (i.e. text files).
Relation
Table with rows and columns.
Attribute
Named columns of relation.
Value range
Set of valid values for one or more attributes.
Tuple
Row of a relation.
Super key
Attribute or a set of attributes used to uniquely identify tuples in a relation.
● Key candidate: minimal required attributes to maintain unique identification.
Primary key
The key candidate selected to uniquely identify tuples of a relation.
1
, Foreign key
Attribute which corresponds with the primary key of another relation.
Relation schema
Schema composed of the relation name, attributes and the primary key.
Relation database
Collection of normalized relations.
Integrity types
● Attribute integrity: Constraints based on an attribute i.e. limiting attribute values to a
specified range.
● Static tuple integrity: Limit the possible combination for values in a tuple.
● Static relation integrity: Constraints based on a relation ie.e the simultaneous occurrence
of certain tuples in a relation.
● Static database integrity: Constraints based on a database i.e. the primary key of relation
must exist if a foreign key references this attribute.
● Referential Integrity
● Restricted: reject update/delete action.
● Cascade: propagate into child relation on update/delete action.
● Nullify: set corresponding value to NULL on update/delete action.
Integrity conditions
● Static Integrity Condition: Limit the database status i.e. name must always be entered
(can be created with regular constraints).
● Dynamic Integrity Condition: Limit status changes or their consequences (can be created
with trigger constraints) i.e. single → married → {divorced, widowed}.
SQL types
● DDL: data definition language, defines database structure & schema.
● DML: data modification language, manages data within schema objects.
● DCL: data control language, manages data access, authentication & authorization.
● TCL: transaction control language, manages transactions within the DML language.
Static Constraints
● Primary key
● Foreign key
● Not null
● Unique
● Check
Transaction
Consists of one or more statements that are executed by one database client and select, insert,
update or delete data in the database.
2