15 Relational Database Schema
A relational database schema `S` means all the following:
- a set of base relvars denoted by `relvars(S)`
- a relvar predicate defined on each base relvar. It is assumed that in any given world situation the extension of each relvar predicate is determined.
- the extension of the database constraint, which is a non-empty set of database values denoted by `C(S)`, where a database value is a tuple of relations which records the values of the base relvars.
Note that an empty set of relvars is possible and it means the database records no information. In that case `C(S)` equals DEE and its cardinality is 1 (there is just one possible database value).
Schema as possrep of a database type
In order to supported nested relational databases we regard a relational database schema as a possrep defining a type (a dbtype).
The relvars of the schema are the possrep components. The database schema constraint is the possrep constraint.
A value of a dbtype is called a dbvalue. A variable of a dbtype is called a dbvar.
Using a database value to represent a value of some data type
Perhaps every possrep can be regarded as a database schema!
Consider a representation of a circle value involving its radius and centre. These components of the possrep can be regarded as relvars that have relvar predicates:
| Formula | Predicate |
|---|---|
| radius(R) | the radius of the circle is R |
| centre(C) | the centre of the circle is C |
There is a good motive for doing this, we'd like to maximise the use of logic in the system.