0

Why is this code giving me error? Any one help please

INSERT INTO Animals VALUES ("Slim", "Giraffe", 1); SELECT Animals.name, Animals.type, Countries.country FROM Animals, Countries WHERE Animals.country_id=Countries.id ORDER BY Countries.country; This code gives the error column slim does not exist, I don't understand. The code is to add "slim" under column "name", the table Animals has 3 columns, name, type and Id. How else should I have written it? BTW, this code works in online editor

20th Mar 2021, 1:23 PM
Peter Ariyo
Peter Ariyo - avatar
3 Answers
+ 2
I've solved it. The problem was the double quotations " " I used single quotes and it worked ' ' Thanks everyone
21st Mar 2021, 11:43 AM
Peter Ariyo
Peter Ariyo - avatar
0
Replace on obvious inner join
20th Mar 2021, 1:36 PM
Đ˜Đ»ŃŒŃ ĐœĐžŃ€ĐŸŃˆĐœĐžĐș
Đ˜Đ»ŃŒŃ ĐœĐžŃ€ĐŸŃˆĐœĐžĐș - avatar
0
The part giving the error is the insert area, the other part works. The exercise is to add the line to the table Animals, and then return the two tables joined. The where statement is an inner join as is used here already
20th Mar 2021, 2:29 PM
Peter Ariyo
Peter Ariyo - avatar