title: Type reference scope
body: <p>I'm studying databases and am currently working on a object-relational DB project and I've encountered a small problem with the number of possible constraints in an object table. I'm using "Database Systems: The Complete Book" by Hector Garcia-Molina (and other authors) as a reference and there's a general SQL example like this:</p>
  
  <pre><code>CREATE TYPE StarType AS (
    name CHAR(30),
    address AddressType,
    bestMovie REF(MovieType) SCOPE Movies
  );
  </code></pre>
  
  <p>Now, I have a kind of a similar type in my project, as it also uses reference to another type within a type, but the clause for placing a reference there doesn't include SCOPE in Oracle (at least I haven't found it in the docs and it outputs an error). So I have a type like this:</p>
  
  <pre><code>CREATE OR REPLACE TYPE "ApplicationType" AS OBJECT (
    "person" REF "PersonType",
    "competition" REF "CompetitionType",
    "dateApplied" DATE
  );
  /
  </code></pre>
  
  <p>...which works. But when I want to constrain the REF columns, I can constrain only one, as so:</p>
  
  <pre><code>CREATE TABLE "Applications" OF "ApplicationType" (
    "person" SCOPE IS "People" /* or "competition" SCOPE IS "Competitions" */
  )
  OBJECT IDENTIFIER IS SYSTEM GENERATED;
  </code></pre>
  
  <p>Is there any way to give constraints to both REF columns?</p>