the Internet Windows Android

Theories of relational databases. List of used literature

Briefly about important.

Normalization of database

First normal form (1NF)

  • there are no repetitive data groups
  • guaranteed elementality (atomicity) data (all data are autonomous and independent).

On the upper level This is achieved by creating a primary key, then the transfer of duplicate data groups to new tables, creation of primary keys for these tables and so on. In addition, you need to split all the records whose columns contain composite information, on separate lines for each fragment of the column data.

Second normal form (2NF)

  • the table satisfies the conditions 1NF
  • each column depends on the entire key, and not from its part.

Third Normal Form (3 Nov)

  • the table satisfies the conditions 2NF
  • no column depends on a column that is not part of the primary key.
  • does not contain derived data

Other normal forms that do not have special practical value:

Normal form of Boys Codd (Boyce-Codd)

Option 3NF. Designed to solve the situation with the presence of many overlapping candidate keys. In fact, it does not find a logical justification outside the academic community.

Fourth normal form

Designed to address the issue with multi-valued dependencies. Such situations arise if one column of the composite primary key is depends on the table of the 3dnf table depends on the other column of the primary key.

Fifth normal form

It is used when working with a decomposition of relationships with losses and without loss. It occurs in a situation where you can smash one attitude into several different relationships, but after that we will no longer be able to logically return it to the original form.

Sixth normal form (normal domain key form)

Guarantees the lack of anomalies of modification in the database. In real conditions, it is practically not achievable.

Relations.

Once I heard from women that men
Immediately try to leave the room in which
The word "relationship" sounded.<...> The key to success
relationship is awareness of everyone about his role
in this respect, as well as on the rules and restrictions,
imposed by this attitude.
(C) Robert Viera, "Professional SQL Server 2000 Programming "

Types of relationships

  • One-to-one (it makes meaning when in different bases it is necessary to store the coinciding data or when there is an exception maximum size Row data)
  • Zero- or one-to-one
  • One-to-many
  • One to -nulya, - one or -My
  • Many-to-many (discover tables)

Association

Inner Join.

Excluding Union (Exclusive Join). Only those tables of tables that have conformity in the pair table on a given condition fall into the result of the sample.

Left | Right Join

Inclusive Join. In the result of the sample, entries from the table, standing on the left / right Join. respectively. At the same time, data from the missing "pair" will be filled NULL.
From Left_Table Left Join Right_Table - All entries from the left table left_table are enabled.
From Left_Table Right Join Right_Table - All entries from the right table Right_Table are enabled.

Full Join.

Inclusive Join. Not only records that meet in another table, but also not found from both tables, are not found for which in accordance with the other table. In this case, the data from the missing "pair" record will be filled with NULL.

Cross Join.

Cross Association (Cartesovo Work). Each entry from one table is made in accordance with each record from another table. The number of resulting records is equal to the number of records in both tables.

Principles of ordering several Join.'OV

In case you need to combine multiple tables, you need to remember two principles:

  1. All unions left Join. Perceived as a single table to turn on or exclude from the query.
  2. All unions are right Join. Also perceived as a single table to enable or exception from the query.

The consequence of these principles is the following recommendation for the formation of complex associations:

  • Wherever you can, use Inner Join.
  • If there is a need to use Outer Join - they need to be placed last, and at the beginning of the union is located inner Join.

P.S. All of the above is the general "postulates" of the theory of relational databases that are not tied to the peculiarities of certain DBMS.

Database (database) is an organized data set. Data organization is usually designed to reflect the real relationship of stored data in such a way as to facilitate the processing of this information.

DBMS - database management systems - this is a specialized software called, expected to manage databases. This is achieved by interaction with the user on the one hand and actually with the database on the other.

DBMS general purpose Must make definition, creation, change, administration and product of requests to the database.

As examples of the DBMS, such widely known packages can be called as

  • Mysql
  • PostgreSQL
  • Microsoft SQL Server
  • Oracle
  • IBM DB2.
  • Microsoft Access.
  • SQLite.

