CREATE TABLE `MasterData` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`value` VARCHAR(50) NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`)
);

CREATE TABLE `ReferenceData` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`value` VARCHAR(50) NULL DEFAULT NULL,
	`masterId` INT(11) NOT NULL,
	PRIMARY KEY (`id`),
	INDEX `FK_ReferenceData_MASTER` (`masterId`),
	CONSTRAINT `FK_ReferenceData_MASTER` FOREIGN KEY (`masterId`) REFERENCES `MasterData` (`id`) ON DELETE CASCADE
);