Development of additional databases. Review of programs for creating databases Logical design, prompting and priming of base lines, normalization

Almost every organization has its own database. But already there, there are sites that use them to make it easier and simpler to deal with information. It’s easy, you can work on sorting without any problems, you can quickly find the required data, and then you can simply create order in any information.

Most often, their creations are carried out by programs, and this is a complex process that begins with most initial deposits. Also, without lessons, courses and sets of programs for creating software for developing databases, it is easy to get lost. This article describes the main programs for developing databases.

About SQL

SQL is a general programming tool used for creating databases. Once you install it on your computer and start creating the database, it won’t be very easy. This is due to the fact that SQL itself does not contain any graphical shell, and queries to the database must be done via the command line. For these reasons, various types of programs have emerged to simplify the development of databases. However, it’s still a good idea to learn the basics of this language. Raptom requires any request to work, but the program does not function properly.

Microsoft Access

This program for creating databases definitely knows a lot. It is also available in the Microsoft Office software package. This program is one of the easiest to master, and knowledge of SQL programming is practically not required there. You can even more importantly, what kind of application is written, and the program itself is stored in SQL.

Make sure the programs are up to date. Until now, the data base of the anonymous organization has been created using Microsoft Access. It’s true, the program itself is quite easy, and the interface is intuitive. Moreover, the basics of working in Access can be learned at school and in early college courses!

PhpMyAdmin

Access, of course, is a good program, but if you need a database for the site, it won’t work. Then PhpMyAdmin will come to help. This is a very useful program for creating databases. Installation on a computer takes up to an hour, and during installation it is easy to do it wrong and not work. Therefore, when installing programs for creating databases, you must strictly follow the instructions. Another plus of PhpMyAdmin is that you can access it via the Internet from the site! For example, you have a website that runs on WordPress. New will have a database. If you have a website on some good hosting, then, most likely, the work with the databases will work through PhpMyAdmin, and until then you can deny access through the hosting control panel.

Another program for creating databases. This one is cost-free, but there is also a paid version with advanced features. This program makes it easy to create connections with tables, so you can just do it manually. Another advantage is that you can display the database in a graphical form. Most people, when working with databases, give priority to the program itself. In principle, PhpMyAdmin does not compromise on its capabilities, but it is still better suited for working with database sites.

This article examines the main programs for creating databases. In fact, their strength is strong, so it is up to you to choose the tool for yourself, but if you are just getting used to it and want to learn this area, then it is recommended to use MySQL WorkBench. Once you learn the basics of SQL, it will no longer make any difference for you to practice and write everything the same. It is true that, having created a database in one program, you can open it through other software, which is also used for working with a database. When software is created with a database, you cannot do without this knowledge. Moreover, once you have mastered SQL, you can create your own software for developing and editing databases.

We can easily create database additions such as displaying information from the “Tourists” table on a screen form and linking it with the exact record of the “Tourists” table and the record of the “Tourist Information” table from the Microsoft Access database.

For this purpose, the Windows add-on is completely empty. External appearance of the middle

rozrobki was directed at baby 39.

Small 39. Empty supplement

On the picture 39 there is a group of components “Data”, which contains components for accessing and manipulating data.

The binding of database data to the form is done by the “Binding Source” component. Let's transfer yoga to the form. After placing it on the form, the center of the structure takes on the appearance of an attack (Fig. 40).

Small 40. Binding Source component on the form

The component is not visual, so it is displayed on the additional panel. The main power of the component is the power of the DataSource, which points to the body of data. Behind the explanations of power, power is empty, so it is necessary to formulate its meaning. When choosing a given power, the window of power appears open (Fig. 41).

Small 41. List of dzherel tributes

At the moment, the list is empty, you need to create a new data file by selecting the “Add Project Data Source” command to create a new data box and connect to it. There seems to be a time for dialogue (small 42).

Small 42. List of dzherel tributes

This dialogue prompts you to select the following data:

Database - Database;

Service - Service, this is the actual service that provides data. Most often it is a Web service;

Object - Object for selecting an object that will generate data and objects for working with them.

For our option, you need to select the “Database” item. The window for selecting a connection with data appears (Fig. 43).

Small 43. Select data connection

The purpose of this dialog is to create a connection sequence that will describe the connection parameters for the ADO mechanism, such as the type of database, location, customer names, security features, etc.

The drop-down list in the dialog displays all previously created items. If there is no necessary connection in the list, then select the “New connection” button. Press the button until the next dialog appears (Fig. 44).

In this dialog, you select the type of data file (in this section of Microsoft Access), the name of the database (in this section, this is the place where the database file is installed), the username and password that are used to connect to the database. The “Advanced” button allows you to set a large number of parameters that affect various parts of the ADO mechanism. Click on the “Test Connection” button to check whether the parameters have been entered correctly and whether the connection is correct.

Small 44. Creation of a new union

The last part of the dialogue is the selection of these tables and other database objects that are necessary for this data set. The choice of options is presented for baby 45.

Small 45. Select necessary table

This week there is a table “Tourists” and “Information about tourists”. Fragments of other objects, including the table, were not created in the database, so there are only 45 displays in the table. At this point the construction of the dzherela danikh is completed. After clicking the “Finish” button next to the BindingSource component, the DataSet component appears on the form.

Now the data that is connected must be displayed on the form. The easiest way to display data is to separate the DataGridView component from the Data component group. The component is visual and on the form it looks like it’s up to date (Fig. 46).

Small 46. ​​DataGridView Component

The component settings window immediately appears, which means its ability to edit data: “Enable Adding”, “Enable Editing”, “Enable Deleting”; Possibility of changing the order of columns: “Enable Column Reordering”; as well as the possibility of being secured in a container.

In order for the component to display data, you must select the data item in the drop-down list. Select the list until the next dialogue appears (Fig. 47).

Small 47. Select data for DataGridView

In this case, we selected the “Tourists” table from the list of data. This selection changes the screen form with the next step (Fig. 48).

Small 48. The DataGridView component displays the table structure

You can clearly see that another BindingSource component has appeared and a TableAdapter component that works with the “Tourists” table. Please note that in design-time or during the extraction process, the data from the table is not displayed.

Now you need to display the data from the linked table “Tourist Information”. For this purpose, another DataGridView component is placed on the form and, as a data area, is selected next (Fig. 49).

Small 49. Select data for another DataGridView

Here, the core of the data is not the “Tourist Information” table itself, but the Binding Source between the “Tourists” and “Tourist Information” tables. This choice guarantees the selection from the “Information about tourists” table only of those rows that are related to the flow row in the “Tourists” table. Also, such a choice guarantees the correctness of updating and editing of associated data. The work of the edited program is shown on the small 50.

Small 50. Database addition in robots

Navigating through data using the arrow keys is not manual. To make it easier to navigate through data, there is a BindingNavigator component. Place it on the form (Fig. 51).

Small 51. BindingNavigator component on the form

This component allows you to navigate between table records, add and delete table rows. The capabilities and appearance of the component can be customized using the ToolStripContainer menu.

The authority that determines the table by which navigation is carried out is the authority of the BindingSource. We establish the value of the power of the equal “tourismBindingSource”. In the robot, the component appears as usual (Fig. 52).

Small 52. BindingNavigator component in robot

Editing data in the middle of the DataGridView component with the same settings is possible, but not manual or rational. Zokrema, it is important to check the entered value for the payment. Therefore, for the “Tourists” table, a screen form is created that allows you to display data in TextBox components and edit them. For this purpose, a container of the Panel type is placed on the form, and on this form there are three TextBox components (Fig. 53).

Small 53. Screen panel for editing entries in the “Tourists” table

Now you need to bind the TextBox components to the relevant fields of the “Tourists” table. For which vikorystvovo vlastivst from the DataBindings - Advanced group, shown on little 54.

Small 54. Power “DataBindings - Advanced”

The choice of this authority will lead to the appearance of the dialogue shown on the little 55. This dialogue allows you to not only link the data, but also set the stage within which the data will be updated, as well as the formatting of the data when they are displayed.

For the top TextBox component, in the Binding drop-down list, select the data handler “tourismBmdmgSource” and the handler field – “Name”. For the middle and bottom components of the TextBox, select the same data group and the “Name” and “Father” fields.

The expanded addition to the robot looks like an upcoming order (Fig. 56).

Small 55. Open dialogue for authorities “DataBindings - Advanced”

Small 56. Linking data to visual components

However, when changes are made, all new data will be lost on the form. The data base does not save data, and when you click on the add-on again, there will certainly be new ones. This means that the data is captured in a DataSet object, which is a copy of the table in memory. All items are included in this copy. In order for changes to appear in the database, you need to add the Update method to the TableAdapter class. Thus, in addition to this, it is necessary to place the “Update” button and write down the following program code in the Click file:

touristsTableAdapterUpdate(bDTur_firmDataSet); information_about_touristsTableAdapter.Update(bDTur_firmDataSet);

