--
-- Create schema esercitazione
--

CREATE DATABASE IF NOT EXISTS esercitazione;
USE esercitazione;

DROP TABLE IF EXISTS `compagnia`;
CREATE TABLE `compagnia` (
  `codice` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `nazione` varchar(45) NOT NULL,
  PRIMARY KEY (`codice`)
);

INSERT INTO `compagnia` (`codice`,`nazione`) VALUES 
 (1,'italia'),
 (2,'belgio'),
 (3,'francia'),
 (4,'spagna'),
 (5,'francia'),
 (6,'italia'),
 (7,'italia');

DROP TABLE IF EXISTS `volo`;
CREATE TABLE `volo` (
  `cod` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `partenza` varchar(45) NOT NULL,
  `arrivo` varchar(45) NOT NULL,
  `numpass` int(10) unsigned NOT NULL,
  `comp` varchar(45) NOT NULL,
  PRIMARY KEY (`cod`)
);

INSERT INTO `volo` (`cod`,`partenza`,`arrivo`,`numpass`,`comp`) VALUES 
 (11,'Belize','Baden',110,'01'),
 (13,'Baden','Keflovik',110,'01'),
 (15,'Bombay','Dublin',100,'02'),
 (17,'Dublin','Baden',180,'02'),
 (19,'Belize','Dublin',180,'03'),
 (21,'Moscow','Singapore',210,'04'),
 (27,'CapeTown','Johannesburg',180,'04'),
 (30,'Basel','Taipei',100,'03'),
 (31,'Belize','Dublin',100,'05'),
 (32,'Firenze','London',200,'06'),
 (34,'Firenze','Belfast',110,'06'),
 (35,'Belfast','Dublin',110,'06'),
 (37,'Moscow','Taipei',110,'05'),
 (41,'Firenze','Taipei',110,'06'),
 (45,'Dublin','Moscow',120,'06'),
 (46,'Dublin','Belize',120,'06'),
 (56,'Moscow','Dublin',180,'04'),
 (57,'Rome','London',210,'04'),
 (58,'Palermo','Milano',100,'04'),
 (59,'Singapore','London',110,'07'),
 (75,'Parigi','London',140,'07'),
 (76,'Belize','Taipei',200,'07'),
 (91,'London','Rome',150,'07'),
 (96,'Keflowik','Moscow',145,'07'),
 (97,'Dublin','Rome',150,'03'),
 (102,'Bombay','Singapore',120,'03'),
 (121,'Belize','Dublin',150,'03'),
 (126,'Tapei','Baden',180,'03'),
 (178,'Napoli','Roma',150,'05');
