Contents Index Create a table in Sybase Central Delete the office table

Introducing SQL Anywhere Studio
   Tutorial: Managing Databases with Sybase Central
    Lesson 2: Create and edit tables

Edit the Office table


This section describes how to edit an existing table. The steps show you how to add a primary key to the table created in the previous section by turning a column named office_id into a primary key.

Edit the Office table

  1. Open the Tables folder and select the office table.

  2. Give the first row the name of office_id, and assign a data type of small int.

    The checkmark in the PKey column indicates that the column named office_id is the primary key for the table.

    Primary key conditions 
    If a checkmark appears in the Nulls column, or if duplicate values are stored in the office_id column, the column cannot be changed to a primary key.
  3. On the toolbar, click Save Table.

  4. On the toolbar, click Add Column.

  5. Edit the new column so that its name is office_name, its type is char, and its size is 20. Select Nulls so that office_name is allowed to be blank.

  6. Click Save Table.

The column is now in the database, although it contains no data.

Notes 

Contents Index Create a table in Sybase Central Delete the office table