Creating the Country Table
Creating the Country Table
The first table—the Country table—has two columns. The column definitions are separated by commas. For each column, the first word is the column name and the following words are characteristics. The first column, country, has the COUNTRYNAME domain and in addition is NOT NULL and a primary key. Primary keys are discussed in a following section of this tutorial.
- If you are not already connected, in IBConsole, connect to tutorial.gdb as TUTOR.
- In the Interactive SQL dialog enter the following CREATE TABLE statement. The layout below is for ease of reading; the line endings are not required:
- CREATE TABLE Country (
- country COUNTRYNAME NOT NULL PRIMARY KEY,
- currency VARCHAR(10) NOT NULL)
- Notice that the collection of column definitions is surrounded by parentheses and that the columns are separated by commas.
- CREATE TABLE Country (
- Execute the statement click (
), press F5 or choose Query > Execute. If you entered the code without errors, the tables now exist in the database in IBConsole. Choose Tables from the left pane.