fluvial architecture knowledge transfer system (fakts): database interrogation through sql queries

39
Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries Luca Colombera, Nigel P. Mountney Fluvial & Eolian Research Group – University of Leeds

Upload: imogene-phelps

Post on 01-Jan-2016

64 views

Category:

Documents


1 download

DESCRIPTION

Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries. Luca Colombera, Nigel P. Mountney. Fluvial & Eolian Research Group – University of Leeds. Querying FAKTS. Two alternative ways to interrogate FAKTS : - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

Fluvial Architecture Knowledge Transfer System (FAKTS):

database interrogation through SQL queries

Luca Colombera, Nigel P. Mountney

Fluvial & Eolian Research Group – University of Leeds

Page 2: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

Querying FAKTS

Two alternative ways to interrogate FAKTS:

- WEB-BASED FRONT-END hosted on FRG website.

Easy to use, but of limited capability. Queries can be run on the website without requiring download of software or data.

- SQL QUERIES on MySQL.

More difficult to use, but it enables full database interrogation.Queries are run locally, requiring download of software (MySQL and HeidiSQL) and database.

Page 3: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Fully searchable but requires SQLknowledge:

-output referring to any type of genetic unit can be generated;

- any type of output can be queried (including proportions, grain size, etc.);

- all available filters can be applied;

- it is possible to tailor the query so that output does not require further data analysis.

Page 4: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Interrogation of FAKTS through MySQL queries requires having MySQL (back-end) and HeidiSQL (front-end) installed locally.

The software, database and documentation can be downloaded from the FRG website (Doc ID: 598)

MySQL HeidiSQLFAKTS +documents

Page 5: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Once all software is installed (see FAKTS manual for instructions), users can login to the local MySQL server using HeidiSQL.

Page 6: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The screen will appear as above: now FAKTS can be loaded.

Page 7: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The FAKTS dump file needs to be chosen, opened and run.

Page 8: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The FAKTS dump file needs to be chosen, opened and run.

Page 9: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Now, if you refresh (F5)…

Page 10: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

…the FAKTS database will appear on the database panel.

Page 11: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

If you click on the database, you will select it.

Page 12: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

You can now query FAKTS by writing or loading a query in a tab.

Page 13: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

You can write a query in the query editor panel.

Page 14: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Information on SQL syntax and functions can be found in Chapters 12 and 13 of MySQL manual: http://dev.mysql.com/doc/refman/5.6/en/index.html.

Page 15: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

For example, we can write a query for the thickness of channel complexes from sparsely vegetated basins.

Page 16: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Then we can click on ‘Execute SQL’, or press F9.

Page 17: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Results will appear in the panel at the bottom.

Page 18: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Let’s open a new query tab and load a template query.

Page 19: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Click on ‘Load SQL file’ or press ctrl + O.

Page 20: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The ‘template query’ folder contains over 50 SQL scripts.

Page 21: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

To guide the choice of a script suitable for your specific scopes, the ‘template query’ document should be referred to.

Page 22: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

To guide the choice of a script suitable for your specific scopes, the ‘template query’ document should be referred to.

Page 23: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

Let’s say we are interested in the types and thicknesses of facies units overlying a 4th-order channel base: we open tq_32.

Page 24: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

In particular, we are interested in information on facies units overlying the base of crevasse channels.

Page 25: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

After identifying the clause that specifies the architectural element type, we edit the script changing ‘CH’ into ‘CR’.

Page 26: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

After editing the script, we can run the query.

Page 27: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The results are returned in the bottom panel.

Page 28: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The query we have just run entailed the generation of a temporary table: if we want to edit and run the same script we need to…

Page 29: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

…either edit the script re-naming the temporary table (in addition to the changes required for obtaining the desired output),…

Page 30: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

…or open a new session, in which the same query can be run, without requiring re-naming the temporary table.

Page 31: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

…or open a new session, in which the same query can be run, without requiring re-naming the temporary table.

Page 32: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The new output – referring to facies units overlying the base of LA barform elements – is now displayed.

Page 33: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The queries can be designed in a way that all required functions are included: the results do not require any further processing.

Page 34: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

If we want to export the results: we can right click on them…

Page 35: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

…and select ‘Export grid rows’.

Page 36: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

The results can now be exported conveniently as CSV file.

Page 37: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

After exporting either all the results or the selected rows...

Page 38: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

MySQL queries

…the FAKTS output can be further analysed or graphed after opening the CSV file using Excel.

Page 39: Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries

Conclusions

FAKTS interrogation

MySQL queries FRG website- user-friendly menu-driven front-end;

- depositional and architectural elements currently included;

- dimension and transition data currently made available;

- limited number of filters;

- output is given in the form of raw data, which may require further analysis.

Further developments will follow.

- HeidiSQL front-end requires basic SQL knowledge;

- output referring to any type of genetic unit can be generated;

- any type of output can be queried (including proportions, grain size, etc.);

- all available filters can be applied;

- it is possible to tailor the query so that output does not require further data analysis.