Jump to: navigation, search

EclipseLink/Examples/REST/GettingStarted/DatabaseModel

< EclipseLink‎ | Examples‎ | REST‎ | GettingStarted
Revision as of 14:28, 17 August 2010 by Blaise.doughan.oracle.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

CUSTOMER Table

CREATE TABLE "CUSTOMER" 
 ( "ID" NUMBER NOT NULL ENABLE, 
 "FIRST_NAME" VARCHAR2(50), 
 "LAST_NAME" VARCHAR2(50), 
 CONSTRAINT "CUSTOMER_PK" PRIMARY KEY ("ID") ENABLE
 )
/

ADDRESSS Table

CREATE TABLE "ADDRESS" 
 ( "ID" NUMBER NOT NULL ENABLE, 
 "STREET" VARCHAR2(50), 
 "CITY" VARCHAR2(50), 
 CONSTRAINT "ADDRESS_PK" PRIMARY KEY ("ID") ENABLE, 
 CONSTRAINT "ADDRESS_FK" FOREIGN KEY ("ID")
 REFERENCES "CUSTOMER" ("ID") ENABLE
 )
/

PHONE_NUMBER Table

CREATE TABLE "PHONE_NUMBER" 
 ( "ID" NUMBER NOT NULL ENABLE, 
 "TYPE" VARCHAR2(50), 
 "NUM" VARCHAR2(50), 
 "ID_CUSTOMER" NUMBER, 
 CONSTRAINT "PHONE_NUMBER_PK" PRIMARY KEY ("ID") ENABLE, 
 CONSTRAINT "PHONE_NUMBER_FK" FOREIGN KEY ("ID_CUSTOMER")
 REFERENCES "CUSTOMER" ("ID") ENABLE
 )
/