lore_83
06-05-2008, 13:24
Ciao.
Il database attualmente è composto dalle tabelle:
Citta
Regioni
Paesi
Continenti
Di ogni record ho le coordinate (latitudine, longitudine), secondo voi vanno inserite in una tabella esterna di questo tipo:
coordinates_id INTEGER AUTO_INCREMENT PRIMARY KEY,
latitude FLOAT(10,6) NOT NULL,
longitude FLOAT(6,6) NOT NULL,
city_id INTEGER DEFAULT 0,
region_id INTEGER DEFAULT 0,
country_id INTEGER DEFAULT 0,
continent_id INTEGER DEFAULT 0,
FOREIGN KEY (city_id) REFERENCES Cities (city_id),
FOREIGN KEY (region_id) REFERENCES Region (region_id),
FOREIGN KEY (country_id) REFERENCES Countries (country_id),
FOREIGN KEY (continent_id) REFERENCES Continents (continent_id),
Oppure le coordinate geografiche vanno inserite nelle tabelle Città, Regione ecc.?
Grazie.
Il database attualmente è composto dalle tabelle:
Citta
Regioni
Paesi
Continenti
Di ogni record ho le coordinate (latitudine, longitudine), secondo voi vanno inserite in una tabella esterna di questo tipo:
coordinates_id INTEGER AUTO_INCREMENT PRIMARY KEY,
latitude FLOAT(10,6) NOT NULL,
longitude FLOAT(6,6) NOT NULL,
city_id INTEGER DEFAULT 0,
region_id INTEGER DEFAULT 0,
country_id INTEGER DEFAULT 0,
continent_id INTEGER DEFAULT 0,
FOREIGN KEY (city_id) REFERENCES Cities (city_id),
FOREIGN KEY (region_id) REFERENCES Region (region_id),
FOREIGN KEY (country_id) REFERENCES Countries (country_id),
FOREIGN KEY (continent_id) REFERENCES Continents (continent_id),
Oppure le coordinate geografiche vanno inserite nelle tabelle Città, Regione ecc.?
Grazie.