This code updates information in the “Tourists” and “Tourist Information” tables that are stored in the data. It is important that this method is reversible, and its variant allows you to update both a single row of the table and a group of rows.

It's easy to add your good work to the database. Vikorist the form, shading it lower

Students, postgraduate students, young people, who will add a knowledge base to their profession and work, will be even more special to you.

Posted on http://www.allbest.ru/

Enter

3. Data organization models

4. Relational databases

6. Infological model

7. Logical model

8. Table structure

12. Creation table

16. Creation of the stars

17. Program listing

visnovok

List of references

Enter

In order to make informed and effective decisions in industrial activity, in economic management and in politics, the current accountant is required to take into account additional computers and communication methods, maintain sense, save and process data, presenting the results in the form of official documents. Therefore, it is so important to work with databases.

A database is an organized structure designed to save information. Current databases store not only data, but also information.

Talking about Delphi is like talking about the middle of a Swedish creation of add-ons. This is a technology of visual programming, so that the developer designs his current program, and obtains the results of his work even before launching the program itself. In principle, the process of writing a program itself is divided into two parts. The first one is that the programmer displays the necessary elements on the window of his program, positions, sets the required dimensions, and changes the authorities. The other is the power of writing the program code, a description of the power of the elements available only during the working hours of the program, a description of the reaction to the appearance of a window, pressing a button, and so on. To assign any powers to an element, it is not at all necessary to write massive text rows, it is enough to change the power in the object inspector (the so-called power monitor of the selected element). This change will automatically update or modify the program code.

This is a great plus for visual programming technology. Creating or modifying their software product, koristuvach not knowing or having great respect for the power of the program element, but vikoristuyu is unnecessary, writing a ready-made working product, sometimes acts on equals for the complexity, with writing non-visual editor.

We are faced with the task of compiling a database to store data about the initial plan for the initial process. Having populated the database, you need to conduct a sample analysis using Sql queries.

information database table program

1. Additional benefits until the development of database add-ons

The database is guilty of revenge

a. Tables, to save data, at least 3 tables. The skin table must contain at least 10 entries.

b. Forms for manually reviewing, entering, editing and searching data, forming and modifying queries. There will be explanations and hints on the form. When the form fields are filled in, for the selected sets of values, you will be able to select a value from the list. Request forms will be linked where possible to optimize post navigation. On the form, as much as possible, please provide as much information as possible for the customer. Peredbachiti obrobku vinikayut semantic pardons.

c. Find out what to do with all tables, forms, queries

d. Menu for access to different database objects

e. Dovidku, what to do with a new inventory description

2. To program the database, it is necessary to review the additional literature on the SQL language and the DELPHI programming system.

3. Change and methods of independently determining tasks

1. Analysis of the problem statement and subject area.

2. Infological design, priming of information objects, domains, attributes, links, folded information model.

3. More logical design, priming of base lines, normalization.

4. Design of Sql queries.

5. Programming the structure and essential functions in the database.

6. Design of a database in a software environment.

7. Exploring the program interface.

8. Drawing up an explanatory note.

4. Criteria for assessing essential competencies in work

The criteria will be filled in when the work is completed, shown in Table 1. Based on the average score, a grade for the course work is assigned.

Table 1. Competency assessment

Name of competence

object of evaluation

Understand the benefits and follow them

Retrieving results (DB) (obligation, structure, type of tasks)

letter communication

I put it in an explanatory note, clarity, useful structure, consistency with tasks.

Know and understand the elements of the DELPHI programming system

Components of the database program, power supplies about the implementation of the database

Know and understand the elements of database technology

Nutritional information related to the design, possibly in test format

Increase the consumption of stagnant database technologies

Entering an explanatory note

Work planning, work organization

Wikonanny lines work

Self-reliance

Overflow and ways to independently create tasks

sleep communication

Public database manager

Data before analysis, synthesis

Infological, logical database model

Pray to the bitterness of the result

The vibrancy of their work, the ergonomic displays, the vibrancy of functioning.

The ability to generate new ideas

The interface and additional functions of the database are not included in the specification.

Datafulness before managing (soundingly) information

The number of information resources found and studied in the robot, the number of consultants.

2. Basic concepts and classification of database management systems

A database (DB) is a collection of structured data that is stored in the memory of a computing system and reflects the state of objects and their interactions in a given subject area.

The logical structure of the data that is stored in the database is called a data representation model. The main models of data submission (data models) include hierarchical, boundary, relational.

A database management system (DBMS) is a complex of physical and software features used for the creation, management and general development of a database with a large number of components. Make the DBMS partitioned according to the selected data model. Thus, DBMSs based on a specific relational data model are called relational DBMSs.

For database work, a DBMS is often sufficient. However, if it is necessary to ensure that the work with the database is accessible to unskilled users, or the DBMS interface does not support the users, then the programs may be fragmented. Their creation is influenced by programming. An add-on is a program or a set of programs that ensures the automation of a major application task. Add-ons can be built into the middle or the middle of the DBMS - with the help of an additional programming system that provides access to the database, for example, DelphiC++Bildeg. Add-ons that are part of the DBMS are often called DBMS add-ons, and add-ons that are part of the DBMS are called external add-ons.

The data dictionary is a database subsystem designed for centralized storage of information about the structure of data, the interconnections of database files one by one, the types of data and the formats of their submission, the affiliation of data with accountants, blocking codes and separation bathroom access, etc.

Information systems based on virtual databases must function in a client-server architecture. In this case, the database is located on a computer server, and access is available to it.

The server of a personal resource in a computer network is the computer (program) that hosts that resource, and the client is the Computer (program) that hosts that resource. A computer network resource may include, for example, databases, files, friend services, and postal services.

The primary organization of an information system on a client-server architecture is to provide centralized storage, maintenance and collective access to private corporate information from an individual by the real work of the koristuvachs.

Based on the basic principle of client-server architecture, data is processed only on the server. You can also formulate queries to get to the database server using SQL language instructions. The database server will provide searches and a collection of valuable data, which will then be transmitted to the client’s computer. The advantage of this approach is that it is significantly less expensive to transfer data.

See upcoming types of DBMS:

* Full-function DBMS;

* Database servers;

* Assemble the software for robots from the database.

Full-function DBMSs are traditional DBMSs. These include dBase IV, Microsoft Access, Microsoft FoxPro and others.

Database servers are used to organize data processing centers within the EOM framework. Database servers ensure the processing of queries from client programs and require additional SQL statements. Database server applications: MicrosoftSQL Server, Inter Base.

The role of client programs in general may include DBMS, spreadsheets, text processors, email programs, etc.

Assignments of software programs and robots from the database can be used for creating offensive programs:

* Client programs;

* Database servers and their related components;

* Purposes for the koristuvach of supplements.

Depending on the nature of the DBMS, it can be divided into multi-core (industry) and local (personal).

Promislov, DBMS are the software basis for the development of automated management systems for large economical objects. Commercial DBMSs are responsible for the following:

* Possibility of organizing parallel work for rich employees;

* Scalability;

* Portability on different hardware and software platforms;

* Resistance to failures of various kinds, including the visibility of a rich backup system of information that is saved;

* Security of the data that is stored and a structured system for accessing it.

Personal DBMS is a security program that is oriented towards the highest demands of a local customer or a small group of customers and is intended for use on a personal computer. This is explained by their other name - tabletop. The initial characteristics of desktop systems are:

* Excellent ease of use, which allows you to create practical accessories on their basis;

* It is important to limit the availability of hardware resources.

According to the data model, DBMSs are divided into hierarchical, boundary, relational, object-oriented, etc. DBMS engines can simultaneously support a number of data models.

To work with data that is stored in the database, the following types of models are used:

* Language description of the data - Visokorivneva non-procedural language
declarative type, assignments for description of logical
data structures

* Our data manipulation is a comprehensive design that ensures the execution of basic operations with data: entering, modifying and selecting data by queries.

The names of languages ​​in different DBMSs may have different names. The greatest expansion has come from two standardized languages: QBE - query-by-word language and SQL - structured query language. QBE mainly has the power of data manipulation, SQL combines the power of both types of data.

The DBMS implements the following basic low-level functions:

* Data management from external memory;

* Managing RAM buffers;

* Transaction management;

* Keeping a log of changes to the database;

* Ensuring the integrity and security of the database.

Implementing the data management function in external memory will ensure the organization of resource management in the OS file system.

The need to buffer data is explained by the fact that RAM uses less than external memory. Buffers are areas of RAM designed to speed up the exchange between external and RAM. Fragments of the database are temporarily stored in buffers, the data from which is transferred to the database when processed to the DBMS, or is planned to be written to the database after processing.

The transaction mechanism is validated in the DBMS to maintain the integrity of the data in the database. A transaction is a sequence of operations on database data that is carried out by the DBMS from start to finish. If for any reason (glitches and installation errors, bugs in the software, including add-ons) the transaction is left incomplete, then it is canceled.

