Homogeneous and inhomogeneous RDB - Databases

Homogeneous and inhomogeneous RDB

Consider the case of homogeneous local databases (σ & ord 1). In this case, most often talk about relational databases. However, even with all the assumptions made earlier, there are difficulties.

Let there be strict correspondence MSi • σ = ψ • Msj. When going over to an arbitrary model Mk (Figure 11.7) due to ψ & sup1; 1 should be Msi • σ = ψ • Msk If ψ is to be kept (which is desirable), then the semantics of JODM M must be very rich.

Local Database Relationship

Fig. 11.7. Local Database Correlation

This condition is difficult to fulfill, so they act differently. Change the function ψ for the IOD and for the NMD by building the corresponding (pairwise) drivers in ODBC. From the standpoint of languages, it is useful to use the standard SQL language, whose numerous dialects are well understood each other. Because there are few versions of the same type of DBMS (for Paradox, dBASE, FoxPro, BTrieve, Access, Oracle), there are a few drivers used in ODBC, which is a serious argument in favor of this direction.

The procedure is significantly more complicated for the case of different data models (σ & sup1; 1).

The construction of heterogeneous RDBs is possible in two ways.

1. The user in each node is provided with an interface from users of other local databases, that is, n (n-1) data conversion schemes.

2. A single standard user interface and a standard internal query form are created: one RDB scheme, but each type of local DB must have its own type of schema converter into a common form (n conversion types for n local DBMSs). The user should in this case study the new scheme - the network standard. Both methods have their advantages and disadvantages.

In general, there is a need to build an intermediate, universal, virtual data model [14, 15], for the implementation of which you can use, for example, a relational model.

The complexity here is not only, as noted earlier, in the need for a wealth of semantics of JOD and NMD. Indeed, the commutative diagrams of the NMD operators assume the preservation of the invariance in Mi of the logical dependencies of the data taking place in Mj. Directly to this requirement the semantics of the initial operators does not satisfy: different requirements for the semantics of the Mj model will correspond to this requirement, including for the composition of the functional complete set of operations. Display an arbitrary model of Mi in Mj. without changing the semantics of data and operations on them in Mi is not possible.

Then in the general case it is necessary to construct an intermediate model Mj (Fig. 11.8), such that Mj = kernel Mj + Mji, where the model Mji. displays the logical dependencies present in Mi. We call Mji. interpretation Mi in Mj: it has all the properties of the data models.

When designing Mji, it is useful to use the following principles.

1. Orientation to the initial data types Mj when constructing in ML more complex types, reflecting the dependencies in Mi, with the basis of Mji. is a M.-kernel.

2. Combining the syntax of the set of operators Oji of the MJJ MJ with the syntax of the set of operators Oj by changing the semantics.

3. The Mj kernel must have the maximum variety of primary data types with a minimum of constraints.

4. Principles of the construction of the core should ensure its simple expansion by introducing axiomatic data types and constructing declaratively specified semantic restrictions on primary data types.

In this case, the conversion procedure can have this sequence:

1) the initial M and the target (finite) M data model are determined;

2), the MOR is shown in Mj under the injective operators ψ: Bi → Bj and the commutativity diagrams of the circuit description are verified;

3) the model Mj extends to Mji, including the choice of the σji axiom schemes, the definition of the semantics of the set of operators Oji, the extension Mji of the model Mj, and the formal verification of logical and operator completeness;

Converting data from different models

Fig. 11.8. Converting data from different models

4) maps of the IODM Mi are constructed in the IJOD Mji, NMD Mi in the MJJ NMD, including the verification of the commutativity of diagrams of maps of schemes and operators.

The truth of the axiom system must be invariant to the changes made by the NMD operator in Mji. Axiom aji & Icirc; Mji is an invariant of the data model of M. with respect to the Oji operators, if the truth of ajI (ojI (R)/R) for any ojI & Rci from the truth ajI (R), where R is the implementation of a composite data type, ; OjI and arbitrary R. Such a system of axioms must be logically and operatorally complete.

ER-diagrams [39] and relational models satisfy the listed requirements of the extensible model [14, 15]. In the latter case, the language of predicate logic can serve as the basis for constructing axiomatic data types.

As the experience of [39] and especially [14, 15] has shown, the universal model is quite large and complex, and the requirement of universality (in particular, for included models of binary relations, semantic networks, frames) is too rigid and in practice it is rarely necessary .

Only network and hierarchical data models are used more often (along with relational MDs). Their implementations are few, and therefore it seems more reasonable to build the appropriate drivers - pairwise method (see Figure 11.3, b ). This approach is also an element of building a universal model.

In this regard, consider the hierarchical-relational and network-to-relational relational MD (the relationship between the network and hierarchical data models is fairly simple and, moreover, discussed in Chapter 6).

When describing a relational database, we use the standard version of the SQL language, assuming that all non-standard features can be eliminated by using the ODBC application.

When converting the MD, it is assumed (see Figure 11.5, a ) that the mapping of the sets of data types (data formats) is carried out. It's about mapping the data structures and (Figure 11.5, b ) of the corresponding commands (JAMS).

Different combinations of MDs are possible. We will discuss only the transformation of network data models into relational ones, and consider only two of the numerous variants of converting network MD to relational one.

A. The entire network MD is considered to be a collection of member-pairs of owner-member entries [10], and the record structure is assumed to be simple (without aggregates), without feedback.

B. The aggregates are allowed in the record structure, the set structure is hierarchical and has no cycles [14, 15]. In fact, the system of sets is being transformed into a system of tables (files).

Recall the most important characteristics (Table 11.5), which determine the structure of the network MD.

Table 11.5

Network MD Commands





CALC & lt; key & gt;


