background image
<< Adding a NOT NULL Constraint in SQL Script | Adding a Foreign Key Constraint >>
<< Adding a NOT NULL Constraint in SQL Script | Adding a Foreign Key Constraint >>

Adding a Primary Key Constraint

Creating and Using Tables
Creating and Using Database Objects 3-9
5.
In the Confirmation window, click OK.
You have now created a unique constraint for the
scores
table.
The following SQL statement was added to your table definition:
CONSTRAINT "SCORES_EVAL_PERF_UNIQUE" UNIQUE ("EVALUATION_ID", "PERFORMANCE_ID")
To add a primary key constraint using the SQL Developer interface:
You will add a primary key constraint to the
performance_parts
table using the
SQL Developer graphical interface. You could also use the Edit Table window, as in the
NOT NULL
constraint, to accomplish this task.
1.
In the Connections navigation hierarchy, click the plus sign (+) next to Tables to
expand the list of tables.
2.
Right-click the
performance_parts
table.
3.
Select Constraint, and then select Add Primary Key.
4.
In the Add Primary Key window, enter the following information:
Set the primary key name to
PERF_PERF_ID_PK
.
Set Column 1 to
PERFORMANCE_ID
.
Click Apply.