Transactions involve three main powers:

* Atomicity (all inputs are included in a transaction or operation);

* Serializability (daily mutual influx of transactions signed in the same hour);

* Durability (do not cause a system crash until the results of a committed transaction are lost).

The application of the transaction is the operation of transferring money from one account to another in the banking system. First, take money from one bank, then spend it on another bank. If you don’t want to finish each operation successfully, the result of the operation will be incorrect and the balance of the operation will be disrupted.

The change log is maintained by the DBMS to ensure the reliability of storing data in the database in the event of hardware or software failures.

Ensuring the integrity of the database is essential for the successful functioning of the database, especially in the case of a back-end victory. The integrity of the database is the power of the database, which means that it contains complete, comprehensive and adequately reflects the subject area of ​​information. The entire database system is described to help maintain the integrity of the minds that are responsible for maintaining savings in the database.

Security is achieved in the DBMS through data encryption, complete security, and support for equal access to the database and its surrounding elements (tables, forms, names, etc.).

3. Data organization models

In the hierarchical model, entity objects and domain entries are represented by sets of data that form a tree-like (hierarchical) structure. The hierarchical model of data was historically the first. On this basis, in the late 60s - early 70s, the first professional DBMSs were fragmented.

The main respect for the exchange of integrity in the hierarchical model lies in the integrity of the message between ancestors and lands in compliance with the basic rule: no land can be founded without a father.

The Merezheva data model allows you to display various interconnections of data elements in the form of a complete graph. The Merezheva database consists of a set of records and a set of connections. There are no special boundaries imposed on the molded bond. Just as in the hierarchical structures of backdrop records there could only be one ancestor record, then in the bordered model of these backdrop records there can be a larger number of ancestor records.

The most important aspect of this data is the feasibility and effective implementation. Compared with the hierarchical model, the hemlock model provides more flexibility in terms of the permissibility of covering additional connections.

Some of the edge data models are characterized by the high complexity and rigidity of the database schema generated on its basis, as well as the complexity of its understanding by the average developer. In addition, in the boundary model of these weakenings, the integrity of links is controlled through the permissibility of installing sufficient links between records.

Systems based on the hemstone model have not become widely used in practice.

The relational data model was developed by IBM computer scientist Edgar Codd and is based on the concept of relation.

A set of empty elements called tuples. This table is presented in scientific form as a two-dimensional table.

With the help of one table, you can manually describe the simplest type of connections between the data, and also: the section of one object, information about which is stored in the table, without any similarities, such as row or table record.

The main disadvantages of the relational model are: the presence of standard methods for identifying adjacent records and the complexity of the description of hierarchical and boundary connections.

4. Relational databases

The relational data model (RDM) of a given subject area is a set of data that changes over time. With the creation of an information system, the collection of entries allows you to save data about the objects of the subject area and model the connection between them. RMD terms are presented in table. 4.1

Table 4.1. Terminal relational model

Terminrelational blanket

equivalent

shutter

blueprint diagram

Row of table column headers (table header)

Table row, record

essence

Description of the authorities of the object

Stovpets, field

No permissible values

attribute

First key

unique identifier

cardinality

Number of rows

number of people

A relational database is a collection of data that can contain a set of cross-sectional tables. The data in the tables must adhere to the following principles:

1. The values ​​of the guilt attributes will be atomic (in other words,
skin value that fits on the webbing of the row and column,
may not be divided into a single value).

2. The values ​​of the skin attribute are to blame for one and the same type.

3. Each entry in the table is unique.

4. The skin field has unique names.

5. The sequence of fields and records in the table is not correct.

It contains the most important concepts and is a two-dimensional table for storing data.

Entity is an object of some nature, data about which is stored in a database. Data about reality are saved in reality.

Attributes represent powers that characterize essence. In the table structure, each attribute is named and corresponds to the header of each table section.

The key of a table is the collection of its attributes that uniquely identifies each of the tuples of a table. In other words, without the attributes of K, which is the key of the note, there is the power of uniqueness. The power of the key comes - not supermundane. So, even from the powerful subsets of impersonality, the power of uniqueness does not exist.

Skin care always contains a combination of attributes that can serve as a key.

There may be cases when there is a number of combinations of attributes, the skin of which uniquely identifies all tuples of the container. All combinations of attributes include possible table keys. Whatever possible keys can be chosen as the first one.

The keys are called upon to be used to achieve offensive goals:

Inclusion of duplicate values ​​in key attributes (other attributes are not accepted in the layout);

Ordering of tuples. It is possible to order the increasing or decreasing values ​​of all key attributes, as well as mixing the order (for some - increasing, and for others - decreasing);

Organize the linked table.

The concept of the external key is important. An external key can be defined as the meaning of the attributes of one row R2, the values ​​of which must be combined with the values ​​of a possible key of another row R1.

The attributes of the K2 record, the warehouse foreign key, are not key for this relationship.

With the help of external keys, connections are installed between the tires.

Designing databases of information systems is a labor-intensive task. It operates on the basis of formalization of the structure and processes of the subject area, information about which is transferred to the database. Conceptual and schematic-structural design are differentiated.

Conceptual design of an IS database is, in a significant sense, a heuristic process. The adequacy of the information model of the subject area established within this framework is verified every step of the way during the functioning of the IS.

Stages of conceptual design:

* Vivcheniya subject area for the formation of a formal statement about it;

* The vision and analysis of functions and tasks are divided into IS;

* The importance of the main objects-essences of the subject area
and the space between them;

* Formalized representation of the subject area.

When designing a relational database schema, you can see the following procedures:

* The meaning of the table and the connections between them;

* Significant transfer of fields, field types, key fields of each table (table schemas), establishment of links between tables through external keys;

* Installation of indexing for fields in tables;

* Development of lists (dictionaries) for fields from enumeration
danimi;

* Established integrity boundaries for tables and links;

* Normalization of the table, correction of the flow of the table and links. Database design occurs on the physical and logical levels. Design on the physical level is implemented using DBMS methods and is often automated.

A logical design lies in the designated number and structure of the table, the development of queries to the database, scientific documents, the creation of forms for entering and editing data in the database, etc.

One of the most important tasks of logical database design is data structuring. There are the following approaches to designing data structures:

* Combining information about entities within one table (one table) with further decomposition into a number of mutually related tables based on the table normalization procedure;

* Formulation of knowledge about the system (the different types of output data and interconnections) and can be done before processing the data, extracting a ready-made DB schema from an additional CA5E system or navigating a ready-made application information system;

* Development of system analysis and development of structural models.

5. Purpose and operating principle of SQL

SQL (often referred to as a “sequel”, shortened name from Structured Query Language) symbolizes the Structuring of Language Queries.

SQL is a tool used for processing and reading data stored in a computer database. This makes it possible to effectively create and work with relational data bases.

The world of databases is becoming larger and more unified, which has necessitated the creation of a standard language that can function across many different types of computer environments. The standard language is to allow traders who know one set of commands to use them to create, extract, change, and transmit information independently of how they work on a personal computer, a third-party desktop dances, or at the universal EOM. More and more mutually connected computer world, koristuvach, the security of such mine, has a great advantage in vikoristan and other information from a number of sources in a large number of ways c.

As the name implies, SQL is a program that is used to organize the interaction of a server with a database. In fact, SQL only works with relational databases.

6. Infological model

With the creation of an information model, the subject area of ​​the given database “Initial plans, disciplines that are directly studied by PMI” was analyzed. There were 4 objects visible: Initial plan, Discipline, Student, Workbook, as well as two additional tables that create connections between students and disciplines, as well as between books and disciplines. The object of the Initial plan has attributes: Creation name, Number of the initial plan. The object of the discipline has the following attributes: Name of the discipline, Code of the discipline, Number of the initial plan, Number of years of lectures, Number of years of practice, Number of years in laboratory work, Whole year, Number of years per week, Form of education news from discipline, Semester of Vivcheniya. The object of the document has attributes: Number of the locker book, PIB. The first object of the Wikladach contains attributes: PIB, Personnel number, Department, Posada, Telephone. Objects Initial Plan and Discipline are related to the 1: n, objects Discipline and Student are related to the 1: n, and Objects of the Discipline and the Account are related to the 1: n.

When describing the information model, we used ER-diagrams:

Malyunok 1

7. Logical model

The logical model describes the concepts of the subject area, their interconnections, as well as the data that overlaps the subject area.

A logical data model is a cob prototype of a future data base. It will be in terms of information units, but without reference to a specific DBMS. Moreover, the logical data model is not necessarily complex but is expressed in terms of the relational data model itself.

To create a logical model, the skin object was assigned a table with a different set of fields. Since the Discipline Objects and the Viktor are linked in the relationship 1: n, then an additional table appears to show the connection between the Discipline and the Vikladka objects: Viktor.

