ALTER TABLE market_transactions ADD FOREIGN KEY (buyer_id) REFERENCES accounts (id) ON DELETE SET NULL ON UPDATE CASCADE; Query OK, 128 rows affected (0.09 sec) Records: 128 Duplicates: 0 Warnings: 0