CREATE TABLE license_time (
	LicenseTimeID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	MaestroID INT UNSIGNED NOT NULL,
	PlayerID INT UNSIGNED NOT NULL,
	StartTime INT UNSIGNED NOT NULL,
	LeftTime INT NOT NULL,
	SavedDateTime DATETIME NOT NULL,
	SubjectName CHAR(50) NOT NULL,

	FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID),
	FOREIGN KEY (PlayerID) REFERENCES player(PlayerID)
);

CREATE TABLE license_score (
	LicenseScoreID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	MaestroID INT UNSIGNED NOT NULL,
	PlayerID INT UNSIGNED NOT NULL,
	SubjectName CHAR(50) NOT NULL,
	Score INT UNSIGNED NOT NULL,
	ScoreDateTime DATETIME NOT NULL,

	FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID),
	FOREIGN KEY (PlayerID) REFERENCES player(PlayerID)
);

CREATE TABLE license_maestro_password (
	LicenseMaestroPasswordID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	MaestroID INT UNSIGNED NOT NULL,
	Password INT UNSIGNED NOT NULL,

	FOREIGN KEY (MaestroID) REFERENCES maestro(MaestroID)
);