Databases are usually not tolerated between different DBMS, but it is possible to interact between the DBMS (and with the user software) using different standards, such as SQL, ODBC or JDBC.

DBMS are often classified according to the data model supported by them. Since the 1980s, almost all popular DBMS support a relational data model provided by the standard language. sQL queries (Although recent years is gaining popularity of NOSQL).

So, the main tasks performed by the DBMS include

Definition of data schema Creating, changing and removing structures that determine the organization of all other data in the database Changing data Adding, changing and deleting the data themselves. Getting data. Providing information in the form suitable for direct use by other applications. Database administration Registration and management of users, providing data security, maintenance of integrity, recovery of information, management of simultaneous access, performance tracking, etc.

DBMS are widely used in banking, transport companies, educational institutions, Telecommunications, to manage financial information and human resources. Well, you should not forget that most web backends uses one or another DBMS.

One of the main features of the development of the database is the lack of ready-made solutions and algorithms. Each database specifically to the task for which it is designed. This distinguishes the development of the database from the development of typical applications, for which algorithms and design templates have been developed for a long time and do not have to invent anything. Although, of course, the database design techniques are common to all applications.

Models of database

As mentioned earlier, the most widespread model of the data is the relational model. However, the appearance of the relational model was preceded by others, in particular

  • Hierarchical, or navigation model
  • Network model

The hierarchical model was widely used in the DBMS supplied by IBM in the 1960s. The basic idea is that the entry in such a database may have several "subsidiaries" and one "parent". In general, it suspiciously similar to hierarchical file System. To get an entry in such a database, often needed a passage throughout the tree.

The network model is a more flexible version of the same approach. It allows you to have a record several "parents". This model, appearing in the early 1970s, was not widespread, and was soon displaced by the relational model.

In 1970, Edgar Codd (IBM employee) proposed a relational model, which greatly facilitated the task of finding information in the database. You can think about the relational model as "tables" in which the "lines" are entries in the database. Relations in the relational database are also called tuples, and groups of records ("Tables") relations (Relations). The relational model is able to express communication hierarchical and network models, and added its own connections corresponding to the tabular model.

Based on the proposals of the code, by the mid-1970s, the System R DBMS was developed, and by the end it appeared support for the standardized SQL query language.

In 1980, with the adoption of object-oriented programming, it was increasingly difficult to broadcast objects on the relational model. In the end, this led to the emergence of NOSQL and NewsQL approaches that this moment Just develop. Examples of the NOSQL approach can be so-called. Document-oriented databases built on the basis of XML. The main advantage of NOSQL is high horizontal scalability, i.e. Ability to increase productivity by adding servers. With advent cloud technology, Nosql became especially in demand.

Nevertheless, the relational model remains the most common, so let us dwell on it in more detail.

Relational model

The relational model operates with the concepts of records, attributes and relationships. The ratio can be imagined in the form of a two-dimensional table, then attributes are the table columns (more precisely, the names of the columns), and the records are the table lines.

The relational model requires strict determination of the data structure stored in the database, that is, the relationships and attributes for this database are fixed.

We introduce some definitions.

The domain is a set containing a complete set of all possible values \u200b\u200bof some variable. Domains are often also called data type. Attribute ordered para attribute names and domain \\ (d_j \\). The consignment is the final ordered set \\ ((d_1, d_2, \\ ldots, d_n) \\) Title (diagram) Relationship ratio \\ ((A_1, A_2, \\ LDOTS, A_N) \\), where \\ (A_J \\) - attributes. Attribute value Specific value belonging to the attribute domain. The body of the relationship is a set of tuples, where \\ (d ^ i_j \\ in d_j \\), \\ (d_j \\) - domains. Record consignment \\ ((d ^ i_1, d ^ i_2, \\ ldots, d ^ i_n) \\) with fixed \\ (i \\). The ratio of the collection of the title of the relationship and body relationship. Database diagram Multiple schemes of all relations included in the database.

