2.7

Table Of Contents
Procedure
1 In the left pane, click the Schemas arrow to expand it.
2 Click the arrow next to the schema to expand it.
3 Select Views in the left pane.
All views under the schema appear in the list in the middle pane.
4 Right-click a view and select Open.
The view appears in the left pane.
5 Click the View Data tab to examine the data associated with the view.
Create a Constraint
Constraints let you reduce data entry errors by verifying data before inserting the data into a table.
You create constraints when you create a table, or you can add them later.
n
Enter SQL fragments to define a constraint.
Prerequisites
n
You are logged in to your organization as an organization administrator or user with database privileges.
n
The database Console is open.
n
The table on which to create the constraint exists.
n
You expanded the schema in the left pane, and selected Tables.
Procedure
1 Click the table to select it, and click the gear icon.
2 Select Create > Constraint.
3 Select a constraint to create.
Constraint Type Description
Check
Limits the values or value range that can be inserted in a column.
Unique
Ensures that a column or set of columns is unique.
Primary key
Uniquely identifies each row in a table. You can have only one primary key
per table.
Foreign key
Points to a primary key in another table.
4 Complete the dialog and click OK.
Data Director creates the constraint.
Example: Create a Check Constraint
A check constraint evaluates to a Boolean value. Use Check constraints to determine whether a value entered
for a column meets a specific truth-type requirement. For example, suppose that you create a column that must
be a positive integer, such as a product price. You can create a Check constraint to return TRUE when the product
price is greater than 0, and to return FALSE when the product price is less than 0. The Check constraint ensures
that if a user tries to enter a negative product price, the data entry operation fails with a SQL error.
1 Click a table to select it.
Chapter 11 Managing Database Entities
VMware, Inc. 145