Question on the Zoo Project from the SQL course | Sololearn: Learn to code for FREE!
+ 2

Question on the Zoo Project from the SQL course

I am trying to solve the Zoo project. I get the message "syntax error at or near "Select" Here is my code: INSERT INTO Animals (name, type, country_id) VALUES('Slim','Giraffe', 1) SELECT Animals.name, Animals.type, Countries.country AS country FROM Animals, Countries WHERE Animals.country_id=Countries.id ORDER BY Countries.id DESC; Please help

2nd Jan 2022, 10:10 AM
Stacey Prahl
Stacey Prahl - avatar
2 Answers
+ 5
Your solution seems logic, I think the problem is u missing a semicolon at the end of the insert statement. Tips: If u have multiple statements, seperate them with semicolons. The query will execute once it encounter semicolon.
2nd Jan 2022, 10:35 AM
Chan Jia Min
Chan Jia Min - avatar
+ 1
Thank you!
3rd Jan 2022, 1:22 AM
Stacey Prahl
Stacey Prahl - avatar