You can submit a relationship in the form of a table. Then the body of the relationship is the body of the table, the title of the relationship - the title of the table, attributes - the names of the columns, records - strings, and the attribute values \u200b\u200bare in the cells:

\\ (A_1 \\) \\ (A_2 \\) \\ (\\ ldots \\) \\ (A_N \\) ← Headline
\\ (D ^ 1_1 \\) \\ (D ^ 1_2 \\) \\ (\\ ldots \\) \\ (D ^ 1_n \\) ← record
\\ (D ^ 2_1 \\) \\ (D ^ 2_2 \\) \\ (\\ ldots \\) \\ (D ^ 2_n \\) ← record
\\ (\\ ldots \\) \\ (\\ ldots \\) \\ (\\ ldots \\) \\ (\\ ldots \\) ← record
\\ (D ^ M_1 \\) \\ (D ^ M_2 \\) \\ (\\ ldots \\) \\ (D ^ M_N \\) ← record

The relational model imposes the following additional relationship requirements:

It is clear that the attributes (more precisely, their values) are somehow depending on each other - otherwise the relation is simply an unstructured dataset. Concept is used to determine dependencies between attributes functional dependency.

The functional dependence of the set of attributes \\ (B \\) is functionally dependent on the set of attributes \\ (A \\) (written \\ (A \\ Rightarrow B \\)), if for any two entries that have the same values \u200b\u200b\\ (a \\), their values \u200b\u200b\\ ( B \\) coincide. Otherwise, each value \\ (a \\) corresponds to the only value of \\ (B \\) (not necessarily unique, exactly the only).

In other words, if a certain set of attributes \\ (a \\) uniquely determines (within the framework of this ratio) the values \u200b\u200bof the attributes \\ (B \\), then \\ (B \\) is functionally dependent on \\ (a \\).

