How to set up smartphones and PCs. Informational portal
  • home
  • Windows 10
  • The data schema is used for. Building a data schema in Microsoft Access

The data schema is used for. Building a data schema in Microsoft Access

The structure of a relational database in Access is defined by a data schema that has a hierarchical structure called the canonical relational domain model.

The data schema is graphically displayed in a separate window, in which tables are represented by lists of fields, and links are represented by lines between fields of different tables.

When building a data schema, Access automatically determines the type of relationship between tables based on the selected field. If the field you want to link to is a unique key in both the master table and the subordinate table, Access sets up a one-to-one relationship. If a link field is a unique key in a master table, but is not a key in the subordinate table or is part of a composite key, Access establishes a one-to-many relationship from the main table to the subordinate table.

In addition to the specified types of links, Access also provides links - joins that ensure that table records are combined not by a key field, but in the following cases:

- the linked records in both tables are the same (links are set by default);

- for all records of the first table, for which there are no links with the second table, links are established with an empty record of the second table;

- for all records of the second table, for which there are no links with the first table, links are established with an empty record of the first table.

When creating a data schema, the user includes tables in it and establishes relationships between them. Moreover, for one-to-one and one-to-many type relationships, you can set a parameter that ensures data integrity, as well as automatic cascading update or deletion of related records. Ensuring data integrity means that the following conditions for updating the database are met for related tables:

- an entry for which the link key does not exist in the main table cannot be added to the subordinate table;

- in the main table, you cannot delete a record if the associated records in the subordinate table have not been deleted;

- a change in the values ​​of the link key of the main table should lead to a change in the corresponding values ​​in the records of the subordinate table,

If the user violates these conditions in operations to update or delete data in linked tables, Access displays a corresponding message and does not allow the operation to be performed. Access automatically tracks data integrity when tables in the data schema are linked to integrity settings. When incorrect data is entered into linked tables, a corresponding message is displayed, Access does not allow creating links with integrity parameters in the data schema if the data previously entered into the tables does not meet the integrity requirements. Note that establishing one-to-one or one-to-many relationships between two tables and setting data integrity parameters is possible only under the following conditions:

- the associated fields have the same data type, and the names of the fields can be different;

- both tables are saved in one Access database;

- the main table is linked to the subordinate table by the primary simple or composite key (unique index) of the main table.

If integrity is maintained for the selected link, you can set the cascading update and delete modes for linked records.

In the cascading mode of updating related records, when the value in the link field of the master table changes, Access will automatically change the values ​​in the corresponding field in the subrecords.

Expanding one level of the hierarchy displays the related subordinate records next to the master table record. For the record of the subordinate table, related records can also be opened, etc. For example, for tables BUYER, CONTRACT (Fig. 1.2), linked by a 1: M relationship, for each record of the BUYER table can be displayed and edited related records in the AGREEMENT table.

Data schema

In Access, the process of creating a relational database involves creating a data schema. The data schema visually displays the logical structure of the database: tables and relationships between them, and also ensures the use of the relationships established in it when processing data.

For a normalized database based on one-to-many and one-to-one relationships between tables, provisioning parameters can be set in the data schema for the links of such tables by the primary key or the unique index of the main table. coherent integrity.

While maintaining the integrity of related data, a record is not allowed in a subordinate table if there is no associated record in the master table. Accordingly, during the initial loading of the database, as well as adjusting, adding and deleting records, the system allows the operation to be performed only if it does not lead to a violation of integrity.

The relationships defined in the data schema are automatically used to join tables in the development of multi-tabular forms, queries, reports, greatly simplifying the process of their design.

In the data schema, links can be established for any pair of tables that have the same field, allowing these tables to be joined.

Access Objects

An Access database includes the following objects that are stored in a single accdb file:

 tables, queries, data schemas directly related to the database;

 forms, reports, macros and modules called application objects.

