I'm folling an example and I'm not so big when it comes to working with databases yet alone trying to work with an example using another DB service.
I'm running MySQL and I'm using "Client for MySQL" as a GUI. I've got the table creation down, but I'm not sure how to create the references and index. I see the idea behind them when it comes to selecting data just not sure how to create them in MySQL syntax.
CUSTOMER Table
1234567 CREATE TABLE "CUSTOMER" ( "ID" NUMBER NOT NULL ENABLE, "FIRST_NAME" VARCHAR2(50), "LAST_NAME" VARCHAR2(50), CONSTRAINT "CUSTOMER_PK" PRIMARY KEY ("ID") ENABLE ) /
ADDRESS Table
123456789 CREATE TABLE "ADDRESS" ( "ID" NUMBER NOT NULL ENABLE, "STREET" VARCHAR2(50), "CITY" VARCHAR2(50), CO开发者_高级运维NSTRAINT "ADDRESS_PK" PRIMARY KEY ("ID") ENABLE, CONSTRAINT "ADDRESS_FK" FOREIGN KEY ("ID") REFERENCES "CUSTOMER" ("ID") ENABLE ) /
PHONE_NUMBER Table
12345678910 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 ) /
Google for "MySQL Migration Toolkit". The program is no longer maintained by you can probably get a copy somewhere in MySQL's site.
精彩评论