In total, we have 4 objects and will now have 4 tables for their data, the Initial Plan object is less informational, since the database work only works with one initial plan:

If there are 1: n links between the two objects, then we need to introduce another table to supply links between these tables. This will be the Viklada table (Disciplina-Prepodavatel) and the Vivcha table (Disciplina-Student).

The presented database can be extended to 5th normal form, so it can be extended to 3rd normal form and the primary key is simple. The logical scheme is implemented in Microsoft Access.

baby 2

8. Table structure

The resulting database consists of 5 tables (the Initial Plans table is not important, since one initial plan is selected).

Decryption of fields:

v Disciplina.db

Ш Nazv- name of the discipline, field type: String;

Ш Kod - unique discipline code: LongInt;

Ш Semestr - the semester in which it is included: String;

Ш KolLeKCh - number of lectures in this discipline: LongInt;

Ш KolPraktCh - number of practices in this discipline: LongInt;

Ш KolLabRabCh - number of lectures in this discipline: LongInt;

Ш VsegoCh - number of years: LongInt;

Ш NomerYP - number of the initial plan in which the discipline is located: LongInt.

v Student.db

Ш NomerStudBileta - student ticket number: LongInt;

Ш FIO - student's nickname: ShortInt;

v Prepodaet.db (Disciplina-Prepodavatel)

Ш TabNomerPrepod - personnel number of the tabulation, which belongs to the sub-discipline: LongInt;

Ш FIO-PIB statement, which contributes to the sub-discipline: String.

v Prepod.db

Ш FIO - PIB taught: String;

Ш TabelNomerPrepodavatelya - unique personnel number of the bank account: LongInt;

Ш Kafedra - the department for which it operates: String;

Ш Dolshnost - Posada vikladacha: String;

Ш Telefon - contact phone number of the vault: String.

v Izuchaet.db (Disciplina-Student)

Ш KodDiscip- discipline code: LongInt;

Ш NomerStudBileta - student ticket number of the student who is studying the discipline: LongInt;

Ш FIO- PIB of the student who is in the major discipline: String;

Ш Ocenka - student’s grade from the studied discipline: LongInt;.

9. Design of SQL queries

1. Create a list of activities and events for each semester.

select Nazv, FormaReport

where Semester =: s and

(Disciplina.FormaOtchet = "Zalik" or Disciplina.FormaOtchet = "Is sleeping");

2. Formulate exam reports / main and supplementary materials / on a skin subject.

Main information:

select Prepodaet.FIO,

Disciplina.ObsheeKolChVNed, Disciplina.Semestr, Izuchaet.FIO, Izuchaet.

Ocenka, Disciplina.Nazv

from Disciplina, Prepodaet, Izuchaet

where Disciplina.KodDiscip = Prepodaet.KodDiscip

and (Disciplina.FormaOtchet = "Sleeping" or Disciplina.FormaOtchet = "Zalik")

Additional information (for students who are 2):

select Disciplina.Nazv, Prepodaet.FIO,

Disciplina.ObsheeKolChVNed, Izuchaet.FIO, Disciplina.Semestr, Izuchaet.Ocenka

from Izuchaet, Disciplina, Prepodaet

where Izuchaet.Evaluation = "2"

and Disciplina.KodDiscip = Izuchaet.KodDiscip

and Disciplina.KodDiscip = Prepodaet.KodDiscip

and (Disciplina.FormaOtchet = "Is asleep" or Disciplina.FormaOtchet = "Zalik");

Update Discipline

set ObsheeKolChVNed = VsegoCh / 17;

4. Prepare an insert for the student’s diploma:

select Disciplina.Nazv, Izuchaet.Ocenka, Izuchaet.FIO

from Izuchaet, Disciplina

where Disciplina.KodDiscip = Izuchaet.KodDiscip

and Disciplina.FormaOtchet = "Is asleep"

Select AVG (Evaluation) as SrBall

Order by SrBall desc;

5. View the list of groups in descending order of average score:

Select FIO, AVG (Evaluation) as SrBall

Order by SrBall desc;

10. Structure and functions of the system

The course work consists of one project “Project1” and 13 modules.

1. Unit1 - here the form is saved, which is the title page. Components that are being reviewed are: Memo, Button.

2. Unit2 - here the form is saved, which is the cob side of the database. Here the components are vicorized: Button, Memo.

3. Unit3 - here the form is saved to display all the database tables in the tab view. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

4. Unit4 - the form on which the task is displayed is saved here. Here the components are vicorized: Memo, Button.

5. Unit5 - the form on which the additional examination report is displayed is saved here. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

6. Unit6 - here the form is saved, on which the list of tests and pours is displayed. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

7. Unit7 - the form on which the main examination report is displayed is saved here. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

8. Unit8 - here the form is saved, on which the list of groups is displayed in descending order. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

9. Unit9 - the form on which the diploma insert is displayed is saved here. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

10. Unit10 - the form is saved here, on which the form for filling out the electronic form is displayed. Here are the components that are vicorized: Memo, Button, TabSheet, Table, DBGrid, DBNavigator, Label, Query.

11. Unit11 - the form on which the menu is displayed is saved here. Here the components are vicorized: Memo, Button, Label.

12. Unit12 - here the form is saved on which the result of the completed electronic examination report is displayed. The following components are highlighted here: Memo and Button, RVProject, RVQueryConnnection and Query.

13. Unit13 - here the form is saved, on which the result of the insert in the diploma is displayed. The following components are highlighted here: Memo and Button, RVProject, RVQueryConnnection and Query.

11. Kerivnitstvo for koristuvach

1. Let's launch the project. Before us is the title page of the coursework

baby 3

Here we can immediately go to the database, or we can see the default and return to this form. Select “Show the area”

2. We will be presented with information about the coursework assignments

baby 4

3. Turn back by pressing the back button and start the robot by pressing the “Continue” button on the front window

baby 5

4. Having read the information on this page, click on the “Login” button

baby 6

We are presented with a window where we can place all the information that is in the database on tabs. Here we can look at the list of disciplines, the initial group, contributions, what other students are studying and what subject they are contributing.

5. From this window we can go to the next steps. We press on the second button.

baby 7

Here we can select whether or not to ask simply by clicking on the second button. Also here we can turn to the table and go to the formation of the electronic version of the exam sheet.

6. Click on the button “Review the list of activities and events for each semester”

baby 8

Here you need to enter the semester number and click on the button below, then at the end of the table a list of studies and classes for the semester you entered will appear. From this sheet we can turn back to the capitals.

7. Click on the button “Go to the main exam report”

Here you need to select the name of the discipline from the list, then enter this name at the end of the drop-down list and click on the “Connect” button. This will show the number of years available for the discipline you have entered, as well as display a list of students who are studying this discipline and their grade for this discipline. Respect! The evaluation field will be filled in on the form with tables in the middle of the Student-Discipline tab. So on this basis you can formulate an additional examination report. For students who have a grade of 2. From this sheet we can turn back to the capitals.

baby 9

8. Click on the button “Go to the additional exam report”

baby 10

Here we can help students who have a grade of 2 in this or another discipline. From this sheet we can turn back to the capitals.

9. Click on the button “Formulate insert for diploma”

baby 11

Here you need to enter the graduate’s PIB by selecting a qualified student from the list. Then press the key. And then, after asking, the “Discipline” section will be filled in with a list of disciplines taught for 5 years of study, and the corresponding grades will also appear. Here you can view the electronic version of the insert by clicking on the “Private version” button. After viewing this version, you just need to close the window on the red cross in the upper right corner of the screen.

baby 12

10. Click on the button “View group list in descending order of average score”

baby 13

Here we have a list of groups and the average score appropriate for each student, arranged in descending order. From this sheet we can turn back to the capitals.

baby 14

Select a discipline from the list, for example, economics, and enter its name at the end under the list that appears. Next, press the quit button and the appropriate name for the quitting of this discipline.

baby 16

Here we will name the discipline we have established, and the presentation of this discipline. And also a list of students who studied this discipline. To exit the call, simply click on the cross in the upper right corner of the screen. Turn over to the front sheet. From this sheet we can turn back to the capitals.

12. Creation table

To create a table, use the Database Desktop utilities. You can launch it - Start / Programs / Borland Delphi 7 / Database Desktop. It is necessary to set up the working directory of the utility. Select the command File / Working Directory and set your working directory. To create a table, select the command File / New / Table. Then you need to select the table type. The PARADOX 7 type can be used as the shortest file server table.

1. Creating the YchebPlan table (Initial plan):

baby 17

5. Creation of the Disciplina table:

baby 18

6. Creating the Student table:

baby 19

7. Creation of the Prepodaet table (Discipline-Vykladach):

baby 20

5. Creating a Prepod table:

baby 21

8. Creation of the Izuchaet table (Discipline-Student):

baby 22

