BEGIN TRANSACTION;
DROP TABLE IF EXISTS `tbNote`;
CREATE TABLE IF NOT EXISTS `tbNote` (
	`id`	INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
	`id_et`	INTEGER NOT NULL,
	`i_mat`	INTEGER NOT NULL,
	`note`	REAL CHECK(note >= 0 and note <= 20)
);
INSERT INTO `tbNote` (id,id_et,i_mat,note) VALUES (1,1,1,15.0),
 (2,2,1,14.0),
 (3,3,1,12.0),
 (4,4,1,14.0),
 (5,5,1,8.0),
 (6,1,2,4.0),
 (7,2,2,8.0),
 (8,3,2,15.0),
 (9,4,2,10.0),
 (10,5,2,5.0),
 (11,1,3,8.0),
 (12,2,3,17.0),
 (13,3,3,16.0),
 (14,4,3,8.0),
 (15,5,3,3.0);
DROP TABLE IF EXISTS `tbMat`;
CREATE TABLE IF NOT EXISTS `tbMat` (
	`id`	INTEGER UNIQUE,
	`lib`	TEXT,
	`coef`	INTEGER,
	PRIMARY KEY(`id`)
);
INSERT INTO `tbMat` (id,lib,coef) VALUES (1,'Maths',3),
 (2,'Info',10),
 (3,'EEA',5);
DROP TABLE IF EXISTS `tbEt`;
CREATE TABLE IF NOT EXISTS `tbEt` (
	`id`	INTEGER UNIQUE,
	`lib`	TEXT,
	PRIMARY KEY(`id`)
);
INSERT INTO `tbEt` (id,lib) VALUES (1,'Durand'),
 (2,'Dupond'),
 (3,'Martin'),
 (4,'Durant'),
 (5,'Marquez');
COMMIT;
