 CREATE TABLE Historic(
	Test_Name CHAR(128) NOT NULL,
	Project   CHAR(128) NOT NULL,
	Testing_Date CHAR(15) NOT NULL,
	Instruction_Fetch INTEGER NOT NULL,
	Read_Access INTEGER NOT NULL,
	Write_Access INTEGER NOT NULL,
	Instruction_Cache_Miss_Lv1 INTEGER NOT NULL,
	Read_Cache_Miss_Lv1 INTEGER NOT NULL,
	Write_Cache_Miss_Lv1 INTEGER NOT NULL,
	Instruction_Cache_Miss_Lv2 INTEGER NOT NULL,
	Read_Cache_Miss_Lv2 INTEGER NOT NULL,
	Write_Cache_Miss_Lv2 INTEGER NOT NULL,
	Total_Cache_Miss_Lv1 INTEGER NOT NULL,
	Total_Cache_Miss_Lv2 INTEGER NOT NULL,
	Cicles_Estimation INTEGER NOT NULL,
	PRIMARY KEY (Test_Name,Testing_Date,Project)
);

CREATE TABLE Alarms(
	Test_Name CHAR(128) NOT NULL,
	Project   CHAR(128) NOT NULL,
 	Alarm ENUM ('Green', 'Red') NOT NULL,
	Bound INT UNSIGNED NOT NULL,
	IsDefaultBound BOOLEAN NOT NULL,
	PRIMARY KEY (Test_Name,Alarm,Project),
	FOREIGN KEY (Test_Name) REFERENCES Historic(Test_Name)
);

CREATE TABLE Reference(
	Test_Name CHAR(128) NOT NULL,
	Project   CHAR(128) NOT NULL,
	Instruction_Fetch INTEGER NOT NULL,
	Read_Access INTEGER NOT NULL,
	Write_Access INTEGER NOT NULL,
	Instruction_Cache_Miss_Lv1 INTEGER NOT NULL,
	Read_Cache_Miss_Lv1 INTEGER NOT NULL,
	Write_Cache_Miss_Lv1 INTEGER NOT NULL,
	Instruction_Cache_Miss_Lv2 INTEGER NOT NULL,
	Read_Cache_Miss_Lv2 INTEGER NOT NULL,
	Write_Cache_Miss_Lv2 INTEGER NOT NULL,
	Total_Cache_Miss_Lv1 INTEGER NOT NULL,
	Total_Cache_Miss_Lv2 INTEGER NOT NULL,
	Cicles_Estimation INTEGER NOT NULL,
	PRIMARY KEY (Test_Name,Project)
);
