{sections}

 

{lessontitle}

5.8 SQL Review

SQL WindowThe databases in CHPS are either PostgreSQL or FirebirdSQL. Both types of database management software are extensions of the SQL language.

DbVis is equipped with an SQL Command feature. Recall the basics of SQL language and you can query the database to find data quickly.

Hint: Click the image to enlarge/shrink.

Examples of the basic commands are SELECT, FROM, ORDER BY, AND, WHERE, etc. Notice the SQL commands are English words, not code. Some commands have dire consequences when used incorrectly.

Example: The phrase DROP TABLE, permanently deletes your table if entered into the SQL Command prompt. While there may be a time where you want to delete a table or database (though not common), this is a good example of how important it is to know the function of each word.

Here are a couple common queries useful in DbVis:

Query Example
SELECT * (then put your table name); SELECT * from TimeSeries;
SELECT * from fews.00.timeseries where <information here>; SELECT * from fews00.timeseries where moduleinstance='name';

References: Basic SQL Course, Another Basic SQL Course, and the developer's website, dbvis.com.