Rabu, 07 September 2011

Mencoba Oracle


Belajar Database Oracle ,,,  membuat primary key and foreign key

CREATE table "TES1" (
    "NIM"        CHAR(8),
    "NAMA"       VARCHAR2(25),
    "NILAI"      NUMBER,
    "TUGAS"      NUMBER,
    "TGL"        DATE
)
/


alter table "TES1" add constraint  "TES1_PK" primary key ("NIM","NIM")
/


ALTER TABLE "TES1" ADD CONSTRAINT "TES1_FK2" 
FOREIGN KEY ("NAMA")
REFERENCES "MHS" ("NAMA")


/

1 komentar: