Re: Numero eletti comuni con meno di 3000 abitanti
Inviato: dom mag 06, 2012 6:05 pm
da roby
Sono cambiate anche le fasce oltre al numero di seggi. Va reimpostata la tabella chiudendo le precedenti impostazioni ed aprendo le nuove. Questo è l'sql (va testato, mi dispiace ma non ho proprio avuto il tempo):
DROP TABLE IF EXISTS `soraldo_ele_fasce`;
CREATE TABLE IF NOT EXISTS `soraldo_ele_fasce` (
`id_fascia` int(2) NOT NULL,
`abitanti` int(11) NOT NULL,
`data_inizio` date NOT NULL,
`data_fine` date NOT NULL,
`seggi` int(4) NOT NULL,
KEY `id_fascia` (`id_fascia`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dump dei dati per la tabella `soraldo_ele_fasce`
--
INSERT INTO `soraldo_ele_fasce` (`id_fascia`, `abitanti`, `data_inizio`, `data_fine`, `seggi`) VALUES
(1, 3000, '2000-01-01', '2010-12-31', 12),
(2, 10000, '2000-01-01', '2010-12-31', 16),
(3, 15000, '2000-01-01', '2010-12-31', 20),
(4, 30000, '2000-01-01', '2010-12-31', 20),
(5, 100000, '2000-01-01', '2010-12-31', 30),
(6, 250000, '2000-01-01', '2010-12-31', 40),
(7, 500000, '2000-01-01', '2010-12-31', 46),
(8, 1000000, '2000-01-01', '2010-12-31', 50),
(9, 100000000, '2000-01-01', '2010-12-31', 60),
(4, 30000, '2011-01-01', '2011-09-14', 16),
(1, 3000, '2011-01-01', '2011-09-14', 9),
(2, 10000, '2011-01-01', '2011-09-14', 12),
(3, 15000, '2011-01-01', '2011-09-14', 16),
(5, 100000, '2011-01-01', '2011-09-14', 24),
(6, 250000, '2011-01-01', '2011-09-14', 32),
(7, 500000, '2011-01-01', '2011-09-14', 36),
(8, 1000000, '2011-01-01', '2011-09-14', 40),
(9, 100000000, '2011-01-01', '2011-09-14', 48),
(1, 1000, '2011-09-15', '0000-00-00', 6),
(2, 3000, '2011-09-15', '0000-00-00', 6),
(3, 5000, '2011-09-15', '0000-00-00', 7),
(4, 10000, '2011-09-15', '0000-00-00', 10),
(5, 15000, '2011-09-15', '0000-00-00', 16),
(6, 30000, '2011-09-15', '0000-00-00', 16),
(7, 100000, '2011-09-15', '0000-00-00', 24),
(8, 250000, '2011-09-15', '0000-00-00', 32),
(9, 500000, '2011-09-15', '0000-00-00', 36),
(10, 1000000, '2011-09-15', '0000-00-00', 40),
(11, 100000000, '2011-09-15', '0000-00-00', 48);