User login

login

Help

Help - Query Builder

Querying logic

The RMS database is split into categories of data. These categories are roughly equivalent to tables within a relational database and so we call these categories 'tables'. Each of these tables can be thought of as similar to a simple single spreadsheet table with column headings defining what the data in that column refers to and rows which contain the data, one row per meaningful unit of data.

Tables cross reference each other by including a column that holds a value that can be used to lookup a single row in another table, this is called a 'relationship' between the tables. These relationships are usually, but not always, defined by some numerical index that is unique to each row in the referenced table. These columns are generally name 'id' or have '_id' appended to the name (eg 'marker_id' or 'form_id').

When more than one table is selected the system will try and connect those tables together into one large table using the cross-references (relationships) in order to work out which rows from each table must be put together into one row of the new resulting table. Where the one table has many rows that reference one row in another table that one row must then be presented in the new combined table table for each of the referncing rows. For example;

Modal verbs
ID verb
1 can
2 must, need
3 want
4 cannot
Modal forms
ID Form Verb
1 trubin- 2
2 možin- 1
3 naši 4
4 kam- 3
5 mang- 3
Joined table
Modal forms ID Form Modal verb ID Meaning
1 trubin- 2 must, need
2 možin- 1 can
3 naši 4 cannot
4 kam- 3 want
5 mang- 3 want

Notice how the 'Modal verb' 'want' appears twice in the 'Joined' table, this is because there are two different Forms listed in the 'Modal forms' table that refer to the the 'Modal verb' of 'want'.

Each of the columns from the selected tables are made available in the new table. However, because some tables may contain columns with the same name the column names have to be prepended with the name of the table that they have come from. This is so that the system knows which column from which table you require. This is more evident in the "Columns Selector" in the Query Builder.