Introducing SQL Anywhere Studio
Tutorial: Managing Databases with Sybase Central
Lesson 2: Create and edit tables
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
Open the Tables folder and select the office table.
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 conditionsIf 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. |
On the toolbar, click Save Table.
On the toolbar, click Add Column.
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.
Click Save Table.
The column is now in the database, although it contains no data.
Most objects in Sybase Central have property sheets, including tables, users, and stored procedures.
When you click on many of the folders, New item buttons appear in the toolbar. Clicking these buttons creates new objects for the database.
Whenever you select an object in Sybase Central, commands related to that object appear in several places: in the File menu, in a popup menu that you can access by right-clicking the object, and as buttons on the toolbar.
Once you open a container, its contents are cached to improve performance. You can access two refresh commands in the View menu to update the view of either the current container or the entire window.