13. Creating programs in Delphi

In order to create a new application, you need to select New / Application from the File menu. The form and module appear (in general the project is called), now you can place the necessary components on the form. If necessary, you can create another form (and more than one), for which you need to select New / Form from the File menu.

1. Table. Reserved with tribute. Reimagined data.

In order to display a table on a form, you need to place the following components on it:

· Table (on the BDE tab) - In the object inspectors, on the “Parameters” tab, under the authority Tablename, select the required table.

baby 23

· DBGrid (on the DataControls tab) - necessary for displaying the table on the form; enter the required data in the Object Inspector under the DataSource authority.

baby 24

· DBNavigator (on the DataControls tab) - necessary for moving through table records. The Object Inspector at the DataSource authority shows the same data as in the DBGrid. The navigator functions are available by pressing on its buttons during the program's operating time. Component contains 10 buttons.

baby 25

· DataSource (Data Access tab) - an intermediate level component to deny access to data. Serve as an intermediary between DBMS tables and on-screen controls (DBGrid, DBNavigator).

baby 26

14. Creating a field with information (Memo) and buttons

A Memo component is placed on the form, which is displayed in the Standard tab.

baby 27

In the Object Inspector, on the “Parameters” tab, in the Lines control, enter the text required for display

baby 28

Creation of buttons.

To correctly close the form, a Button component is placed on it, which is displayed on the Standard tab.

baby 29

In order for the button to work, you need to enter the following in the OnClick tool:

procedure TForm1.N5Click (Sender: TObject);

begin

Form2.Show;

Form1.Close;

end;

15. Creation of signatures for the table

To sign the table in the robot, select the Lable component and expand it to the Standard tab. In the Inspector of Objects in Power Caption you just need to write the text.

baby 30

16. Creation of the list

To select a command from an explicit list, a ComboBox component is used (the list that is selected). This treasure can be created in this manner

To the Inspector of Objects in the Items Authority, you must write:

baby 31

16. Creation of the stars

It is created behind the additional QReports tool, which you need to first connect: Component-> install packages-> add Open the bin folder, select the dclqrt70.bpl file, click OK and a tab with QReport components will appear. Components I have chosen:

Table 2

17. Program listing

Description of the project

program Project1;

uses

Forms

Unit1 in "Unit1.pas" (Form1),

Unit2 in "Unit2.pas" (Form2),

Unit3 in "Unit3.pas" (Form3),

Unit4 in "Unit4.pas" (Form4),

Unit5 in "Unit5.pas" (Form5),

Unit6 in "Unit6.pas" (Form6),

Unit7 in "Unit7.pas" (Form7),

Unit8 in "Unit8.pas" (Form8),

Unit9 in "Unit9.pas" (Form9),

Unit10 in "Unit10.pas" (Form10),

Unit11 in "Unit11.pas" (Form11),

Unit12 in "Unit12.pas" (Form12),

Unit13 in "Unit13.pas" (Form13),

Unit14 in "Unit14.pas" (Form14);

($R*.res)

begin

Application.Initialize;

Application.CreateForm(TForm1, Form1);

Application.CreateForm(TForm2, Form2);

Application.CreateForm(TForm3, Form3);

Application.CreateForm(TForm4, Form4);

Application.CreateForm(TForm5, Form5);

Application.CreateForm(TForm6, Form6);

Application.CreateForm(TForm7, Form7);

Application.CreateForm(TForm8, Form8);

Application.CreateForm(TForm9, Form9);

Application.CreateForm(TForm10, Form10);

Application.CreateForm(TForm11, Form11);

Application.CreateForm(TForm12, Form12);

Application.CreateForm(TForm13, Form13);

Application.CreateForm(TForm14, Form14);

Application.Run;

end.

Unit1 module description

unit Unit1;

interface

uses

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

Memo1: TMemo;

Button1: TButton;

Button2: TButton;

Button3: TButton;

private

(Private declarations)

public

(Public declarations)

end;

var

Form1: TForm1;

implementation

uses Unit2, Unit4, Unit6, Unit7, Unit5, Unit8, Unit9, Unit10;

($R*.dfm)

procedure TForm1.Button3Click(Sender: TObject);

begin

Form2.show;

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

Form1.Close;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

Form4.show;

end;

end.

Description of the Unit2 module

unit Unit2;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm2 = class(TForm)

Memo1: TMemo;

GroupBox1: TGroupBox;

Button1: TButton;

Button2: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form2: TForm2;

implementation

uses Unit3;

($R*.dfm)

procedure TForm2.Button1Click(Sender: TObject);

begin

Form3.show;

Form2.Close;

end;

procedure TForm2.Button2Click(Sender: TObject);

begin

Form2.Close;

end;

Unit3 module description

unit Unit3;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ComCtrls, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables,

StdCtrls, QuickRpt, QRCtrls;

type

TForm3 = class(TForm)

PageControl1: TPageControl;

TabSheet1: TTabSheet;

TabSheet2: TTabSheet;

TabSheet3: TTabSheet;

TabSheet4: TTabSheet;

TabSheet5: TTabSheet;

TabSheet6: TTabSheet;

DataSource1: TDataSource;

DataSource2: TDataSource;

DataSource3: TDataSource;

DataSource4: TDataSource;

Table1: TTable;

Table2: TTable;

Table3: TTable;

Table4: TTable;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

DBGrid2: TDBGrid;

DBNavigator2: TDBNavigator;

DBGrid3: TDBGrid;

DBNavigator3: TDBNavigator;

DBGrid4: TDBGrid;

DBNavigator4: TDBNavigator;

DBGrid5: TDBGrid;

DBNavigator5: TDBNavigator;

DBGrid6: TDBGrid;

DBNavigator6: TDBNavigator;

Button1: TButton;

DataSource5: TDataSource;

DataSource6: TDataSource;

Table5:TTable;

Table6: TTable;

Query1: TQuery;

Button2: TButton;

Label1: TLabel;

Memo1: TMemo;

Label3: TLabel;

Button3: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form3: TForm3;

implementation

uses Unit5, Unit11;

($R*.dfm)

procedure TForm3.Button1Click(Sender: TObject);

begin

Form11.show;

Form3.close;

end;

procedure TForm3.Button2Click(Sender: TObject);

begin

Query1.ExecSQL;

Form3.Refresh;

end;

procedure TForm3.Button3Click(Sender: TObject);

begin

Form3.close;

end;

Description of the Unit4 module

unit Unit4;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm4 = class(TForm)

Memo1: TMemo;

Button1: TButton;

procedure Button1Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form4: TForm4;

implementation

uses Unit1;

($R*.dfm)

procedure TForm4.Button1Click(Sender: TObject);

begin

Form1.show;

end;

Description of the Unit 5 module

unit Unit5;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, DB, DBTables, Grids, DBGrids, StdCtrls, Mask, DBCtrls, ExtCtrls;

type

TForm5 = class(TForm)

DataSource1: TDataSource;

DBGrid1: TDBGrid;

Query1: TQuery;

DBEdit1:TDBEdit;

DBEdit2:TDBEdit;

DBEdit3:TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

DBNavigator1: TDBNavigator;

Button1: TButton;

procedure ComboBox1Change(Sender: TObject);

procedure Edit1Change(Sender: TObject);

procedure Button1Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form5: TForm5;

implementation

uses Unit11;

($R*.dfm)

procedure TForm5.ComboBox1Change(Sender: TObject);

begin

Query1.Active: = true;

end;

procedure TForm5.Edit1Change(Sender: TObject);

begin

Query1.Open;

end;

procedure TForm5.Button1Click(Sender: TObject);

begin

Form11.show;

Form5.Close;

end;

Description of the Unit 6 module

unit Unit6;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, DB, DBTables, Grids, DBGrids, StdCtrls, ExtCtrls, DBCtrls;

type

TForm6 = class(TForm)

Button1: TButton;

Edit1: TEdit;

DataSource1: TDataSource;

DBGrid1: TDBGrid;

Query1: TQuery;

Label1: TLabel;

DBNavigator1: TDBNavigator;

Label2: TLabel;

Memo1: TMemo;

Button2: TButton;

Label3: TLabel;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form6: TForm6;

implementation

uses Unit11;

($R*.dfm)

procedure TForm6.Button1Click(Sender: TObject);

begin

Query1.Close;

if not Query1.Prepared then

Query1.Prepare;

if length (edit1.text)<>0 then

else

begin

Query1.Params.Value: = 0;

end;

Query1.Open;

end;

procedure TForm6.Button2Click(Sender: TObject);

begin

Form11.show;

Form6.Close;

end;

Description of the Unit 7 module

unit Unit7;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, DBGrids, DBTables, DB, Mask, DBCtrls, ExtCtrls,

QRCtrls, QuickRpt;

type

TForm7 = class(TForm)

Label1: TLabel;

Label2: TLabel;

DataSource1: TDataSource;

Query1: TQuery;

