In this lesson, you learn about creating relationships between tables using foreign keys. You use the tables you created in the previous lessons.
In the left pane of Sybase Central, double-click Tables.
In the left pane, click the SalesOrdersItems table to select it.
In the right pane, select the Constraints tab.
Choose File » New » Foreign Key.
In the To Which Table Do You Want This Foreign Key To Refer list, select the Products table.
In the What Do You Want To Name The New Foreign Key field, type ProductIDkey.
Click Next and for Do You Want This Foreign Key To Reference The Primary Key Or A Unique Constraint choose Primary Key.
In the Foreign Column list, click SalesOrdersItemsID.
This completes this introductory section on creating relational databases.
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|