processing we discuss later on works on the explicit
statements only.
We discuss later the rewriting rules for PKN FKs.
Notice for now only, with respect to SIR SQL FKs,
that every (present) SQL FK in some SIR R, is SIR
SQL one as well, by default. Besides, a BA in R can
be a SIR SQL FK, without being the former. With
respect to ‘#’, we recall here only that while
modeled on SQL ‘*’, whenever qualified with a base
table name, e.g., R.#, it designates only every non-
PK attribute of R. Likewise, ‘#’ alone designates
only every non-PK attribute of every base table in
From clause. We discussed the rewriting of a Create
Table with ‘#’ previously, (Litwin, 2022), and will
not come back to here.
E.g., we show soon that DBA may create
S_P1.SP through the implicit Create Table
containing only SP_ scheme and the value
expression of T_WEIGHT. Instead of submitting (2),
one expects therefore DBA to submit only:
(3) Create Table SP (S# TEXT, P# TEXT, QTY INT
{WEIGHT*QTY As T_WEIGHT} Primary Key (S#,
P#));
The procedurality difference is 110 characters in
favor of (3). I.e., 86 characters are necessary in SQL
for (3) versus196 for (2), as one can easily double-
check. Such lesser procedurality is an obvious
practical advantage of (3). Recall also that quest for
less procedural and more natural data definition and
manipulation always was and still is the driving
force for the DB research, as well as for the CS
generally. Remember that it is why in particular the
relational DBs succeeded to Codasyl and IMS ones.
If SP did not have T_WEIGHT or any CA more
generally, it will appear that (3) would reduce
simply to (1), i.e., to the SQL Create Table SP for
S_P. For SIR SQL however, the latter would be the
implicit Create Table for S_P1.SP, with empty IE. In
other terms, for SIR SQL, present S_P scheme
defines in fact S_P1. Yet in other words, for SIR
SQL, S_P scheme suffices for the LNF queries that
have to be with LN in any present SQL dialect.@
Next, for every SIR R, there is an SQL view R,
hence with IAs only, defining logically the same
relation as SIR R. We qualify the latter of canonical
view of SIR R and of C-view R, in short. C-view R
results from Create View R with the same attribute
list as in SIR R, except that every R_ attribute is
stripped to its name only, followed by the same
From clause. The difference between SIR R and C-
view R is thus only physical: every SA in SIR R
becomes the IA with the same name and value in
every tuple within C-view R and vice versa. Adding
a C-view R to an SQL DB with R_ as stand-alone
base table, provides then for the same LNF or CAF
queries as SIR R. Provided however that these
queries address the C-view R, instead of the base
table R, necessarily renamed somehow, i.e., to R_.
The rather easy to see drawback of any C-view R
with respect to SIR R, discussed in detail in our
previous papers, is that the former must be more
procedural to specify and to maintain than even the
explicit IE in SIR R. C-view R has to indeed
redefine every SA of R_ as an IA and it constitutes a
separate table to maintain in sync with R_. The
implicit SIR schemes whenever possible, with
possibly an even empty IE, are obviously even more
advantageous. As we just stated, it would be so, e.g.,
for S_P1.SP (3) and of course, even more for (1). In
present terms, every SIR R is thus a view saver for
C-view R.
Finally, as hinted to in the example above, in
practice, every SIR SQL Create Table will extend to
SIRs Create Table of some existing SQL dialect.
Likewise, SIR SQL Alter Table will extend Alter
Table of the dialect. Call kernel (SQL) the dialect
chosen. Some kernels, provide for base tables with
SAs only, as Codd proposed. Any SIR R defined in
SIR SQL extending the dialect will then have the
base R_ with SAs only. Other kernels provide for
the already mentioned VAs as BAs as well. Recall
then, e.g. from our papers on SIRs, that every base
table R with VAs is in fact a limited SIR R. There,
every VA is an IA inherited only from R_ and only
through arithmetic value expression with, perhaps,
scalar functions over SAs or other VAs of R_ and
with implicit ‘From R_’ clause. Accordingly, e.g., as
inheriting also from P, T_WEIGHT could not be a
VA for any present kernels. Nevertheless, despite
their limitations, VAs became popular view-savers,
as we already hinted to.
For SIR SQL consequently, there is no need for a
kernel providing for VAs, although one can still
define any VAs the kernel provides for. Indeed,
regardless of any such kernel and any VAs it could
provide for, SIR SQL dialect for the kernel would
always provide for an equivalent IA with the same
value expression and the implicit ‘From R_’. In
practice, the only syntactical difference would be
that while any VAs define the attribute name first
and the value expression after, the IA scheme would
be the other way around and somewhere within { }
brackets, instead of usual ‘,’ or ‘ ‘. Somehow
consequently, as one could already observe, for SIR
SQL, if VAs are present in a Create Table of SIR R,
they are not considered IAs, since they are not added
to R_ scheme, but are within. In other words, for
SIR SQL, for any SIR R, IAs are only the attributes