Hvis tabellerne er innodb, kan du oprette det sådan her:
CREATE TABLE accounts(
account_id INT NOT NULL AUTO_INCREMENT,
customer_id INT( 4 ) NOT NULL ,
account_type ENUM( 'savings', 'credit' ) NOT NULL,
balance FLOAT( 9 ) NOT NULL,
PRIMARY KEY ( account_id ),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
) ENGINE=INNODB;
Du skal angive, at tabellerne er innodb, fordi myisam-motoren ikke understøtter fremmednøgle. Se her for mere info.