O'Reilly logo

OCA Oracle Database 11g: SQL Fundamentals I: A Real-World Certification Guide by Steve Ries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extending the Companylink Data Model

Thus far, we've learned about the syntax and use of constraints using simple test tables. In this section, we take what we've learned and apply it to creating new tables and constraints in our Companylink database.

Adding constraints to Companylink tables

Our Companylink tables have been designed as a fully relational model. Each table has an ID column that relates to another table, although no constraints exist. We can take what we've learned thus far and add constraints to our Companylink tables. Our model is centered on our employee table, so we can start there.

Adding referential integrity

In this example, we add a primary key to our employee table:

Our existing values in the employee_id column meet the requirements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required