Getting started with SQL

SQL is a standardized language for defining and manipulating data in a relational database. You can create and work with schemas, tables, and views by using SQL statements in interactive SQL directly.

The syntax for each of the SQL statements used in these topics is described in detail and descriptions of how to use SQL statements and clauses in more complex situations are provided in the Db2 for IBM i SQL reference topic collection.

In these topics, the examples use the interactive SQL interface to show the use of SQL statements. Each SQL interface provides methods for defining tables, views, and other objects; for updating the objects; and for reading data from the objects.

First, start interactive SQL:

  1. Type STRSQL NAMING(*SQL).
  2. Press Enter.
When the Enter SQL Statements display appears, you are ready to start typing SQL statements.

If you are reusing an existing interactive SQL session, make sure that you set the naming mode to SQL naming. You can specify this on the F13 (Services) panel, option 1 (Change session attributes).