0
votes

I am trying to run the following code:

CREATE TABLE IF NOT EXISTS location ( locationId int(10) NOT NULL, locationName varchar(25) NOT NULL, PRIMARY KEY (locationId) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

I get an error running the code below:

INSERT INTO location (locationId, locationName) VALUES (1, Millwall Park-London), (2, Isle of Dogs), (3, Windsor Castle-Grounds), (4, Orford Ness-Suffolk), (5, Rancid Attic Studio), (6, St James Park-London);

1

1 Answers

0
votes

Use quotes:

INSERT INTO location (locationId, locationName) VALUES (1, "Millwall Park-London"), (2, "Isle of Dogs"), (3, "Windsor Castle-Grounds"), (4, "Orford Ness-Suffolk"), (5, "Rancid Attic Studio"), (6, "St James Park-London");

Hope this solves the problem.