Introduction

Relational is an educational software. The purpose is to show if the query is correct or not. It doesn't replace and will never be able to replace the knowledge of relational algebra. It is just a tool to check the queries, which can make life easier.
Do not expect it to replace your brain please.

Installing

First you will have to download the appropriate file, and then Install it on your system.

Create your own relation

Before starting, we will create an example relation, that we will use in this tutorial.

Relations are stored into text files. One relation into one file.
By default relations will have .csv extension.

If you aren't interested in creating a new relation because you want to use the examples shipped with the installation, you can skip this.

Open a text editor (for windows user: text editor is notepad, not word!)

Assume we want to write a relation with the fields name, surname, age.
In the 1st line of the file, you will have to write:

name,surname,age

:!: Do not insert spaces between commas

At this point we want to fill the relation with some data, so our file will look like:

name,surname,age
Mark,Markson,35
Carl,Carlson,12
Daniel,Danielson,40

Notice: A relation is a set. It can't contain two identical tuples. Relational will check if the relation is correct when it is loaded but it is a good policy to create correct relations.

At this point we are ready to save the file with a .csv extension.
Notice: In windows, probably notepad will try to add the .txt anyway. To avoid it put the filename between double quotes.

For more details on how to create a relation, see: File format

Launching

That depends on your system.
On GNU/Linux and similar systems, the relational icon is located in the application menu under “Education”. As an alternative you can open a terminal and run “relational”.

On Windows, look for the “Relational” item in the program menu.

On mac you can run the Relational.app file (but check the install_on_mac_osx page 1st).

Load a relation

To load a relation from disk, press the Load relation button.
A file chooser dialog will be shown and you will need to select the file you want to open.
Once you've selected the file, you will be required to give a name to the relation. This name will be used in the queries. Relational will automatically suggest to name the relation like the file, but the name can be changed.

Repeat the operation until you've opened all the relations you're interested in.

Show a relation

Once a relation is opened, you will be able to display it in the center table.
To show a relation, double click on it, in the list within the Relations frame.

You might be interested to show the fields of a relation, without showing it (because you want another relation in the center). To show the fields, single click on a relation in the Relations frame, and the fields will be listed in the Attributes frame.

1st query

The query must be inserted into the large text box at the bottom of the window.
Try writing the name of one of the loaded relations and press Enter. This simple query will result a relation identical to the one requested.

Other queries

By default the resulting query will be named 'last_', but it is possible to override that writing a name for the resulting query in the small textbox in the left-bottom part of the window.

Since most of the symbols aren't present on keyboards, they are provided as buttons on the left part of the screen. Pressing one of those buttons will insert the corresponding symbol at the cursor's position in the query's textbox.

Edit a relation

It is important to note that editing a relation will not make relational automatically save the changes done on the disk, and no warning will be issued if some data will be lost by closing it.

Insert

Inserting a tuple is very simple:
Select an existing relation and then click on the Insert button. A dialog will ask you to insert the values. Insert the values in it using comma to separate them (spaces between commas will not be deleted).

Delete

The Delete button will delete tuples from the shown relation.
It will show a dialog where you will have to insert a condition, like the one used in selection.
The tuples matching the condition will be deleted trom the relation.

Save a relation

A new relation created by a query or by editing a relation inserting and removing tuples can be saved pressing on the Save relation button. It will save the currently selected relation.
A dialog will ask where to save the file.

tutorial.txt · Last modified: 2012/03/07 01:05 by LtWorf
 
Except where otherwise noted, content on this wiki is licensed under the following license: GNU Free Documentation License 1.2
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki