In this lesson, you learn about creating relationships between tables using foreign keys.
For information about designing relationships, see Entities and relationships.
In Sybase Central, open the Tables folder.
Open the SalesOrders table.
In the right pane of Sybase Central, click the Constraints tab.
From the File menu, choose New > Foreign Key to open the Create Foreign Key wizard.
Select the Customers table as the table to which you want the foreign key to refer, name the new foreign key CustomerID, and then click Next.
Choose Primary key for the foreign key to reference.
Select ID from the Foreign Column dropdown list, and then click Finish.
Repeat steps 1 through 5 to create the following foreign keys:
A foreign key from the ID column in SalesOrderItems, referencing the ID column in SalesOrders.
A foreign key from the ProductID column in SalesOrderItems, referencing the ProductID column in Products.
A foreign key from the CustomerID column in SalesOrders, referencing the ID column in Customers.
This completes this introductory section on creating relational databases.
For more information on designing databases, see Entities and relationships.