In this lesson, you create a table named Products.
For information about designing tables, see Designing the database table properties.
In the right pane of Sybase Central, double-click the Tables folder.
From the File menu, choose New > Table.
The Create Table wizard appears.
Name your table Products.
The database server creates the table using defaults, and then displays the Columns tab in the right pane. Each row in the Column tab defines a column in the table.
Define the first column in your table, and make it the primary key.
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.
PKey Place a checkmark in the PKey column to specify that the column is used as part of the primary key for the table.
Name Give the column a name of ProductID.
Data Type Specify the data type as follows:
Give the column the integer data type.
An ellipsis displays in the right half of the Data Type column.
Select the ellipsis to access the property sheet for the column.
On the Value tab, select Default Value.
Select System-defined, and then choose autoincrement from the dropdown list.
Click OK to close the Column property sheet.
Create an additional column.
From the File menu, choose New > Column, and add a column with the following properties:
Name Give the column a name of ProductName.
Data Type Give the column the char data type.
Size Enter a maximum length of 15 in the Size column.
From the File menu, choose Save.