-- CREATION ET DONNEES DE LA TABLE LECTEURS


CREATE TABLE `lecteurs` (
`IDlecteur` int(10) unsigned NOT NULL auto_increment,
`Nom` varchar(255) NOT NULL,
`Prenom` varchar(255) NOT NULL,
`CodeStatut` char(1) NOT NULL,
`Adresse` varchar(255) default NULL,
`CodePostal` char(5) default NULL,
`Ville` varchar(255) 
default NULL,
`Ville_utf8` varchar(255) character set utf8 collate utf8_unicode_ci 
default NULL,
`Bloque` tinyint(1) unsigned NOT NULL default '0',
`Amende` decimal(5,2) unsigned NOT NULL default '0.00',
`Compte` varchar(255) character set latin1 collate latin1_bin default 
NULL,
PRIMARY KEY (`IDlecteur`),
KEY `CodeStatut` (`CodeStatut`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lecteurs`
--


INSERT INTO `lecteurs` VALUES (1,'Karimova','Olga','N','12 rue de Vaugirard','75006','Paris','Paris',1,'0.00',NULL),(2,'Lemarchand','Julien','N','95 bd Richard Lenoir','75011','Paris','Paris',0,'0.00',NULL),(3,'Baudon','Jacques','S','3 avenue de l\'épi d\'or','94800','Villejuif','Villejuif',0,'0.00',NULL),(4,'von Schmuck','Eliette','D','4 avenue de l\'Opera','75002','Paris','Paris',0,'0.00',NULL),(5,'Legrand','Isabelle','N','25 rue Poliveau','75005','Paris','Paris',0,'0.00',NULL),(6,'Nelson','Melody','N',NULL,NULL,'Saint-Mandé','Saint-Mandé',0,'0.00',NULL),(7,'Elaeudanla Teïtéïa','Lætitia','N',NULL,NULL,'SAINT-MANDE','SAINT-MANDE',0,'0.00',NULL),(8,'Barrow','Clyde','N',NULL,NULL,'OEUF-EN-TERNOIS','OEUF-EN-TERNOIS',0,'0.00',NULL),(9,'Parker','Bonnie','N',NULL,NULL,'?uf-en-Ternois','ŒUF-EN-TERNOIS',0,'0.00',NULL),(10,'Brown','Charlie','N',NULL,NULL,'PARIS','PARIS',0,'0.00',NULL);


-- CREATION ET DONNEES DES TABLES CHIFFRES ET OCTET

CREATE TABLE chiffres (num tinyint unsigned not null);

INSERT INTO chiffres(num)
VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);

Create table octet (num tinyint unsigned not null);

INSERT INTO octet(num)
SELECT c.num * 100 + d.num * 10 + u.num
FROM chiffres AS c, chiffres AS d, chiffres AS u
WHERE c.num * 100 + d.num * 10 + u.num <= 255
ORDER BY 1;

