01.09.2017, 17:59
That wasn't really my point. My question to you is: why create an empty table to fill it later instead of creating the entire table in one go? These days I much rather prefer to type everything by hand because I find it at least equally as fast as clicking through a GUI.
This is what a typical CREATE TABLE statement looks like:
This is what a typical CREATE TABLE statement looks like:
PHP код:
CREATE TABLE AccountWeapon (
accountid INT UNSIGNED NOT NULL,
weaponid INT UNSIGNED NOT NULL,
ammo INT UNSIGNED NOT NULL,
CONSTRAINT PRIMARY KEY (accountid, weaponid),
CONSTRAINT FOREIGN KEY (accountid) REFERENCES Account(id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FOREIGN KEY (weaponid) REFERENCES Weapon(id) ON DELETE RESTRICT ON UPDATE RESTRICT
);