Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - SQL Usage » Designing and Creating Databases » Designing and creating your database » Tutorial: Creating a SQL Anywhere database


Lesson 3: Create a table

In this lesson, you create a table named Products.

For information about designing tables, see Designing the database table properties.

To create a table

  1. In the right pane of Sybase Central, double-click Tables.

  2. Right click the Tables pane and choose New » Table.

  3. In the What Do You Want To Name The New Table field, type Products.

  4. Click Finish.

    The database server creates the table using defaults, and then displays the Columns tab in the right pane. Each row in the Columns tab defines a column in the table.

  5. In the first column of your table, click PKey and type ProductID in the Name field.

    A primary key can comprise several columns concatenated together. For the purposes of this tutorial, however, the primary key contains only one column, which has a value that is automatically incremented for each row added to the table. The autoincrement property ensures that values are unique—a requirement for primary keys. See Primary keys.

  6. In the Data Type list, select Integer.

  7. Click the ellipsis (three dots) button.

  8. Click the Value tab and choose Default Value » System-Defined » Autoincrement

  9. Click OK.

  10. From the File menu, choose New » Column.

  11. Complete the following fields:

    • In the Name field, type ProductName.
    • In the Data Type list, select Char.
    • In the Size list, select 15.
  12. From the File menu, choose Save.

See also