SQL Guide

SQL– short for Structured Query Language – is a widely used language in database applications. Its main use is in retrieving information, usually only information that is of particular interest (a query).

SQL can be used in two places in Ability:

Database

using the View SQL button in the query dialog (View/Query)

Database functions

most of the database linking functions support SQL e.g. DBSQL(). These allow SQL to be used in Write or Spreadsheet to retrieve data.

Ultimately, Ability uses SQL for all its database operations – for example, creating and deleting tables and indexes. These types of operation are not covered here.

This guide covers five main types of SQL statement:

Selecting records (see Selecting records - the basics)

selecting all records from a table, selecting by column and by row

Aggregate and group selection (see Groups and aggregate functions)

summary information on tables

Crosstabulations (see Crosstabulations)

crosstabs (or contingency tables)

Relational joins (see Relational links and joins)

linking two tables together

Editing tables (see Editing records)

updating, adding and deleting records

If you are new to SQL, the best place to start your reading is with the section Selecting records, since this topic covers ground required for later topics.