0
SQL query doubt
The SQL Zoo project in this app seems to have bug. Even though i have put correct SQL query and getting expected output but still not able to clear the test.. getting error 'try again' I have inserted below sql query INSERT into animals values ('slim','Giraffe',1); select Animals.name,Animals.type,countries.country from countries INNER join animals on countries.id=animals.country_id order by country; Please help.
7 odpowiedzi
0
i wonder if it is case sensitive. maybe use lowercase a for animals. below is my attempt at the challenge.
insert into animals
values('Slim', 'Giraffe', '1');
select a.name, a.type, c.country
from animals as a
join countries as c
on a.country_id = c.id
order by c.country
+ 1
i think you might need to include the column names in the insert statement. a slightly modified version of your code is provided below.
INSERT into animals (name, type, country_id)
values ('slim','Giraffe',1);
select Animals.name,Animals.type,countries.country
from countries
INNER join animals
on countries.id=animals.country_id
order by country;
+ 1
Try this 👇
INSERT INTO animals (name, type, country_id)
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 ASC;
0
Thanks Andrew but still getting same error, 'Try again' even though output is coming correctly.
0
Thanks a ton Andrew, it worked.
0
wonderful !
0
Thanks Neha..its solved already.