Edit2: TEdit;

Button1: TButton;

DBEdit1:TDBEdit;

DBEdit2:TDBEdit;

Label3: TLabel;

DBGrid1: TDBGrid;

Label4: TLabel;

Label5: TLabel;

DBNavigator1: TDBNavigator;

Button2: TButton;

Label6: TLabel;

Label7: TLabel;

Memo1: TMemo;

ComboBox1: TComboBox;

Label8: TLabel;

Button3: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form7: TForm7;

implementation

uses Unit5, Unit11;

($R*.dfm)

procedure TForm7.Button1Click(Sender: TObject);

begin

Query1.Close;

if not Query1.Prepared then

Query1.Prepare;

if length(edit2.text)<>0 then

Query1.Params.Value: = edit2.Text

else

begin

Query1.Params.Value: = 0;

edit2.Text: = "Enter a name!";

end;

Query1.Open;

end;

procedure TForm7.Button2Click(Sender: TObject);

begin

Form5.show;

Form7.close;

end;

procedure TForm7.Button3Click(Sender: TObject);

begin

Form11.show;

Form7.close;

end;

Description of the Unit 8 module

unit Unit8;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

type

TForm8 = class(TForm)

Label4: TLabel;

DataSource1: TDataSource;

Query1: TQuery;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

Button1: TButton;

Memo1: TMemo;

procedure Button1Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form8: TForm8;

implementation

uses Unit11;

($R*.dfm)

procedure TForm8.Button1Click(Sender: TObject);

begin

Form11.show;

Form8.close;

end;

Description of the Unit 9 module

unit Unit9;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Grids, DBGrids, DB, DBTables, StdCtrls, Mask, DBCtrls, ExtCtrls;

type

TForm9 = class(TForm)

Edit1: TEdit;

Query1: TQuery;

DataSource1: TDataSource;

DBGrid1: TDBGrid;

Button1: TButton;

Query2: TQuery;

DataSource2: TDataSource;

Button2: TButton;

DBEdit1:TDBEdit;

DBNavigator1: TDBNavigator;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Name: TComboBox;

Button3: TButton;

Memo1: TMemo;

Label4: TLabel;

Button4: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form9: TForm9;

implementation

uses Unit11, Unit13;

($R*.dfm)

procedure TForm9.Button1Click(Sender: TObject);

begin

Query1.Close;

if not Query1.Prepared then

Query1.Prepare;

if length (edit1.text)<>0 then

Query1.Params.Value: = edit1.Text

else

begin

Query1.Params.Value: = 0;

edit1.Text: = "Enter the name of the graduate!";

end;

Query1.Open;

end;

procedure TForm9.Button2Click(Sender: TObject);

begin

Query2.Close;

if not Query2.Prepared then

Query2.Prepare;

if length (edit1.text)<>0 then

Query2.Params.Value: = edit1.Text

else

begin

Query2.Params.Value: = 0;

edit1.Text: = "Enter semester number!";

end;

Query2.Open;

end;

procedure TForm9.Button3Click(Sender: TObject);

begin

Form11.show;

Form9.close;

end;

procedure TForm9.Button4Click(Sender: TObject);

begin

Form13.QuickRep1.Preview;

end;

Description of the Unit 10 module

unit Unit10;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ExtCtrls, QuickRpt, StdCtrls, DB, DBTables, Mask, DBCtrls,

Grids, DBGrids;

type

TForm10 = class(TForm)

Button1: TButton;

Query1: TQuery;

DataSource1: TDataSource;

DBEdit1:TDBEdit;

DBEdit2:TDBEdit;

Label1: TLabel;

Label2: TLabel;

Edit1: TEdit;

Button2: TButton;

Label3: TLabel;

ComboBox1: TComboBox;

Label4: TLabel;

Label5: TLabel;

Memo1: TMemo;

Label6: TLabel;

Label7: TLabel;

Button3: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form10: TForm10;

implementation

uses Unit3, Unit7, Unit12, Unit11;

($R*.dfm)

procedure TForm10.Button1Click(Sender: TObject);

begin

Form12.QuickRep1.Preview;

end;

procedure TForm10.Button2Click(Sender: TObject);

begin

Query1.Close;

if not Query1.Prepared then

Query1.Prepare;

if length (edit1.text)<>0 then

Query1.Params.Value: = edit1.Text

else

begin

Query1.Params.Value: = 0;

edit1.Text: = "Enter a name!";

end;

Query1.Open;

end;

procedure TForm10.Button3Click(Sender: TObject);

begin

Form11.show;

end;

Description of the Unit 11 module

unit Unit11;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm11 = class(TForm)

Button1: TButton;

Button2: TButton;

Button3: TButton;

Button4: TButton;

Button5: TButton;

Button6: TButton;

Memo1: TMemo;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Button7: ​​TButton;

Label4: TLabel;

Label5: TLabel;

procedure Button2Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Button5Click(Sender: TObject);

procedure Button6Click(Sender: TObject);