As a more familiar example of functional dependence, you can cite a mathematical definition of a function. For a function, each argument value corresponds to the only value of the function. Inversely incorrectly, for example, for the function \\ (y \u003d sin (x) \\), any value \\ (y \\) from the definition area \\ (1 \\ geq y \\ geq -1 \\) corresponds to an infinite set of values \u200b\u200b\\ (X \\ \\ (x \\ to y \\). Note that the concept of functional dependence is also applicable to the functions of many variables. For them, the value of the function is functionally dependent on all arguments at the same time. For example, for the function \\ (z \u003d f (x, y) \\), the FZ \\ ((x, y) \\ to z \\) is performed, or abbreviated, \\ (xy \\ to z \\).

Relationships in this context can be considered as some table or discrete functions.

Work with FZ.

There are certain formal rules for working with the FZ relationship.

Formal rules are closely related to the concepts closure and irreducible FZ..

Axioms Armstrong.

There are rules for the withdrawal of new FZ from existing, called axioms Armstrong..

Axioms Armstrong.

  1. Reflexivity rule: if \\ (b \\ substing a \\), then \\ (a \\ rightarrow b \\)
  2. Add-on Rule: If \\ (A \\ Rightarrow B \\), then \\ (AC \\ RIGHTARROW BC \\)
  3. Transitivity rule: if \\ (a \\ rightarrow b \\) and \\ (b \\ rightarrow c \\), then \\ (a \\ rightarrow C \\)

Of these axes, the following additional rules can also be displayed:

  1. Self-determination rule: \\ (a \\ rightarrow a \\)
  2. Decomposition rule: If \\ (A \\ Rightarrow BC \\), then \\ (a \\ rightarrow b \\) and \\ (a \\ rightarrow c \\)
  3. Combination Rule: If \\ (A \\ Rightarrow B \\) and \\ (A \\ Rightarrow C \\), then \\ (A \\ Rightarrow BC \\)
  4. Compositional rule: if \\ (a \\ rightarrow b \\) and \\ (C \\ Rightarrow D \\), then \\ (ac \\ rightarrow BD \\)

It can be seen that, due to the rule of reflectivity, any set of attributes \\ (a \\) implies the FZ of the form \\ (a \\ to a \\). Such FZ, as well as the following of them, do not represent interest, and are called trivial.

Trivial funkonal dependence of FZ \\ (a \\ to b \\), such that \\ (b \\ subset a \\).

In principle, these rules are sufficient to find all the FZ, the following from the data. In this regard, the concept of closing the set of FZ is introduced.

The closure of the set FZ by the closure of the set of FZ is called such a plurality of FZ, which includes all FZ source set, as well as all implied by them. In other words, for the relationship \\ (R \\), which has functional dependencies \\ (S \\), the closure \\ (S ^ + \\) is called the set of all FZ, possible for \\ (R \\), based on \\ (S \\).

As a rule, it is required to establish whether there will be a certain FZ \\ (X \\ Rightarrow Y \\) follow from this set FZ \\ (S \\). It turns out that it is possible then and only if the set of attributes \\ (Y \\) is a subset of the attribute closure \\ (x ^ + \\) in \\ (S \\).

Circuit attributes of the closure \\ (x ^ + \\) attributes \\ (x \\) along the set of FZ \\ (S \\) is the set of all attributes that are functionally dependent on any subset \\ (x \\).

To calculate the closure of a plurality of attributes \\ (x ^ + \\) along the set of FZ \\ (S \\), there exists the following rule: for each FZ \\ (A \\ Rightarrow B \\) in \\ (S \\), if \\ (a \\ subset x ^ + \\), then \\ (b \\ subset x ^ + \\), and it is sufficient to start with the assumption that \\ (x ^ + \u003d x \\).

It should be noted that for any closure \\ (x ^ + \\), there are FZ of the form \\ (x \\ to b \\), where \\ (b \\ subset x ^ + \\), thus, the closures of all attributes of the relationship according to its FZ describe Circuit of the FZ of this relationship.

This rule is used to calculate the irreducible set of FZ equivalent to this (in the sense of the equivalence of their closures). Reducing the amount of FZ while maintaining the closure (and, consequently, the internal logic described by the FZ is an important step in the design of the database.

The set of FZ is called irreducible if:

  1. The right side of each FZ contains only one element.
  2. No attribute of any left part of the FZ set can be removed without changing the closure
  3. No FZ sets can be removed without changing the closure.

For any multitude of FZ, there is at least one equivalent irreducible set. Such a lot is called minimal coating.

Information Systems Lifecycle

Analysis of the situation (the complexity of IP development, not effective use of IP), conducted by scientists, showed that this provision was caused by the fact that software Not respected by very important requirements:

· Lack of full specification of all requirements;

· The absence of an acceptable methodology (system of methods) of IP development;

· Lack of sharing a common global project into separate components that can be effective control and management.

The life cycle (LCC) of information systems is a structural approach to software development.

(Some Scheme) for 09/26/12

1. Planning the development of IP. Preparatory actions that allow with maximum efficiency to implement the stages of the IP LCC. Three main components: assessment of the scope of work; assessment of the necessary resources; Assessment of the total cost of the project.

2. Determination of system requirements. Determining the range of actions and borders of the database application, functions, the composition of its users and applications.

3. Collection and analysis of user requirements. Collection and analysis of information about the part of the organization whose work will be supported by using the created IP, the definition of user requirements for the system. Sources: Poll and survey; observation; Study of documents; Previous experience.

4. Designing a database. Creating a database project. Two main approaches to the design of database systems: " downward"And" ascending».

5. Selection of target DBMS. Selection of a suitable type DBMS intended for support applications created Database.

6. Development of applications. Designing the user interface and application programs designed to work with the database.

7. Creating a prototype. Creating a working model of database application.

8. Implementation. Physical implementation of the database and developed applications.

9. Conversion and data loading. Transfer of existing data in new base data, download and modification of existing applications for the purpose of organization collaboration with a new database.



10. Testing. The process of executing applications to search for errors. Test Strategies: Downward Testing; ascending testing; Testing streams; Intensive testing.

11. Operation and maintenance. Monitoring the system and support for its normal functioning: performance control; Accompanying and upgrading applications.

Relational database theory

Terminology

In 1970, the relational model was first proposed by E.F. Code.

The relational DBMS assumes that the user perceives the database as a set of tables (and not as otherwise).

Mathematical relations.

The theory of relational database is based on the mathematical theory of relations.

Let D1, D2, ... DN some sets.

Cartesian work d1 d2 ... dn \u003d ((x1, x2, ..., xn) | x1 d1, x2 d2, ... xn dn)

The ratio is a subset R D1 * D2 * ... * DN

For example, n \u003d 2, d1 \u003d (2,4) and d2 \u003d (1,3,5), d1 * d2 \u003d ((2,1), (2,3), (2.5), (4, 1), (4,3), (4.5)), R \u003d ((2,1), (4,1))

Subset of m. B. The condition is given, for example:

R \u003d (((x1, x2) | x1 d1, x2 d2, x2 \u003d 1), a1, a2, ... an - attribute names with D1, D2 domains, ... VTB then we will write the relation in the form:

R (A1: D1, A2: D2, ... AN: DN)

Properties of relations:

· The attitude has a unique name;

· Each attribute has a unique name (in relation to);

· Each cell of the relationship contains only atomic value and no repetitive groups (the ratio is normalized);

D1 - Students
D2 - Disciplines: Mathematics, Computer Science

· The order of attributes does not matter;

· The order of the tuples arbitrary;

· Each consignment is unique.

Relational keys

Relational keys are served to uniquely identify the tie description tie between relations.

Relational integrity.

Relational algebra

The result of the operation can be used as an operand for another operation, which allows you to create nested expressions (closedness of the RA).

The relational algebra is a language in which all the cortices are processed by one command.

Five main operations:

· Selection,

· Projection,

· Cartesian work,

· An association,

· Difference.

Based on these operations, others can be obtained:

· Compounds

· Crossing,

· Dending.

In the predicate, the signs of logical operations ^ (and), V (OR), ~ (not) can be used.

Example. Get a list of all employees with salary over 300.

Projection.

Determines the attitude, the attributes of which are APP1, ..., APR and contains only unique tales.

Cartesian work

Cartesian work is rarely used, the result apply the sample.

An association

Difference

Connection operations.

Teta connection

Natural connection

External connection

Then at the left external compound All initial information is maintained from R ratio. Similarly, it is also possible to determine the right external connection.

Alpination

Alumni operation can be determined using projection and compound operators.

Crossing

Representation

Appointments:

· Provides a flexible database protection mechanism due to the concealment of some part of it from specific users;

· Allows you to organize user access to the data most convenient for them;

· Allows you to simplify complex operations with basic relations.

Rules that should satisfy
Relational DBMS

To determine whether the SUBO relational code (1985) proposed 13 rules to which they should satisfy.

Rule
Fundamental rule. Relational DBMS must be able to control databases solely with the help of its relational functions.
Presentation of information. All information in the relational database is explicitly based on a logical level only in one way - in the form of values \u200b\u200bin the tables. Including metadata.
Guaranteed access. For each element of the relational database, logical access based on the table name combination, the values \u200b\u200bof the primary key and the column name must be guaranteed.
Support uncertain values. DBMS supports uncertain values \u200b\u200b(NULL).
Relational system directory. The database description should be in a logical level in such a way as the usual data, which allows users to use the same relational language to appeal to them.
Exhaustive data ply. Relational DBMS can support several languages. However, one language should exist at an extreme measure, the operators of which would allow the following functions: 1. Data definition; 2. Definition of representations; 3. Commands manipulation data; 4. Limitations of integrity; 5. User authorization; 6. Organizations of transactions
High-level extraction, insert, delete, updates. The ability of the DBMS to perform operations for extracting these insertion commands, delete and update as a single operation.
Physical independence from data. From the storage method
Logical independence from data. Independence of applications from changing the basic tables.
Independence of integrity restrictions. Integrity restrictions should be determined on the attitude of relational data and stored in the system directory, and not in application programs.
Independence from data distribution.
Rule prohibiting bypass tract. If the DBMS has a low-level language (with a consistent line-to-line processing), it should not allow the rules and limitations of the integrity described in the high-level relational language.

Modeling data based on the normalization process

The goal of normalization.

The normalization process was proposed in 1972 by E. F. Codd - three normal forms (NF): the first (1NF), the second (2NF) and the third (3 Nov).

More severe definition of the third NF (R. Bois and E. F. Codd, 1974) is a normal form of Boys Codd (NFBC).

Data redundancy and processing anomalies.

The absence of normalization leads:

· Data redundancy

· Insertion anomalies (it is impossible to add records)

· Removal anomalies (other information is lost when deleting information)

· Update anomalies (update many records are required)

· Preservation properties without loss and preservation of addiction.

Functional dependencies

Database - a set of related data organized by certain rules involving general principles Descriptions, storage and manipulation, independent of application programs. The relational database is a database in which information is presented in the form of two-dimensional tables stored in files. The table consists of lines called entries, records consist of columns, called fields.

The database management system (DBMS) is a totality of language and softwareintended for creating, keeping and sharing BD by many users. DBMS users can be divided into three large groups:

  • database developers are responsible for writing applications using a database;
  • end users operate with a database or through some information system, or a user interface of the database management system;
  • database administrators ensure the maintenance of database performance, data security and security, database operation.

The base architecture of the DBMS is a three-tier model, within which the DBMS seems to consist of an external, conceptual and internal level. At the external level, the contents of the DBMS seems to see it sees separate user. At the conceptual level, the DBMS data is described in the generalized model of the subject area for which it is created information system. Internal level is the actual data located in files. The DBMS is also conducted a data dictionary containing information about everything that is stored in the database (the names of all tables and representations, stored procedures and triggers, accounts users of DBMS, etc.). This kind of information is made called metadata.

The relational data model is based on mathematical principles of the theory of sets and mathematical logic. These principles were first used to model data in the 60s of the last century Codd. The relational model determines how the data may be presented (data structure), how the data can be protected from incorrect changes (data integrity) and which operations can be performed with data (data transactions). The basic concepts of the relational model:

  • all data are conceptually represented as an ordered set of rows and columns, called the ratio;
  • all data are scalar;
  • the data line is called a tuple, the number of tuples is called a fundamental number;
  • each column in the tavern is called an attribute, the number of attributes is called the degree of relationship;
  • no information is described by NULL;
  • the potential key K for R ratio is a subset of a set of attributes R, always having a property of uniqueness (that is, there are no two tuples in relation to R with same value K) and non-redundancy property (i.e. no of the subsets of K does not have the property of uniqueness). The potential key consisting of more than one attribute is called compound, and from one-simple. The primary key is a potential key in which the cortices are physically ordered.
  • the external key is defined as follows. Let R2 be some attitude. Then the external key FK with respect to R2 is a subset of a set of attributes R2 that there is a ratio R1 with a potential key K, and the value of Fk in any r2 r2 always coincides with the value of k some cortery in R1. The restriction by which the external key values \u200b\u200bmust be adequate to the values \u200b\u200bof the corresponding potential key, are called reference limit. Accordingly, under reference integrity, it is understood that the requirement that in the database there were no disorders of reference limitations.

The following operations are permissible on the data in the relational model:

  • the sample returns the relation containing all the cortices of a given ratio that satisfy certain conditions;
  • the projection returns the relation containing all the cortices of the specified relationship after the exclusion of some attributes from it;
  • the product returns the relationship containing tuples, which are all possible combinations of tuples belonging to two source relations;
  • the association returns the relation containing all the tales belonging to two source relations;
  • the compound returns the relationship, which is the connection of two tuples belonging to the source relationship and having a general value for one or more attributes of the source relationship; In this case, the total value of attributes is found in the constructing tuple only once.

Programming in the Delphi 6 medium

Database. Creating a report S. using Word..

Approved by the Editorial Publishing Council

university as a laboratory workshop

Voronezh 2004.


UDC 681.3.

Vorobyov E.I., Korotkhevich DE .. Programming in wednesday Delphi 6: Laboratory Workshop: Ch. 2: Databases. Creating a report using Word. Threads. Voronezh: Voronezh. State tehn University, 2004. 107 p.

In the second part of the laboratory workshop, theoretical and practical information are considered to write programs in the Delphi 6 environment on the topic: "Database design, creating reports in word program And the use of streams when creating high-performance applications. "

The publication complies with the requirements of the State Educational Standard of Higher Professional Education in the direction of 230100 "Informatics and Computing Technique", specialty 230104 "Automated Design Systems", discipline "Programming in high-level languages".

Table. 3. Il. 19. Bibliogr.: 7 Named.

Scientific Editor: Dr. Tehn. Sciences, prof. Ya.E. Lvovich

Reviewers: Department computer equipment Voronezh Forestry Academy (head. Department of Dr. Tekhn. Sciences, prof. V.E. Mezhov);

dr. tech. Sciences, prof. O.Yu.Makarov

© Vorobyov E.I., Korotkhevich D.E., 2004

© design. Voronezh State

technical University, 2004


Introduction

Database concept

Databases are considered the main advantage of Delphi. Even specialized languages \u200b\u200bfor working with databases (such as MS Visual Foxpro.) Obviously inferior on the simplicity and relics of programming this type of applications. Delphi hides all the difficulties and at the same time gives the greatest power. There was no such task that would not be able to implement on Delphi in a short period of time. And most importantly, that all this is implemented very convenient and easy to understand. In Delphi you can create simple applicationsEven with complex bases, without a single line of code. In this tutorial Laboratory tasks are considered to master the techniques for working with local databases.

Theory of relational databases

Ten years ago, the programming of databases was a very difficult occupation. Now it is already difficult to imagine that, because thanks to Delphi, the process of writing programs has been simplified, and the number of database varieties is already amounting to dozens.

Databases are divided into local (installed on the client's computer, where the program is also working there) and remote (installed on the server, remote computer). Server base Data is located on a remote computer and operate running server software. To their main advantages, you can attribute the ability to work with one database at the same time multiple users, and at the same time the minimum load on the network is carried out. There are still network databases that create too much load on the network and uncomfortable in both the programmer and the end user. When the program joins the network database, it pumps the almost complete copy from the server. If you have made changes, your copy is completely pumped back. It is very uncomfortable because it is created. huge pressure On the network due to excess data pumping. When client-server technology, the Client program sends a simple text request to the server to receive any data. The server processes it and returns only the required data portion. When you need to change any data again, a request to the server is sent to the server to change, and the server changes data in its database. Thus, over the network, there are only text requests over the network, which mainly occupy less kilobyte. All data processes the server, which means that the client machine is loaded much less and not so much demanding to resources. The server sends only the most necessary data to the client, which means there is no unnecessary pumping of copies of the entire base. Thanks to all this, network databases are already outdated and practically not used. They almost completely displaces the technology client-server. But local databases will always live. There may be a storage format or add some new features, but the databases themselves will exist. For further consideration, we need to define a new concept - table. So far, only general principles said, so the general concept was used databases. The database table is like a two-dimensional array in which the data in the column is built (a bright example of the table - Excel). Database - Roughly speaking, it is just a file in which it can be stored from one to several tables. Most local databases can only store one table (DBASE, PARADOX, XML). But there are representatives of local databases, where several tables are concluded in one file (for example Access).

Local databases

From local databases, we consider the relational as the most common. What is a relational database? This is a table in which the names of the data stored in it are as columns, and each line stores the data themselves. The database table is similar to the electronic excel table (To be more accurate, then Excel stores its data in the form own formatbuilt on the basis of database technology). Local database tables can be stored on a local hard disk or centrally saved on network Disk file Server. These files can be copied using standard tools Like any other file, because the database tables themselves are not tied to a specific location. The main thing is that the program can find a table. Each table should be one unique field that will definitely identify the string. This field is called key. These fields are very often used to bind multiple tables among themselves. But even if the table is not connected, the key field is still necessary. It is advisable to use as a key numerical type And if the database allows, it will be better if it is the type "AutoInCrement" (automatically increasing / decreasing number or meter). The names of the columns in the database table should also be unique, but in this case not necessarily numeric. They can be called as you like, if only it was unique and understandable. Each column (database field) must have a defined type. The number of types and their types depend on the type of database, such as DBASE format (files with the DBF extension) support only 6 types, and Paradox is already up to 15. The database can be stored in a single file (Access) or in several (Paradox, dBASE). More precisely, these tables are always stored in one file, but additional information can be located in separate files. As for more information There may be indexes, limitations or list of default values \u200b\u200bfor specific fields. If at least one of the files are spoiled or deleted, then the data can be inaccessible to edit.

What indexes? Very often, the data from the tables are subjected to some changes, so before you edit over any string, you need to find it. Even static tables used as directories are also subjected to search operations before the output of the requested data. The search is quite time-consuming operation, especially if the table contains a lot of rows. Indices are aimed at accelerating this procedure, as well as can be used as a starting point when sorting. At this stage, it is enough to know that the non-indexed field is impossible to streamline.

If necessary, so that some table is ordered by field " Surname"This field must be subsected first. Then you only need to specify that the table must work now with such an index, and it is automatically sorted.

In a well-designed database, data redundancy is excluded, and the likelihood of contradictory data is minimized. Thus, the creation of databases has two main objectives: to reduce data redundancy and increase their reliability.

The life cycle of any software product, including the database management system, is (large) from the stages of design, sales and operation.

Naturally, the most significant factor in life cycle Applications working with the database is the design stage. From how carefully the structure of the base is thought out how clearly the links between its elements are determined, the performance of the system and its informational saturation, and therefore the time of its life depends.

Database requirements

So, a well-designed database:

1. Satisfies all user requirements for the contents of the database. Before designing a base, it is necessary to carry out extensive studies of user requirements for the functioning of the database.

2. Guarantees consistency and integrity of data. When designing tables, you need to define their attributes and some rules that limit the possibility of entering the user incorrect values. To verify the data before directing them to the table, the database should be called the data model rules and thereby ensure the preservation of the integrity of the information.

3. Provides natural, easy to perceive structuring of information. Qualitative construction of the base allows you to make requests to the database more "transparent" and easy for understanding; Therefore, the likelihood of making incorrect data is reduced and the quality of base support is improved.

4. Satisfies users' requirements for database performance. With large amounts of information, product conservation issues

start playing a major role, immediately "highlighting" all the shortcomings of the design stage.

The following items represent the main database design steps:

1. Determine the database information needs.

2. Analyze the real world objects that need to be modeled in the database. To form the essence and characteristics of these entities from these objects (for example, for the entity "part" characteristics may be "name", "color", "weight", etc.) and form their list.

3. Put in compliance with entities and characteristics - tables and columns (fields) in the notation of your selected DBMS (Paradox, Dbase, FoxPro, Access, Clipper, InterBase, Sybase, Informix, Oracle, etc.).

4. Determine the attributes that are uniquely identifying each object.

5. Develop rules that will establish and maintain data integrity.

6. Install links between objects (tables and columns), to normalize the tables.

7. Plan questions of data reliability and, if necessary, preserve the secrecy of information.


Similar information.