MANDATORY - mandatory destruction

AUTOMATIC - automatic

VIA & lt; name & gt; SF.T

Storing records nearby


Work of the programmer


By default,



OPTIONAL - optional destruction, transfer

MANUAL - manual, from SYSTEM





A. Let's consider separately [10] two conversion procedures: network - relational MD, relational - network MD. In [10] such a transformation (without operations) is called translation.

Let N and R denote the records and relations in the network and relational databases, respectively. Let's do the following:

1. For any type of Ni record, we define this ratio:

a) Ri contains one attribute for any Ni data element;

b) if Ni has a key, then the key Ri corresponds to the key Ni, otherwise the key Ri corresponds to the key of the database N., which appears in Ri as an explicit attribute.

2. For any connection Lij, where Ni is the owner record, Nj is the member record, we define the relational constraint and change the existing relation so that:

a) the Ni key appeared as a foreign key in Ri;

b) introduce restrictions depending on the type of membership.

Let X be the foreign key FK (R.) of the relation Ri with respect to Rj. We denote this restriction by FCij. The X key may or may not be defined (the network MD entry is transferred to the system). This fact is denoted by NFC ...

The result of converting the network model to a relational model is shown in Table. 11.6 for four cases: 1) MANDATORY AUTOMATIC (MA); 2) MANDATORY MANUAL (MM); 3) OPTIONAL AUTOMATIC (OA); 4) OPTIONAL MANUAL (OM).

From Table. 11.6 that transformation is possible not for all cases.

Table 11.6

Convert network MD to relational









Add FCij.

1. A tuple of the relation R is included only if there exists a tuple of the relation R. with the values ​​of the key corresponding to the value of FK (Ri) in the added tuple R j

Add NFCij.

1. A tuple of the relation Ri is included only if there exists a tuple of the relation Ri with key values ​​corresponding to the value of FK (R) in the added tuple Rj

Add NFCij.

1. The tuple of the relation Ri is included only if there exists a tuple of the relation Ri with the values ​​of the key corresponding to the value of FK (Ri) in the added tuple Rj: the value of FK (Ri) can be ns determined

2. When deleting the tuple Ri, it is necessary to delete all the tuples Rj where FK (Ri) is equal to the value in the deleted relation Ri:

2. When deleting a tuple R., it is necessary to delete all tuples Ri, where FK (Ri) is equal to the value in the deleted relation Ri

2. When deleting the tuple Ri, it is necessary to delete all tuples Ri, where FK (Ri) is equal to the value in the deleted relation Ri, and the value of FK (Ri) must be replaced by "undefined"

2. If the tuple of R. is deleted, it is necessary to remove all the tuples of Rj, FK (Ri) is equal to the value in the deleted relation Rj, and the value of FK (Ri) should be replaced by "undefined"

3. When updating the tuple Ri, the value of FK (Ri) nc can be replaced by a value that corresponds to the key of some tuple R.

3. When updating the tuple Ri, the value of FK (Ri) can not be replaced by a value that does not correspond to the key of any tuple Ri

Converting a relational model to a network model follows the following rules.

It is necessary that all the attributes of a relational MD have unique names. In the relational model, you should identify foreign keys used for the functional dependencies displayed by the links between records in the network schema, and the types of M: N relationships. It is assumed that the relations correspond to separate relations, the primary keys of which are composed of foreign keys participating in the M: N relations.

Let there be a relational schema p = {R1, ..., Rn}, the primary keys of any relation, and it is assumed that the functional types of links are represented by foreign keys, and the type M: N by a separate relationship.

Then the transition procedure can look like this.

1. Using primary keys to identify all relationships links and obtain a set of relations a.

2. For any relation Ri in p - α:

a) form the type of connection N1 with the key corresponding to the primary key Ri, the relationship name becomes the name of the record type, the relationship attributes are data elements in the record type;

b) for any subset of attributes (except for the primary key in Ri), if this subset is a primary key belonging to p-α in Ri (the subset is a foreign key), add a Lij link between the types of the Ni record corresponding to Ri, and Nj, corresponding to Rj, where the foreign key is the primary key.

In this case, K becomes the type of the member entry, and N is the owner record. Delete the attributes corresponding to the key Rj from Nj.

3. Assign Lij connections a unique name and establish a membership type for communication:

a) generate the type of record Ni in the same way as in point 2a;

b) add one link between the type of record N. corresponding to Ri, and any of the n other types of records involved in the connection, as determined by the foreign key in Ri; Ni is the general type of the member record, and the records of n are owner records in the added links (usually n = 2).

From Table. 11.6 it follows that the conversion is not possible for all modes of the network database.

B. In this case, there is a one-to-one conversion, so consider only mapping the network MD to a relational one.

For a non-linear table structure (see Chapter 6), each table in the table can be considered in the relational database as an independent subordinate table. For such pairs occurrences (main - a subordinate table) it is possible to use the techniques described earlier for a linear table structure in the network data model.

If you repeatedly enter tables in works [14, 15] it is suggested to use the concept of "selector path (" occurrences of ")". In this case, the conversion can have several options.

Converting a relational data model to an object-relational model is not of independent interest.

A relational data model is used for the hybrid version of the ORDB. Converting to an extended relational model is equivalent to a transition to an object-oriented data model.

Converting a relational MD into an object-oriented MD is characterized by a multivariance, since the same problem can be solved using homogeneous or heterogeneous data structures (see Chapter 9). Even using only heterogeneous structures, different variants are possible (ROW, ROW TYPE, their combinations).

Converting an object-oriented data model to a relational one is similar to a transition from a network MD (with a non-linear table structure) to a relational data model. Here, in fact, it is still convenient to use the concept of the "selector path".

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)