procedure Button7Click(Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form11: TForm11;

implementation

similar documents

    Table creation and design of database management systems. Infological design. Relational database schema. Applications of systems: information about postal workers and the goods they supply. A statement about the availability of goods in the store.

    course work, add 01.12.2008

    Expanding the database with information about suppliers, products, with an indicator of product types using the MySQL database management system using SQL queries. Development of an information model of a subject area. Table structure, database fields.

    robot control, add 04/13/2012

    The process of designing a database, developing its logical structure is similar to the information model of the subject area. Working with the Access DBMS program, creating tables and their fields, creating inter-table connections; Infological design.

    course work, add 12/17/2009

    Basic concepts of databases and database management systems. Types of data that can be processed using Microsoft Access. Classification of DBMS and their main characteristics. Post-relational databases. Trends in the light of current information systems.

    course work, add 01/28/2014

    Features of the development of the information model and the creation of the structure of the relational database. Basics of design based on data. Expanding tables, forms, queries to display information about the specific model. Working with databases and their objects.

    course work, add 05.11.2011

    Investigation of the characteristics and functional capabilities of the Microsoft Office Access database management system. Values ​​of the main classes of objects. Development of the database "Dilovodstvo". Create a table, forms, queries, answers and data schemes.

    abstract, addition 12/05/2014

    The trend is the development of database management systems. Hierarchical and intermediate DBMS models. Main benefits to a distributed database. Processing of subdivisions, interoperability. Data replication technology and multi-tier architecture.

    abstract, addition 11/29/2010

    Theoretical facts and basic concepts of databases. Database management systems: warehouse, structure, security, operating modes, objects. Working with databases in OpenOffice.Org BASE: creating a table, links, queries for additional query master.

    course work, dodanii 04/28/2011

    Design of a database system for receiving, processing and processing applications to the development of information technologies; development of informational and datalogical models, implementation of the physical model. Creation of add-ons for visualization of work with a database.

    diploma work, add 01/25/2013

    Visions of information objects and their information model. The structure of the relational data base is logical. Expanding a table in the Access database management system. Creation of queries, forms and responses in the Access DBMS. Rozrobka program koristuvach.

We can easily create database additions such as displaying information from the “Tourists” table on a screen form and linking it with the exact record of the “Tourists” table and the record of the “Tourist Information” table from the Microsoft Access database.

For this purpose, the Windows add-on is completely empty. External appearance of the middle

rozrobki was directed at baby 39.

Small 39. Empty supplement

On the picture 39 there is a group of components “Data”, which contains components for accessing and manipulating data.

The binding of database data to the form is done by the “Binding Source” component. Let's transfer yoga to the form. After placing it on the form, the center of the structure takes on the appearance of an attack (Fig. 40).

Small 40. Binding Source component on the form

The component is not visual, so it is displayed on the additional panel. The main power of the component is the power of the DataSource, which points to the body of data. Behind the explanations of power, power is empty, so it is necessary to formulate its meaning. When choosing a given power, the window of power appears open (Fig. 41).

Small 41. List of dzherel tributes

At the moment, the list is empty, you need to create a new data file by selecting the “Add Project Data Source” command to create a new data box and connect to it. There seems to be a time for dialogue (small 42).

Small 42. List of dzherel tributes

This dialogue prompts you to select the following data:

Database - Database;

Service - Service, this is the actual service that provides data. Most often it is a Web service;

Object - Object for selecting an object that will generate data and objects for working with them.

For our option, you need to select the “Database” item. The window for selecting a connection with data appears (Fig. 43).

Small 43. Select data connection

The purpose of this dialog is to create a connection sequence that will describe the connection parameters for the ADO mechanism, such as the type of database, location, customer names, security features, etc.

The drop-down list in the dialog displays all previously created items. If there is no necessary connection in the list, then select the “New connection” button. Press the button until the next dialog appears (Fig. 44).

In this dialog, you select the type of data file (in this section of Microsoft Access), the name of the database (in this section, this is the place where the database file is installed), the username and password that are used to connect to the database. The “Advanced” button allows you to set a large number of parameters that affect various parts of the ADO mechanism. Click on the “Test Connection” button to check whether the parameters have been entered correctly and whether the connection is correct.

Small 44. Creation of a new union

The last part of the dialogue is the selection of these tables and other database objects that are necessary for this data set. The choice of options is presented for baby 45.

Small 45. Select necessary table

This week there is a table “Tourists” and “Information about tourists”. Fragments of other objects, including the table, were not created in the database, so there are only 45 displays in the table. At this point the construction of the dzherela danikh is completed. After clicking the “Finish” button next to the BindingSource component, the DataSet component appears on the form.

Now the data that is connected must be displayed on the form. The easiest way to display data is to separate the DataGridView component from the Data component group. The component is visual and on the form it looks like it’s up to date (Fig. 46).

Small 46. ​​DataGridView Component

The component settings window immediately appears, which means its ability to edit data: “Enable Adding”, “Enable Editing”, “Enable Deleting”; Possibility of changing the order of columns: “Enable Column Reordering”; as well as the possibility of being secured in a container.

In order for the component to display data, you must select the data item in the drop-down list. Select the list until the next dialogue appears (Fig. 47).

Small 47. Select data for DataGridView

In this case, we selected the “Tourists” table from the list of data. This selection changes the screen form with the next step (Fig. 48).

Small 48. The DataGridView component displays the table structure

You can clearly see that another BindingSource component has appeared and a TableAdapter component that works with the “Tourists” table. Please note that in design-time or during the extraction process, the data from the table is not displayed.

Now you need to display the data from the linked table “Tourist Information”. For this purpose, another DataGridView component is placed on the form and, as a data area, is selected next (Fig. 49).

Small 49. Select data for another DataGridView

Here, the core of the data is not the “Tourist Information” table itself, but the Binding Source between the “Tourists” and “Tourist Information” tables. This choice guarantees the selection from the “Information about tourists” table only of those rows that are related to the flow row in the “Tourists” table. Also, such a choice guarantees the correctness of updating and editing of associated data. The work of the edited program is shown on the small 50.

Small 50. Database addition in robots

Navigating through data using the arrow keys is not manual. To make it easier to navigate through data, there is a BindingNavigator component. Place it on the form (Fig. 51).

Small 51. BindingNavigator component on the form

This component allows you to navigate between table records, add and delete table rows. The capabilities and appearance of the component can be customized using the ToolStripContainer menu.

The authority that determines the table by which navigation is carried out is the authority of the BindingSource. We establish the value of the power of the equal “tourismBindingSource”. In the robot, the component appears as usual (Fig. 52).

Small 52. BindingNavigator component in robot

Editing data in the middle of the DataGridView component with the same settings is possible, but not manual or rational. Zokrema, it is important to check the entered value for the payment. Therefore, for the “Tourists” table, a screen form is created that allows you to display data in TextBox components and edit them. For this purpose, a container of the Panel type is placed on the form, and on this form there are three TextBox components (Fig. 53).

Small 53. Screen panel for editing entries in the “Tourists” table

Now you need to bind the TextBox components to the relevant fields of the “Tourists” table. For which vikorystvovo vlastivst from the DataBindings - Advanced group, shown on little 54.

Small 54. Power “DataBindings - Advanced”

The choice of this authority will lead to the appearance of the dialogue shown on the little 55. This dialogue allows you to not only link the data, but also set the stage within which the data will be updated, as well as the formatting of the data when they are displayed.

For the top TextBox component, in the Binding drop-down list, select the data handler “tourismBmdmgSource” and the handler field – “Name”. For the middle and bottom components of the TextBox, select the same data group and the “Name” and “Father” fields.

The expanded addition to the robot looks like an upcoming order (Fig. 56).

Small 55. Open dialogue for authorities “DataBindings - Advanced”

Small 56. Linking data to visual components

However, when changes are made, all new data will be lost on the form. The data base does not save data, and when you click on the add-on again, there will certainly be new ones. This means that the data is captured in a DataSet object, which is a copy of the table in memory. All items are included in this copy. In order for changes to appear in the database, you need to add the Update method to the TableAdapter class. Thus, in addition to this, it is necessary to place the “Update” button and write down the following program code in the Click file:

touristsTableAdapterUpdate(bDTur_firmDataSet); information_about_touristsTableAdapter.Update(bDTur_firmDataSet);

This code updates information in the “Tourists” and “Tourist Information” tables that are stored in the data. It is important that this method is reversible, and its variant allows you to update both a single row of the table and a group of rows.

DEVELOPMENT OF AN APPLICATION FOR WORKING WITH DATABASES

Roza Gaynanova

lecturer of the Department of General Educational Disciplines

Kazan national research Technological University

Russia, Kazan

ABSTRACT

The article examines methods for accessing databases and understands these methods for accessing the program interface. The integration of Visual C # add-ons with the Microsoft SQL Server 2012 DBMS server is considered. The development of the “Travel Agency” information system is considered as an example.

ABSTRACT

The article examines the methods of access to databases and the software interfaces used in these access methods. We consider the integration of Visual C# applications with the Microsoft SQL Server 2012 database server. As an example the development of the "Tourist Agency" information system is considered.

Key words: database, SQL Server, add-on, correspondents, control element, input.

Keywords: database, SQL Server, application, users, control element, query.

An information system is an interconnected set of methods, methods and personnel recruited to save, process and process information in the interests of achieving the goal. The information system will be expanded based on client-server technology. In such systems, information is stored on the server, and the information system interface is stored on client computers, through which another information system allows access to the data.

When developing an information system, two main tasks must be addressed:

  • creation of a database intended for storing information;
  • task of developing a graphical interface for client applications.

The “Travel Agency” database is created on Microsoft SQL Server 2012. The database stores information about the clients of this travel agency (tourists), about the tours it offers, about the issuance and payment of trips. At the database design stage, the tables “Tourists”, “Tours”, “Tours”, “Seasons”, “Payment” are created. Links are established between tables.

The staff of the travel agency will be the travel agency's clerk, sales managers, accountant, cashier and travel agency's office assistants. One of the office servers is designated as the system administrator. Only you will maintain cloud records of the correspondents. In addition to the five main tables, the “Koristuvach” table is created to contain information about the DB’s koristuvach. This table is not related to other tables. The structure of this table: customer code, nickname, name, login and password. Only the system administrator can make changes to this table.

The SQL Server security system will be based on two concepts: authentication and authorization. The system administrator, who is responsible for the security of SQL Server, creates a separate login object for every user. This object contains the name of the SQL Server account account, its password, and other attributes used to control access to SQL Server databases. By connecting to SQL Server, the user denies access to these databases, such as the registry of his cloud records. In order to register an account record in a specific database, the system administrator creates his own database name in it and associates it with the account account record. The system administrator provides the employees with important duties. The sales manager can make changes in the “Tourists”, “Trips” tables and change the “Number of seats” column in the “Tours” table after selling the final tour. Travel agency travel agents can make changes to the “Seasons” and “Tours” tables. Accountant and cashier - in the “Payment” table.

This can again be done in the middle of SQL Server Management Studio by opening the window of the authorities of the government accountant. You can find out the new importance using additional GRANT instructions. Give more attention to the manager. The following instructions give the manager the right to review and change the “Tourists” table, insert new rows and delete old data.

USE Travel Agency

GRANT SELECT, UPDATE, INSERT, DELETE

ON Tourists

A similar instruction is created for working with the “Trips” table. To give the manager the right to change only one column of the “Tours” table, after the name of the table, the name of the changed tour stopper (Number of seats) is indicated in the arms. Given the operations SELECT, UPDATE.

The Data Control Language (DCL) has the following instructions: COMMIT, ROLLBACK, GRANT, REVOKE. All these instructions are related to the protection of the data base from temporary or permanent damage. Databases themselves are processed when changes are made to them. To protect the database in SQL, an interchange operation is performed. How can they be changed, so that they only change between transactions. If you try several servers to access the same database table at the same time, a situation of competitive access is created. Problems associated with instant access arise from fairly simple applications when the program is installed and running in many systems that rarely have instant access management in place. Transaction conflicts do not occur because they are resolved sequentially.

One of the main tools for maintaining the integrity of the database is a transaction. A transaction encapsulates all SQL statements that can be entered into the database. An SQL transaction ends with one of two statements: COMMIT or ROLLBACK. If a transaction ends with a ROLLBACK instruction, then all of its instructions are affected, and the database is returned to the beginning. A primary transaction can be completed in one of two modes: READ-WRITE (read-write) or READ-ONLY (read-only). For a transaction, you can set one of the following isolation levels: SERIAIZABLE (successive reading), REPEATABLE READ (repeated reading), READ UNCOMMITED (reading unconfirmed data). The characteristics are READ-WRITE and SERIAIZABLE. Due to the characteristics of a SQL transaction, it may be suitable for most clients.

The add-on is created in the middle of Visual Studio 2012 using C# programming language. The design of a software product begins with the development of the user interface.

The main program can easily select the main functions for working with the add-on (Figure 1). To select these operations, a menu is displayed. The menu consists of the following items: “Tables”, “Request”, “Call”. For the skin from these points, apply sub-points. The skin function will be displayed in its own window. The MenuStrip element is installed on the main window of the program, and menu options are formed. The form window contains a PictureBox element. The little ones are attracted to the area of ​​the element. The little one is responsible for occupying the entire area. The power of SizeMode sets the scaling of the baby. For which power, StretchImage is selected from the list, and the image is scaled so that it occupies the entire surface of the object.

To display the list of travel agents who have the right to trade with the “Travel Agency” database, a comboBox control element is installed. The comboBox element is bound to the data element. The window opens " ZomboBoxzavdannya", In which the order "Vikoristovat elements of binding to data" is established, since this order of statements is supported by the parameters of data binding. The comboBox element is linked to the “Member” table, and “Name” is selected in the “Member Show” row. To enter a login, the textbox1 control element is installed, and to enter a password, textBox2. For the textBox1 and textBox2 elements, the UsesSystemPasworChar is set to true, indicating that the text in the textbox is to be displayed as password symbols. Two command buttons are installed: “Log In” and “Change Account”.

When you bind the comboBox element to the “Correspondents” table, the Form1_Load subscript appears in the form code.

private void Form1_Load(object sender, EventArgs e)

this.usersTableAdapter1.Fill(this.travel agencyDataSet10.Users);

When starting the program menu, the pose is determined by the reach zone. To log in to the system, you need to enter information about the account provider and click the “Log In” button. When the name form of the merchants is selected, which is located in the “Correspondents” table, it is added to the comboBox1 control element. In this list, rows are added to remove inaccessible menus, the “Change Account” button and in the comboBox1 element the same element cannot be selected:

menuStrip1.Enabled = false; comboBox1.SelectedIndex = -1;

button2.Enabled = false;

Malyunok 1. View of the main window of the program

When you press the “Leave” button, it is checked that the customer with the given name is shown on the table “Kristuvach”, and that the login and password have been entered correctly. The Form Class Description area describes the parameters that are passed to the sql command. There are three parameters: the client’s nickname, his login and password.

private string parfam, parpasw, parlog;

The space of names includes the following row:

using System.Data.SqlClient;

// Observer of the moment of pressing the “Leave” button

string sql = "";

string connstr = @ "Data Source = B302CN-8 \ TEST_SQL; Initial Catalog = Travel Agency; Integrated Security = True";

SqlDataReader cmReader;

parfam = comboBox1.Text; parlog = textBox1.Text;

SqlConnection conn = new SqlConnection(connstr);

sql = "SELECT Nickname, Name, Password FROM Koristuvachi" +

"WHERE (Nickname = @fam) and (Password [Email protected])";

SqlCommand cmdkod = new SqlCommand(sql, conn);

cmdkod.Parameters.Add(new SqlParameter("@fam", SqlDbType.NChar, 25));

cmdkod.Parameters["@fam"]. Value = parfam;

cmdkod.Parameters.Add(new SqlParameter("@pasw", SqlDbType.NChar, 10));

cmdkod.Parameters["@pasw"]. Value = parpasw;

cmdkod.Parameters.Add(new SqlParameter("@log", SqlDbType.NChar, 15));

cmdkod.Parameters["@log"]. Value = parlog;

if (!cmReader.Read())

MessageBox.Show("Wrong password!");

cmReader.Close(); conn.Close();

menuStrip1.Enabled = true; comboBox1.SelectedIndex = -1;

button1.Enabled = false; button2.Enabled = true;

textBox1.Text = ""; textBox1.Enabled = false;

textBox2.Text = ""; textBox2.Enabled = false;

comboBox1.Enabled = false;

cmReader.Close();

private void button2_Click(object sender, EventArgs e)

menuStrip1.Enabled = false; comboBox1.Enabled = true;

textBox1.Enabled = true; textBox2.Enabled = true;

button1.Enabled = true; button2.Enabled = false;

Description of the work of the collector after pressing the “Leave” button.

Row connstr to match the row of connection. The text of the formed query is written to the sql row, starting from the select statement, after which the fields in the table are selected after the word from.

The processor creates a new instance of the SqlConnection object, which will provide connections to the SQL server. The SqlCommand object will place a command with three parameters to search in the “Koristuvach” table for a customer with the given nickname, username and password. The button1_Click button opens the SqlConnection. Next, the analyzer writes the SQL command, which is saved in the cmdkod object.

cmReader = cmdkod.ExecuteReader();

As a result of calling the ExecuteReader method, an object of the SqlDataReader class is created, which allows you to sequentially read all the rows of the SQL command. To select a vikoryst, the SqlDataReader method is used. Read. If the “Correspondents” table does not contain the same record with the given name, name and password, then the cmReader.Read() method is set to false. This means that an incorrect login or password has been entered. In this window, notifications about incorrect data entries are displayed and the cmReader and SqlConnection objects are closed. If the accountant's details are entered correctly, the menu and the “Change accountant” button become available. The “Leave” button becomes inaccessible. The textBox1 and textBox2 elements are cleared and become inaccessible. The comboBox1 element also becomes inaccessible (Figure 2)

Malyunok 2. The shape of the head window after the koristuvach enters the system

Tables and query results will be displayed on the DataGridView controls. The main importance of these elements is the connection with the tables of external data sources, first of all with the tables of databases. To make it easier to review and enter new entries, the “Seasons”, “Tours” and “Trips”, “Payment” tables will be displayed two in one window. The DataGridView control element is connected to the Travel Agency database table. This week contains the table “Tourists” (little 3). After completing the connection (pressing the “Finish” button), the DataSet, BindingSource and TableAdapter components appear on the form. These components are not visual, so they are displayed on the additional panel. DataSet is a special object that contains a database image. To facilitate interaction between the DataSet and the data source, an object of type TableAdapter is created. The very name of this object - adapter, transformer - indicates its nature. TableAdapter contains Fill and Update methods, which combine forward and backward data transfer between the DataSet and the table stored in the SQL server database. The Fiil method updates the DataSet with data from the SQL server, and the Update method updates the SQL server database with data from the local DataSet. The BindingSource component makes it easy to bind form controls to data. The main power of the BindingSource component is the power of the Data Source, which refers to the body of data.

After completing the connection to the table of data in the program code of the form, a subscript Form2_Load appears.

private void Form2_Load(object sender, EventArgs e)

this.tourismTableAdapter.Fill (this.travel agencyDataSet9.tourism);

When the form is selected, the data that is located in the “Tourists” table is displayed on the DataGridView control element on the form window Form2. You can make changes to the table and add new entries. After making changes, click on the “Save Tourists” button. A summary of the pressure on the “Save Tourists” button:

private void button1_Click(object sender, EventArgs e)

seasonsTableAdapter.Update(travel agencyDataSet9);

MessageBox.Show("Saving data");

Malyunok 3. View of the window with the “Tourists” table

The skin will be displayed on the side window. On the Form1 window, in the “Request” menu, a new item with the name of the request is added. Since the query does not have parameters, to display the results of the query, the DataGridView control element is installed on the form window and contacted with a related procedure or database function.

This article outlines methods for developing add-ons that work with databases, ways to organize access to work with a shared-stake system, and ways to integrate Visual C# add-ons with a Microsoft SQL Server 2012 DBMS server. Competitive language programming Visual C# with SQL You can create additional additions with a wide range of options. The main power of SQL lies in capturing data. How many rows there are in the table can be drawn using a single SELECT statement. At the same time, the main shortcoming of the SQL language is its shortcomings in the client interface. With the help of procedural methods, you can create manual interfaces for entering and reviewing data. The most advanced method of combining SQL with procedural language is called SQL propagation. The SQL statement is inserted into the required place in the procedural program. Information is transferred between a program written in procedural language and SQL code. Why are the basic changes being used? In order for SQL to recognize the changes, they must be voted on. Please vote in the area of ​​class form description to program code description. In the program code, a new instance of the SqlConnection object will provide connections to the SQL server. The SqlCommand object will ensure that the transmitted SQL command is displayed.

List of references:

  1. Allen Taylor. SQL for dummies, 8th edition: Transl. from English - M.: LLC "I.D. Williams", 2014. - 416 p.
  2. Gainanova R.Sh. Development of add-ons for working with MS SQL Server 2012 databases // Fundamental and applied sciences today: Proceedings of the XI International Practical Conference (10-11 quarter 2017 Noth Charleston, USA), volume 3 - p. 34-41.
  3. Frolov A.V., Frolov G.V. Visual design of C# add-ons. - M.: KUDRITS-OBRAZ, 2003 - 512 p.