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

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Working with Database Objects » Working with tables

Working with tables Next Page

Creating tables

When a database is first created, the only tables in the database are the system tables, which hold the database schema. You can create new tables to hold your actual data, either with SQL statements in Interactive SQL or with Sybase Central.

There are two types of tables that you can create:

Tables consist of rows and columns. Each column carries a particular kind of information, such as a phone number or a name, while each row specifies a particular entry.

To create a table (Sybase Central)
  1. Connect to a database.

  2. Open the Tables folder.

  3. From the File menu, choose New > Table.

    The Create Table wizard appears.

  4. Follow the instructions in the wizard.

    The new table appears in the Table folder.

  5. On the Columns tab in the right pane, you can add columns to the table.

  6. Choose File > Save when finished.

To create a table (SQL)
  1. Connect to the database as a DBA user.

  2. Execute a CREATE TABLE statement.

  3. Example

    The following statement creates a new table to describe qualifications of employees within a company. The table has columns to hold an identifying number, a name, and a type (technical or administrative) for each skill.

    CREATE TABLE Skills (
       SkillName CHAR( 20 ) NOT NULL,
       SkillType CHAR( 20 ) NOT NULL

    For more information, see CREATE TABLE statement.