Published March 28, 2018 by RIT with 0 comment

CARA MEMBUAT FOREIGN KEY PADA MYSQL

Assalamualaikum warohmatullohi wabarokatuh
Wa alaikum salam warohmatullohi wabarokatuh


script membuat foreign key pada MySql

CREATE TABLE Persons (
 ID int NOT NULL,
 LastName varchar(255) NOT NULL,
 FirstName varchar(255),
 Age int,
 PRIMARY KEY (ID) );


CREATE TABLE Orders (
 OrderID int NOT NULL,
 OrderNumber int NOT NULL,
 PersonID int,
 PRIMARY KEY (OrderID),
 FOREIGN KEY (PersonID) REFERENCES Persons(Person) );


sumber : https://www.w3schools.com/sql/
      edit

0 comments:

Post a Comment