Forms and reports are intended for typical data processing processes - viewing, updating, searching according to specified criteria, receiving reports. These application objects are constructed from graphical elements called controls. The main controls are used to display table fields that are sources of object data.

To automate access to objects and their interaction, program code is used. Only with the help of the program code is a full-fledged user application obtained, the functions of which are available through the menu, toolbar

ruments and forms. VBA modules and macros are used to create program code.

Each object and control has its own properties, by defining which, you can customize them. A set of events is associated with each object and control element, which can be processed by macros or VBA event handling procedures that are part of form modules and reports.

Objects are represented in the Navigation Pane of the Access database window. All operations on working with objects of the database itself and applications begin in this window.

Tables are created by the user to store data about one entity - one information object of the domain data model. A table consists of fields (columns) and records (rows). Each field contains one characteristic of the domain information object. The record contains information about one instance of an information object.

An Access database can contain up to 32,768 objects (including forms, reports, and so on). Up to 2048 tables can be opened at the same time.

Queries. Select queries are used to select the desired data from one or more related tables. The result of the query is a virtual table. In the query, you can specify which fields of the source tables should be included in the query table record and how to select the required records. The query table can be used along with other database tables when processing data. A query can be formed using a query designer or a SQL statement. Change requests allow you to update, delete, or add data to tables, and create new tables based on existing ones.

The data schema (Relationships) determines which fields of the table are connected to each other, how the data of these tables will be merged, whether it is necessary to check the coherent integrity when adding and deleting records, changing table keys. Data schemas in the Navigation Pane of the Database Window only appear in Access projects that work with server databases. To display the data schema in Access databases, use the Relationships command located on the ribbon tab Working with databases

data (Database Tools) in the group Relationships (Relationships).

Forms are the primary means of creating a dialog user interface for an application. A form can be created to work with electronic documents stored in database tables. The type of such documents may correspond to the usual paper document for the user. The form is used to develop an interface for managing the application. The event procedures included in the form allow you to control how the data is processed in the application. Such procedures are stored in the form module. Pictures, diagrams, sound fragments, video can be inserted into forms. It is possible to develop forms with a set of tabs, each of which is associated with the performance of a particular application function.

Introduction to Access 2010

Reports are designed to generate output documents of any format based on the database data, containing the results of solving user problems, and print them out. Like forms, reports can include event procedures. The use of graphic objects allows you to supplement the report data with illustrations. Reports provide the ability to analyze data using filtering, aggregation, and presentation of source data in various aspects.

Macros (Macros) are programs consisting of a sequence of macros that are executed on call or when an event occurs in an application object or its control. Macros allow you to automate some actions in a user's application. Macros are created in dialog mode by selecting the required macros and setting the parameters used by them during execution. Access 2010 has an updated Macro Designer. Its new capabilities make it easier to create and edit macros, reduce code errors and create robust applications more efficiently. Access 2010 introduces a new feature, data macros, that let you modify data based on events in source tables. Data macros are used to add logic to data and concentrate it in source tables. In Access Web applications based on databases published to SharePoint, you only need to use macros for programming because VBA code is incompatible with Web publishing.

Modules contain procedures in the Visual Basic for Applications language.

You can create subroutine procedures, function procedures that are developed by the user to implement non-standard functions in the user's application, and procedures for handling events. Using procedures allows you to create a complete application that has its own graphical user interface that allows you to request execution of all application functions, handle all errors and non-standard situations.

In Access, for the convenience of the user, objects in the navigation pane of a database can be combined into custom groups based on functional or other characteristics. Groups contain links to various types of database objects. Groups, in turn, are grouped into categories. With the help of such an organization of database objects, a user application interface can be developed that completely replaces existing pre-existing button forms and provides accessibility only to categories and groups that clearly and clearly represent the functionality of the application.

Pivot tables and pivot charts

A PivotTable is an interactive table that you can use to analyze data, quickly combining large amounts of data and calculating totals (Figure 1.3). Pivot tables make it easy to perform complex data analysis.

Rice. 1.3. Pivot table for analyzing the total amount shipped for any of the goods, for various buyers and contracts,

Rice. 1.4. Pivot chart for analyzing the total quantity shipped for any of the goods, for various buyers and contracts,

for all or some months, quarters, years

The data schema allows you to:

1. Establish links between records in tables.

2. Display them graphically on the monitor screen and / or print.

3. Provide protection against accidental deletion or alteration of associated data.

4. Automatically use these links when building

· Queries to the database;

· Composite (subordinate) forms;

· Reports.

5. Ensure data integrity.

There are three types of links that can be established in Microsoft Access:

· "one to one";

· "One-to-many";

· "undefined".

The latter type of relationship corresponds to a many-to-many relationship.

In a one-to-one relationship, one row in the first table matches only one row in the second. This relationship is used to separate tables that have a large number of fields, or to separate a part of a table that contains important or secret data, access to which is allowed to a limited number of people.

In a one-to-many relationship, each row of the first table ( the main) may match multiple lines in the second ( subordinate), and a row in a subordinate table cannot have more than one corresponding row in the main table. In the main table, the field to be linked must be key unique, and in the subordinate table - any. The one-to-many relationship is the most commonly used one.

A one-to-many relationship occurs when:

The linked field of the subordinate table is non-key

· The linked fields of the subordinate table form a composite key and the number of key fields in it is greater than in the main one.

Link fields of the subordinate table form external key.

Assuming that the table corresponds to the information object of the subject area (SO), we can assume that the database schema is displaying the software semantic model in Microsoft Access... Provided that the tables in the schema are located at the hierarchy levels, the database schema is displaying the canonical form of ILM software in Microsoft Access.

Relationships between tables in Microsoft Access can be established directly when designing queries. In the database schema, not all theoretically possible relationships between tables are established, but only those that are actually used by the database designer when building composite screen forms, as well as to ensure data integrity.

A data schema is required to validate referential integrity, build compound forms, and enter data into linked tables. The data schema allows you to combine individual relational tables obtained at the stage of information analysis from the primary document into a single whole - information display of the original document through the input forms of the Access database management system.

Notes (edit)

1. DBMS Access allows you to include in the data schema not only tables, but also queries. This allows the query results to be displayed as a form on the screen and / or printed.

2. In the data schema, you can establish relationships between tables not only to ensure data integrity, but also to automatically join tables in queries during their design. This is usually not done because the data schema becomes more complicated, and it is very easy to link tables directly in queries.

End of work -

This topic belongs to the section:

Economics and Finance

State educational institution of higher professional .. Department of Informatics ..

If you need additional material on this topic, or you did not find what you were looking for, we recommend using the search in our base of works:

What will we do with the received material:

If this material turned out to be useful for you, you can save it to your page on social networks:

All topics in this section:

Start year commissioned
────────────────────────────&

Start year commissioned
Consumer goods 10,000 pcs. 8500 pcs. –1500 pcs. Consumer goods 21100 pcs. 21100 pcs. 0 pcs.

From the beginning. years shipped

From the beginning. years shipped
Customer: JSC "Passage", St. Petersburg Contract: 21-04 Thermos 15000 pcs. 14500 pcs. 500 pcs.

From the beginning. years shipped
15-04 Thermos 35000 pcs. 35000 pcs. 0 pcs. Meat grinder 40,000 pcs. 35000 pcs. 5000 pcs.

Shipped from the beginning of the year
15-04 TSUM JSC 40,000 pcs. 35000pcs. 5000 pcs. Moscow 21-04 JSC "Passage" 20,000 pcs.

Customer Contract No. TTN No. Date of shipment Amount of shipment
JSC "TSUM" 15-97 162 31.05.04 250,000 rubles Moscow 234 June 28, 2004 RUB 300,000

