LOCK TABLES Race WRITE;
INSERT INTO Race VALUES (1,'Berger allemand',1,'Chien sportif et
élégant au pelage dense, noir-marron-fauve, noir ou
gris.',485.00),(2,'Berger blanc suisse',1,'Petit chien au corps
compact, avec des pattes courtes mais bien proportionnées et au
pelage tricolore ou bicolore.',935.00),(3,'Singapura',2,'Chat de
petite taille aux grands yeux en amandes.',985.00),
(4,'Bleu russe',2,'Chat aux yeux verts et à la robe épaisse et
argentée.',835.00),(5,'Maine coon',2,'Chat de grande taille, à
poils mi-longs.',735.00),(7,'Sphynx',2,'Chat sans
poils.',1235.00),
(8,'Nebelung',2,'Chat bleu russe, mais avec des poils
longs...',985.00),(9,'Rottweiller',1,'Chien d''apparence solide,
bien musclé, à la robe noire avec des taches feu bien
délimitées.',600.00);
UNLOCK TABLES;
CREATE TABLE Animal (
id smallint(6) unsigned NOT NULL AUTO_INCREMENT,
sexe char(1) DEFAULT NULL,
date_naissance datetime NOT NULL,
nom varchar(30) DEFAULT NULL,
commentaires text,
espece_id smallint(6) unsigned NOT NULL,
race_id smallint(6) unsigned DEFAULT NULL,
mere_id smallint(6) unsigned DEFAULT NULL,
pere_id smallint(6) unsigned DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY ind_uni_nom_espece_id (nom,espece_id)
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8;
LOCK TABLES Animal WRITE;
INSERT INTO Animal VALUES (1,'M','2010-04-05
13:43:00','Rox','Mordille beaucoup',1,1,18,22),(2,NULL,'2010-03-24
02:23:00','Roucky',NULL,2,NULL,40,30),(3,'F','2010-09-13
15:02:00','Schtroumpfette',NULL,2,4,41,31),
(4,'F','2009-08-03 05:12:00',NULL,'Bestiole avec une carapace très
dure',3,NULL,NULL,NULL),(5,NULL,'2010-10-03 16:44:00','Choupi','Né
sans oreille gauche',2,NULL,NULL,NULL),(6,'F','2009-06-13
08:17:00','Bobosse','Carapace bizarre',3,NULL,NULL,NULL),
(7,'F','2008-12-06
05:18:00','Caroline',NULL,1,2,NULL,NULL),(8,'M','2008-09-11
15:38:00','Bagherra',NULL,2,5,NULL,NULL),(9,NULL,'2010-08-23
05:18:00',NULL,'Bestiole avec une carapace très
dure',3,NULL,NULL,NULL),
(10,'M','2010-07-21
15:41:00','Bobo',NULL,1,NULL,7,21),(11,'F','2008-02-20
15:45:00','Canaille',NULL,1,NULL,NULL,NULL),(12,'F','2009-05-26
08:54:00','Cali',NULL,1,2,NULL,NULL),
(13,'F','2007-04-24
12:54:00','Rouquine',NULL,1,1,NULL,NULL),(14,'F','2009-05-26
08:56:00','Fila',NULL,1,2,NULL,NULL),(15,'F','2008-02-20
15:47:00','Anya',NULL,1,NULL,NULL,NULL),
(16,'F','2009-05-26
08:50:00','Louya',NULL,1,NULL,NULL,NULL),(17,'F','2008-03-10
13:45:00','Welva',NULL,1,NULL,NULL,NULL),(18,'F','2007-04-24
12:59:00','Zira',NULL,1,1,NULL,NULL),
(19,'F','2009-05-26
09:02:00','Java',NULL,1,2,NULL,NULL),(20,'M','2007-04-24
12:45:00','Balou',NULL,1,1,NULL,NULL),(21,'F','2008-03-10
13:43:00','Pataude',NULL,1,NULL,NULL,NULL),
(22,'M','2007-04-24
12:42:00','Bouli',NULL,1,1,NULL,NULL),(24,'M','2007-04-12
05:23:00','Cartouche',NULL,1,NULL,NULL,NULL),(25,'M','2006-05-14
15:50:00','Zambo',NULL,1,1,NULL,NULL),
(26,'M','2006-05-14
15:48:00','Samba',NULL,1,1,NULL,NULL),(27,'M','2008-03-10
13:40:00','Moka',NULL,1,NULL,NULL,NULL),(28,'M','2006-05-14
15:40:00','Pilou',NULL,1,1,NULL,NULL),
Partie 4 : Fonctions : manipuler les dates
193/414
www.openclassrooms.com
Précédent

- 193/413

Suivant