
 | an exemple... |  |
| |
I have created a small example to illustrate the use of this program. It is about a very simple database which might be used by a small company selling
computers. It has 5 tables which are:
- 'manufacturer': the list of hardware manufacturers;
- 'elt_type': all the different components which can be assembled into a computer;
- 'computers': the computers that our shop is selling;
- 'components': the list of components taken from 'elt_type' for each computer in 'computers';
- 'used_computers': list of some computers used, with their name and IP adresses, and an optionnal picture for the kind of OS running on that computer.
1) list of some computers used, with their name and IP adresses, and an optionnal picture for the kind of OS running on that computer.
2) Window showing all the relations : This dialog displays all the relations between tables' fields and between sequences and tables' fields. To make a table or sequence appear/disappear
from the displayed ones, click on the column in the left. Hidden tables/sequences will remenber their last position.
Note: The relations are set from the properties of a table (from the main window, select a table of view and click on the 'Properties' button).
The example below shows that:
- the components.id field has a default value which is given by the components_id_seq sequence
- the components.compid field references a value among the computers.id field values (like a foreign key).
3) Listing all the SELECT queries
4) query editing : This dialog allows one to edit a query. On the top are the tables and the relations that the user want to be inserted into the SELECT query, and at the
bottom the notebook to edit the query..
Only SELECT queries can be made graphically, and that interface is not yet complete). The queries to UPDATE, DELETE or INSERT are created by
gASQL from the SELECT one, and from its knowledge of the database structure.
Explanations of the picture below: :
- The first tab (shown here) lists all the objects in the query (objects are atomic values like table's fields, functions, aggregates, and can be
combined to have something more complex).
- The second tab (Automatic dependencies) allows fine control over which dependencies are used in the query. They can be updated
automatically to use the ones appearing in the top part of the query editor.
- The 3rd and 4th tab are not yet implemented and are quite obvious.
- The last tab gives the user the actual SQL query, and it is possible to modify that SQL statement.
5) query execution : This dialog displays the result of a query. The columns are the ones of the query. Explanations on the picture below:
- On the top right is the table which will be modified if an entry is modified from this dialog (the table can be changed). The columns marked with a
kind of pencil are the ones belonging to the marked table.
- Right clicking in the list will give a small popup menu.
6) Edition of one entry shown in that same query
 | |
| | |
|
|