Accounts entrusted
JSC TSUM 15-04 162 31.05.04 250,000 rubles RUB 200,000 50,000 RUB Moscow 234

Accounts order
15-04 162 31.05.04 RUB 2,500,000 RUB 200,000 50,000 RUB 234 June 28, 2004 RUB 3,000,000 RUB 300,000 0 p.

The order
JSC "TSUM" 15-04 550000 rub. RUB 500,000 50,000 RUB Moscow 16-04 100000 rub. 100,000 RUB

Assignments
100 31.05.04 2,500,000 RUB 110 01.08.04 RUB 500,000

Customer dog no. TTN No. Date Shipped Amount
shipment shipment JSC "TSUM" 15-04 162 31.05.04 1000 pcs. 9000 RUB Moscow 234 28

Shipped paid
JSC “TSUM” 200 31.03. 05 Meat grinder 90000 rub. 72,000 RUB 18,000 RUB Moscow 250 25.04. 05 Thermo

Shipped paid
200 31.03. 04 Meat grinder 90000 rub. 72,000 RUB 18,000 RUB 250 25.04. 04 Thermos 40,000 rub. 32,000 RUB

Shipped paid
JSC "TSUM"

Shipped paid
200 31.03.05 Meat grinder 90000 rub. 72,000 RUB 18,000 RUB 250 25.04.05 Thermos 40,000 rub. 32,000 RUB 80

Month Payment plan Payment fact
January 2124000 p. February 5,600,000 RUB 624,000 RUB March 5624000 p. RUB 5,600,000

Con. months
Warehouse consumer goods Meat grinder RUB 4,000,000 3,600,000 RUB RUB 400,000 Thermos 10,000,000 r. RUB 10,000,000 0 p.

Con. months
Meat grinder RUB 4,000,000 3,600,000 RUB RUB 400,000 Thermos 10,000,000 r. RUB 10,000,000 0 p.

Arm of commodity expert (arm-t)
The department store's merchandising activity is related to the management of commodity circulation. Typical managerial functions of a commodity expert: 1) Maintaining a regulatory and reference base for managing trade activities

Calculation of the order size
Planning of orders of goods is carried out taking into account the maintenance of the required level of stocks of goods in the warehouse. A fixed lower stock limit (order point) is set for each item. E

AWP of the restaurant manager
Typical management functions performed by a restaurant manager: 1) Maintaining a regulatory and reference base for managing a restaurant. 2) Payments to personnel. 3) Analysis is active

List of polyclinic doctors on XX.XX.XX
No. Specialization Personnel number of the doctor Surname First name Patronymic of the doctor Date of admission Cost of visit

Information on issuing numbers to doctors for XX.XX.XX
Doctor's specialization Doctor's name Total rooms according to plan Total rooms issued Number of vacancies

Arm of a doctor
Typical management functions performed by a polyclinic doctor: 1) Patient care. 2) Inquiry mode (determined independently). The complex of tasks "Service

Formulation of the problem
4.2.1. Drawing up a work plan for the creation of information technology applications The creation and implementation of information technology requires the coordination of actions of various

Database definition
Database (DB) is a collection of interrelated data organized on external media by means of a DBMS and used by one or more applications

Database architecture
The architecture of the database is understood as a multi-level description of the subject area. Most of the databases are based on the ANSI / SPARC architecture proposed by the ANSI / SPARC Study grou

Conceptual level
At the conceptual level, the entire content of the database is represented. For example, it may contain data about customers, contracts for the supply of goods, supplied goods, about

Database design stages
The database design process consists of three stages (Fig. 4.2): · conceptual design of the database; · Logical design of the database; Physical

Information-logical model of the subject area
One of the ways to logically design a database is to build an information-logical domain model (ILM software). ILM provides an integrated, tool-independent p

Algorithm for constructing an information-logical model of the subject area
1. Add feature codes to those tables in which they are absent. 2. Determine the essence of the software. 3. Select entities that display reference data in a document into separate relations

