Hi there, Im working on inserting my data into my already built tables and am having trouble inserting more than one row of data at a time. I have build my table moon like this:
CREATE TABLE moon (moon_id SERIAL PRIMARY KEY, name VARCHAR(30) NOT NULL UNIQUE, yr_discovered INT, diameter_in_km INT, planet_id INT)
I am trying to enter in this data:
INSERT INTO moon (name, yr_discovered, diameter_in_km, planet_id)
VALUES
(‘Our_Moon’, NULL, 3476, 3),
(‘Phobos’, 1877, 23, 4),
(‘Delmos’, 1877, 13, 4),
(‘Io’, 1610, 3660, 5),
(‘Europa’, 1610, 3138,5),
(‘Ganymede’, 1610, 5262, 5),
(‘Callisto’, 1610, 4800, 5),
(‘Amalthea’, 1892, 200, 5),
(‘Himalia’, 1904, 170,5),
(‘Thebe’, 1979, 90, 5),
(‘Mimas’, 1789, 394, 6);
Inserting the data works if i do one row at a time but i get:
ERROR: column " ‘Delmos’ " does not exist
LINE 1: … yr_discovered, diameter_in_km, planet_id) VALUES ( ‘Delmos’, …
–with a little arrow under the single quote before Delmos–
This is assuming that i am starting to enter multiple rows of data after entering the first two rows individually.
What am i missing? I’ve researched on multiple places to be sure i am using proper syntax and all looks good so im confused. Any help would be much appreciated. Thanks