/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
CREATE TABLE a (
	A_UPPERCASE_ID INT NOT NULL PRIMARY KEY,
	b_ref INT NOT NULL,

	FOREIGN KEY (b_ref) REFERENCES b (b_uppercase_id)
);

CREATE TABLE b (
	B_UPPERCASE_ID INT NOT NULL PRIMARY KEY
);

CREATE TABLE c (
	C_UPPERCASE_ID INT NOT NULL PRIMARY KEY,
	b_ref INT NOT NULL,

	FOREIGN KEY (b_ref) REFERENCES b (b_uppercase_id)
);
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