Structural connections of IO
The relationship of two IOs reflects an objective and time-stable relationship of entities. Quantitative correspondence of IO instances can be one-to-one (1: 1), one-to-many (1: M), many

The canonical form of ILM PO
The canonical form of ILM is intended for a formalized transition to the logical structure of the database. ILM software is presented in canonical form if the following conditions are met. 1. All IOs describe

Input information
Below is an information diagram of the problem, which shows the documents that are sources of information for its solution. Input documents Problem

Domain Limitations
To identify functional dependencies and build ILM software based on them, it is enough to know only logical constraints. In this example, they are as follows: 1) the finished product is stored

Forms of reference documents
Table 4.7 Directory “FINISHED PRODUCTS” Product code Product name Unit. measurements Standard stock

Determining the type of links
Each of the introduced links is characterized by a group relation of instances of objects of type 1: M (one - to - many). Below is the rationale behind this claim. P

The canonical view of ILM
The rules for representing ILM in canonical form are summarized in p. 4.3.1.7. There is also an example of using an informal way of ordering InOs by hierarchy levels. Although in the considered item

Database organizational form
Distinguish between single and multi-user databases of centralized or distributed storage across network nodes. I host single-user databases

Database structure
The logical structure of the database corresponds to the data structure of the ILM, it is implemented by means of the data structures of the selected software (DBMS, spreadsheets). Database structure before

Database administration
For databases of collective use or stored on a network drive, administration is performed: accounts of groups and users are created, account passwords are determined (Fig. 4.15).

Document system and workflow
In the subject area, all informational messages used in the application are considered as manual or machine filled documents. To enter information of primary documents into the database

Generalized algorithm
The generalized algorithm for processing application data is presented in the form of technological information processing processes (Table 4.17). Table 4.17. Description of the technological process of treatment

Defining a set of Microsoft Access DBMS tables
Microsoft Access DBMS tables are built on the basis of normalized relations obtained in accordance with the algorithm for constructing a software semantic model, i.e. each relationship must correspond

Description of fields
When assigning names to table fields, it is recommended to be guided by the following rules. 1. Assign field names the same with abbreviated names of attributes (or relationship attributes).

Value Description
None The field is not indexed (default). Yes The field is indexed. (Allowed Allowed duplicate matches) Index field values. Yes Index field

Referential integrity
In Microsoft Access, Reference (Target) Relationship and Reference Relationship correspond to Master Table and Subtable. Main table - e

Display properties
When designing screen forms, the following properties are set: · sorting order of records in the form; The nature of the use of the form: change, delete, add records or vvo

Screen design guidelines
1. The form of the form should be as close as possible to the layout of the document from which the initial data of the problem being solved are entered. This means that the form fields must be located in

