1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| --------------
START TRANSACTION
--------------
--------------
DROP DATABASE IF EXISTS `base`
--------------
--------------
CREATE DATABASE IF NOT EXISTS `base`
DEFAULT CHARACTER SET `latin1`
DEFAULT COLLATE `latin1_general_ci`
--------------
--------------
DROP TABLE IF EXISTS `tabone`
--------------
--------------
create table `station`
( `id` integer unsigned not null auto_increment primary key,
`nom_station` varchar(255) not null,
`capacite` integer unsigned not null,
`lieu` varchar(255) not null,
`region` enum ('Ocean Indien','Antilles','Europe','Ameriques','Extreme Orient'),
`tarif` decimal(15,2) not null default 0.0,
unique index `idx` (`lieu`,`region`)
) ENGINE=InnoDB
DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_ci`
ROW_FORMAT=COMPRESSED
--------------
--------------
insert into `station` (`nom_station`,`capacite`,`lieu`,`region`,`tarif`) values
('isola 2000', 200, 'France', 'Europe', 1250.0),
('Jay Peak', 800, 'Etats-Unis', 'Ameriques', 2220.0)
--------------
--------------
select * from `station`
--------------
+----+-------------+----------+------------+-----------+---------+
| id | nom_station | capacite | lieu | region | tarif |
+----+-------------+----------+------------+-----------+---------+
| 1 | isola 2000 | 200 | France | Europe | 1250.00 |
| 2 | Jay Peak | 800 | Etats-Unis | Ameriques | 2220.00 |
+----+-------------+----------+------------+-----------+---------+
--------------
COMMIT
--------------
Appuyez sur une touche pour continuer... |
Partager