Contents Index Lesson 2: Connect to your database Lesson 4: Identify and create primary keys

ASA Getting Started
  Designing and Building Your Database
    Tutorial: Design and build a simple database

Lesson 3: Design and create a table


In this lesson, you add a table to your database.

Concepts 

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.

The Product table.

In the product table from the sample database, above, each product is an item of sports clothing.

Exercise 

Create a simplified version of the product table, containing only the identifier (id) and name columns.

To create the product table

  1. In Sybase Central, connect to your database if you are not already connected.

  2. Open the Tables folder in your database.

    First open the server and database containers, then open the Tables folder.

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

    The Table Creation wizard appears.

  4. Name your table product.

  5. Click Finish.

  6. Select the product table in the left pane, then click the Columns tab in the right pane.

  7. Create the columns.

    From the File menu, choose Add column and add a column with the following properties:

    You can ignore the other properties. Add a second column with the following properties:

  8. 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.


Contents Index Lesson 2: Connect to your database Lesson 4: Identify and create primary keys