Inquiries
Queries are the most common software tool that implements various types of computational processing algorithms (selection of records, deletion, correction of values ​​n

Query Design Guidelines
In the course work for each request you should: · justify the type of request (selection, addition, change, etc.); Specify the composition of the fields of the resulting table of the selection request and

Maintaining regulatory and reference information
Maintaining normative and reference information implies: · Initial loading of database tables. · Formation of consolidated standards. Correction of the regulatory reference

End user interface
The end-user interface can be presented using: · Commands as part of the main or context menu. · Toolbars. On-screen form of push-button tee


1.1. The defense of the course work is carried out after the complete completion of the machine part of the course work, drawing up a report on the course work and checking it by the teacher who supervises the

Course design in ms access environment
Tutorial Editor S.А. Kabedeva License LR N 020412 dated 12.02.97 –––––––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––––

Course work
Subject area: Sales department of finished products Task: Checking the security of the shipment plan of a given product pl

General requirements for course work
The defense of the course work is carried out after the complete completion of the machine part of the course work, drawing up a report on the course work and checking it by the teacher who guides the implementation

A relationship between two Access tables allows you to establish rules for how tables communicate. The list of substitutions could be organized without communication. But imagine that you remove the record from the Contacts table that is referenced by some of the records in the List table. In such a situation, there will be descriptions of contacts, the names of people in which are lost. Having a well-organized communication allows you to avoid such troubles.

1. Select a command Tools> Data Schema... A window will open showing a schematic representation of the database links. In fig. 16.11 you can see that the communication line connects the Contact_code fields of the Contacts table and the Contact field of the List table.

Note This link connects key and regular fields. This is a one-to-many relationship, when one record in the Contacts table can correspond to several records in the List table, but not vice versa.

Rice. 16.11. Access data schema

For practice, let's remove the link and then re-create it.

2. Click to highlight the communication line.

3. Press the Delete key. When prompted, click Yes. The connection will disappear.

4. Move the mouse pointer over the Contact_Code entry in the Contacts table.

5. Click and drag the pointer to the Contact field of the List table.

6. In the dialog box that opens, click the button Create... The connection will reappear. Follow the steps below to configure communication settings.

7. Double click on the link. The dialog box shown in Fig. 16.12.

Rice. 16.12. Communication parameters

Note If there are no tables you want to link between, click in the window Data schema right click and select command Add table... In the dialog box that opens, select the tables that you want to place in the Data Schema window and click the button Add... Having received all the necessary tables, close the dialog window with the button Close.

8. Check the box Ensuring data integrity... This mode will prevent Access from leaving records in the List table for which you cannot match a Contacts table record with a suitable Contact_Code field value.

9. Check the box Cascading deletion of related records... Now, when you delete an entry in the Contacts table (that is, deleting information about a specific person), all corresponding entries in the List table (that is, all descriptions of contacts with this person) will be deleted. If the specified check box is cleared, deleting those records of the Contacts table that are referenced by at least one record of the List table is prohibited.

Note Check box Cascading related fields update will lead to the fact that when updating the Contact_code field of the Contacts table, the fields of the same name in the corresponding records of the List table will be automatically updated.

10. Click the button OK.

11. Close the Data Scheme window.

12. In the database window, double-click the Contacts table icon. In the table window that opens, you can see small "plus" signs located on the left side of the records. Their presence indicates the presence of a link between the key field of the table and another table.

13. Click on the plus sign of the entry for Petr Petrov. A nested table will open containing those records of the List table, the value of the Code_Contacts field of which is equal to the value of the record field of the same name for Petr Petrov (Fig. 16.13).

Rice. 16.13. Fetching data from an Access linked table

Note When you expand a fragment of a linked table, the plus sign turns into a minus sign. Click it again to hide the additional table.

14. Click on any other plus sign and you will see a description of all contacts with another person. Thus, using the created relationship, you can quickly view in the table window a list of descriptions of all contacts with a specific person or group of people.

Tables in the program Access 2007 represent a connected system. Union allows you to process data from multiple tables. For processing, queries are formed - tables in which information from one or several tables is grouped in the desired way, sometimes with the production of the necessary calculations. We'll look at queries in later chapters, but here we'll talk about relationships between tables.

Data schema specifies the structure of the database. It represents and remembers the relationships between tables. These relationships are used when constructing queries and reports based on multiple tables. Data schema displays links graphically. Tables in the diagram are presented as rectangles with lists of fields. If there are too many fields and they do not fit into the rectangle, then automatically on the right side of the rectangle is formed scroll bar , with which you can view the entire list. Data schema used in our work is shown in Fig. 6.10.

Rice. 2.11 Types of relationships between tables: a) one to one, b) one-to-many and v) many-to-many

Ties in Access 2007 there are three types: a) one to one, b) one-to-many and v) many-to-many, as shown in Fig. 2.11. The first type of connection shows that one record in Table1 matches the same entry in Table2 ... This method of communication is used, for example, for two tables made from one, so that the tables are not too cumbersome. Then Table 2 - just a sequel Tables1 ... One-to-many relationships are the most common. For example, many teachers work in one department. Therefore, between tables Chairs and Teachers just such a connection is established.

