+ 2

What is wrong with my query??

Solo learn doesn't accept it /* name - "Slim", type - "Giraffe", country_id - 1 */ INSERT into Animals VALUES ("Slim","Giraffe",1) SELECT Animals.name,Animals.type,Countries.country FROM Animals INNER join Countries on Animals.country_id = Countries.id ORDER BY Countries.country

2nd May 2022, 1:50 PM
Fateme Imani
Fateme Imani - avatar
4 odpowiedzi
+ 4
Fateme Imani Query is right 1 - there should be semicolon (;) after insert query 2 - SQL doesn't support double quotes so there should be single quotes for a string value
2nd May 2022, 2:39 PM
A͢J
A͢J - avatar
+ 4
// try this: insert into Animals (name, type, country_id) values ('Slim', 'Giraffe', 1);
2nd May 2022, 2:09 PM
JaScript
JaScript - avatar
+ 1
try this too 👇👇👇 INSERT INTO ANIMALS VALUES ('Slim', 'Giraffe', 1); SELECT name, type, country FROM ANIMALS INNER JOIN COUNTRIES ON ANIMALS.country_id = COUNTRIES.id ORDER BY country_id DESC
2nd May 2022, 2:25 PM
NonStop CODING
NonStop CODING - avatar
- 1
Yes
3rd May 2022, 12:31 PM
Ahad Sattari