--
-- The planets
--
CREATE TABLE IF NOT EXISTS planets(
    id INTEGER PRIMARY KEY,
    name TEXT NOT NULL,
    sun_distance REAL NOT NULL,
    day_length INTEGER NOT NULL,
    type TEXT NOT NULL
);

INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Mercury',  0.4, 1408, 'rock');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Venus'  ,  0.7, 5832, 'rock');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Earth'  ,  1  ,   24, 'rock');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Mars'   ,  1.5,   25, 'rock');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Jupiter',  5.2,   10, 'gas');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Saturn' ,  9.5,   11, 'gas');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Uranus' , 19.2,   17, 'ice');
INSERT INTO planets(name, sun_distance, day_length, type) VALUES ('Neptune', 30.1,   16, 'ice');

--
-- The satellites
--
CREATE TABLE IF NOT EXISTS satellites(
    name TEXT NOT NULL PRIMARY KEY,
    planet_id INTEGER NOT NULL,
    diameter REAL NOT NULL,
    mass REAL NOT NULL,
    CONSTRAINT fk_planet_id FOREIGN KEY (planet_id) REFERENCES planets(id)
);

INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Moon'  , 3, 3474.8, 7342000);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Deimos', 4, 12.4, 0.14762);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Phobos', 4, 22.5334, 1.0659);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Metis', 5, 43, 3.6);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Adrastea', 5, 16.4, 0.20);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Amalthea', 5, 167, 208);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Thebe', 5, 98.6, 43);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Io', 5, 3643.2, 8931900);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Europa', 5, 3121.6, 4799800);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Ganymede', 5, 5268.2, 14819000);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Callisto', 5, 4820.6, 10759000);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Themisto', 5, 9, 0.038);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Leda', 5, 21.5, 0.52);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Ersa', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Himalia', 5, 139.6, 420);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Pandia', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Lysithea', 5, 42.2, 3.9);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Elara', 5, 79.9, 27);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Dia', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Carpo', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Valetudo', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Euporie', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 18', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Eupheme', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2010 J 2', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2016 J 1', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Mneme', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Euanthe', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 16', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Harpalyke', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Orthosie', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Helike', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Praxidike', 5, 7, 0.018);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 3', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 12', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 7', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Thelxinoe', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Thyone', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 2', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Ananke', 5, 29.1, 1.3);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Iocaste', 5, 5, 0.0065);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Hermippe', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 9', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Philophrosyne', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Pasithee', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 8', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 24', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Eurydome', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2011 J 2', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 4', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Chaldene', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 2', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Isonoe', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Kallichore', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Erinome', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Kale', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Eirene', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Aitne', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Eukelade', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Arche', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Taygete', 5, 5, 0.0065);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2011 J 1', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Carme', 5, 46.7, 5.3);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Herse', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 19', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2010 J 1', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 9', 5, 1, 0.000052);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 5', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 6', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Kalyke', 5, 6.9, 0.017);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Hegemone', 5, 3, 0.0014);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Pasiphae', 5, 57.8, 10);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Sponde', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 10', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Megaclite', 5, 5, 0.0065);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Cyllene', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Sinope', 5, 35, 2.2);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2017 J 1', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Aoede', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Autonoe', 5, 4, 0.0034);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Callirrhoe', 5, 9.6, 0.046);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('S/2003 J 23', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Kore', 5, 2, 0.00042);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Naiad', 8, 60.4, 13);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Thalassa', 8, 81.4, 35);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Despina', 8, 156, 170);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Galatea', 8, 174.8, 280);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Larissa', 8, 194, 380);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Hippocamp', 8, 34.8, 2.2);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Proteus', 8, 420, 3900);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Triton', 8, 2705.2, 2139000);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Nereid', 8, 357, 2400);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Halimede', 8, 61, 12);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Sao', 8, 40, 3.4);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Laomedeia', 8, 40, 3.4);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Psamathe', 8, 38, 2.9);
INSERT INTO satellites(name, planet_id, diameter, mass) VALUES ('Neso', 8, 60, 11)