Rice. 2.12 Tab Working with databases

Link type many-to-many in a programme Access 2007 not directly implemented. To create such a link, an intermediate table must be inserted. For example, our database (Fig. 6.10) provides an intermediate table Ordered since between tables Clients and Products there is a connection many-to-many ... table Ordered allows you to avoid such a connection, which in Access 2007 not directly feasible.

The technique of establishing a relationship between tables involves three steps: 1) call Data schemas - the window in which the diagram will be displayed, 2) addition into the schematic window of those tables between which you need to establish links and 3) broaching connections between tables with giving them the necessary properties. Let's consider these steps in detail.

Rice. 2.13 Dialog Box Adding a table

Data schema can be called when the required tables have already been created. To call it, click on the button Data schema on the ribbon tab Working with databases (fig. 2.12). A window will appear Data schema , while empty, and the dialog Adding a table , which can be seen in Fig. 2.13. Using a window Adding a table out the window Data schema place the required tables.

Rice. 2.14 Right-click context menu inside a window Data schema

If for some reason the window Adding a table did not appear, then you need to right-click anywhere in the window Data schema ... A context menu will appear (Fig. 2.14). In it you need to click on the inscription Add table ... A dialog box will appear Adding a table , which can be seen in Fig. 2.13.

With a dialog box popping up Adding a table can be moved inside the window Data schema the tables you want. We will restrict ourselves to two tables: Chairs and Teachers ... The names of these tables must be highlighted, as shown in Fig. 2.13, and then immediately click on the button Add... The same is done with other tables that need to be placed in Data schema ... Window Adding a table after adding the required tables, close. In our example, the rectangles denoting both the tables we need will appear in Data schema , as can be seen in Fig. 2.15.

Table designations inside the window Data schema contain a list of all the fields of this table, and to the left of the name of the key field (or key, if there are several of them) there is a key icon. Table designations can be moved with the mouse by grasping the table title. You can also change the size of the rectangles that represent the tables. To do this, move the mouse pointer to one of the borders of the rectangle. A double-headed arrow appears:. By grabbing such an arrow with the mouse, you can move the border of the rectangle to any place, thereby changing its size.

Rice. 2.15 Completed Data schema with link between tables

When table label rectangles are placed inside a window Data schemas , you can start establishing relationships between the tables. Link fields of the same name. In one of the tables, a key field is usually used for communication. The table with the key link field is considered the main one. From her side, the connection is indicated 1 ... From the side of the linked table, the link is indicated by ¥ ... This is how the connection is established One-to-many .

Rice. 2.16 Dialog Box Changing links

The technique of joining tables with links is simple: you need to click the joining field of the main table. It will stand out. Without releasing the mouse button, you need to draw a line to the field of the auxiliary table with the same name. The connection will not happen at first, but a dialog box will appear Changing links (fig. 2.16). The window helps to validate the nature of the relationship and to configure the data integrity of both tables. In the window, you need to make sure that the connection has occurred on the fields of the same name, and then click on the inscription box ... A checkbox will appear in the window: ü. After that, you need to set the same checkboxes in two more windows below. Thus, the properties of the link are set. Property Ensuring data integrity means that you cannot delete data from the key field of the main table. And the properties Cascading related fields update and Cascading deletion of related records - accordingly, that the operations of editing and deleting data in the key field of the main table are allowed, but accompanied by automatic changes in the related table. The creation of a link is completed by clicking on the button [Create]... The required connection will appear (Fig. 2.15).

It is worth noting that if it is impossible to carry out a connection with ensuring the integrity of the data, for example, if a connection is made between fields with different information, the window shown in Fig. 2.17.

Rice. 2.17 Window with a warning about the impossibility of creating a connection


Top related articles