ASA Getting Started
Designing and Building Your Database
Tutorial: Design and build a simple database
In this lesson, you add a table to your database.
Each table in your database should contain information about a single subject. In the language of database design, you are identifying entities. For example, the sample database holds information about employees in one table, and information about products in another table: employees and products are entities within the database design.
For an introduction to tables, see Database tables.
Each column in a table describes a particular characteristic of the thing that you would like to store information about. For example, in the sample database, the employee table has columns that hold an employee ID number, first and last names, an address, and other particular information that pertains to a particular employee.
In database diagrams, each table is depicted by a rectangular box. The name of the table is at the top of the box, and the column names are listed inside the box.
In the product table from the sample database, above, each product is an item of sports clothing.
Create a simplified version of the product table, containing only the identifier (id) and name columns.
To create the product table
In Sybase Central, connect to your database if you are not already connected.
Open the Tables folder in your database.
First open the server and database containers, then open the Tables folder.
From the File menu, choose
The Table Creation wizard appears.
Name your table product.
Click Finish.
Select the product table in the left pane, then click the Columns tab in the right pane.
Create the columns.
From the File menu, choose Add column and add a column with the following properties:
Column Name Give the column a name of id.
PKey Select the checkbox beside the column name so that a checkmark appears, indicating that the column is a primary key.
Data Type Give the column the integer data type.
You can ignore the other properties. Add a second column with the following properties:
Column Name Give the column a name of name. This column holds the product name.
Data Type Give the column the char data type which holds character strings, and enter a maximum length of 15 in the Size column.
To finish, click the Save and Close icon on the far right of the toolbar.
You have now created a table in your database. The table data is held in the database file. At present, the table is empty.
The next two lessons have more to say about columns and data types.