Professional Documents
Culture Documents
09/10/2011 09/10/2011
mySQL 4.0
Create table hotel ( HotelID Char(20) NOT NULL, Hotelname Char(20), Primary Key (HotelID)) TYPE = MyISAM ROW_FORMAT = Default; Create table Room ( RoomID Char(20) NOT NULL, Roomname Char(20), HotelID Char(20) NOT NULL, Primary Key (RoomID,HotelID)) TYPE = MyISAM ROW_FORMAT = Default;
Alter table Room add Index IX_memiliki (HotelID); Alter table Room add Foreign Key (HotelID) references hotel (HotelID) on delete restrict on update restrict;