How to create relational databases

How to create relational databases

Relational approach in creation of databases means work with a tabular data model, that is with a usual way of representation. It is implemented by means of management systems of databases.

Entity of relational structure and data preparation



Each database represents the organized and structured information placed in one or several tables. Tables are the view of data natural and familiar to all consisting of lines and columns. Relational approach means a certain communication of such tables among themselves. Communications or the relations allow to integrate, extract data of several tables in one request at once.


To create the relational database, it is necessary to create, first of all, set of tables and the relations between them. At the same time it is necessary to conform to the following rules. First, each table should consist of the same lines and have a unique name. Secondly, lines of the table should consist of the fixed number of fields and values (it is impossible to include multiple columns and the repeating groups). Thirdly, lines should differ at least in one value (field) from each other for an opportunity to identify any line. Fourthly, columns should have unambiguous names and be filled with homogeneous values of data, the unique method of representation is the explicit value of data (any special cross-table relationships cannot be).

 

You can process data from several tables at once, integrating the selected fragments in the temporary table. The most widespread operations are selection, a projection, natural connection, association, intersection and a difference. When forming tables one of the basic concepts is the primary key - it is the identifier which is unambiguously sending to any entity. For example, in the table of dishes number of a dish can be a primary key. For all tables with data it is necessary to create similar keys, having connected them by the relations.

Implementation by means of DBMS



Database management systems (Oracle, MySQL, SQLite, etc.) provide full-fledged management of the created data and allow to make queries. Having selected one of DBMS, you should transfer the created tables to the program according to its syntax. It is volume work which needs to be executed attentively, without missing important attributes.

At the heart of further work with requests and data processing the SQL programming language lies. In this language tables are created, records are added, removed and change, data sampling from one or several tables is made, the structure changes.

Author: «MirrorInfo» Dream Team


Print