Problem with zoo project in sql | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Problem with zoo project in sql

Hello! I have a technical problem and can't to solve this task (SQL Zoo project): https://www.sololearn.com/learning/eom-project/1060/1059 I've tried these: 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; INSERT INTO Animals (name, type, country_id) VALUES ('Slim', 'Giraffe', 1); SELECT animals.name, animals.type, countries.country FROM animals, countries WHERE animals.country_id=countries.id order by animals.country_id desc 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; insert into Animals values ('Slim', 'Giraffe', 1); select name, type, country from Animals join Countries on Animals.country_id = Countries.id order by country; And all of them don't work with the mistake: test case 1, no output

16th Feb 2021, 6:47 AM
Vladimir Bochek
Vladimir Bochek - avatar
46 Answers
+ 4
Ahsan Tariq Yes this works perfectly
2nd May 2021, 2:22 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 3
And upper side code
2nd May 2021, 2:30 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 2
Sathe Prerana Satish Yes! When i copy this code, it worked. Thank you!
18th Feb 2021, 6:46 PM
Nefise Özgür
Nefise Özgür - avatar
+ 2
Ok I'll try if I can
2nd May 2021, 3:02 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 2
Ahsan Tariq Most welcome ☺️☺️
2nd May 2021, 6:50 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 2
From my experience I learned two things, that may help with this task, one is to write it as two separate sets of commands. First adds animals to the table: INSERT INTO Animals (name, type, country_id) VALUES ('Slim', 'Giraffe', '1'); <--remember to use semicolon to end command Second, do the rest of the task: SELECT Animals.name, Animals.type, Countries.country FROM Animals INNER JOIN Countries ON animals.country_id = countries.id ORDER BY country ASC; <--remember to use semicolon to end command And also to remember to set order to ascending. I hope it will help.
28th Oct 2021, 4:22 PM
Szaman1701
Szaman1701 - avatar
+ 1
I have copy paste this exactly but still no answer
2nd May 2021, 2:29 PM
Ahsan Tariq
Ahsan Tariq - avatar
+ 1
No still the same issue
2nd May 2021, 2:36 PM
Ahsan Tariq
Ahsan Tariq - avatar
+ 1
Ok wait
2nd May 2021, 2:38 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
Had you added something in this code
2nd May 2021, 2:38 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
Where are you running this code
2nd May 2021, 2:39 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
At the given problem playground.
2nd May 2021, 2:40 PM
Ahsan Tariq
Ahsan Tariq - avatar
+ 1
On Sololearn or other playground
2nd May 2021, 2:41 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
Sololearn
2nd May 2021, 2:42 PM
Ahsan Tariq
Ahsan Tariq - avatar
+ 1
Is there any way to send screen shot so you can see what's the problem is . ?
2nd May 2021, 2:44 PM
Ahsan Tariq
Ahsan Tariq - avatar
+ 1
Type first letter of all animals name in upoercase
2nd May 2021, 2:46 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
Ooh thank you it really work for me thanks a lot
2nd May 2021, 6:48 PM
Ahsan Tariq
Ahsan Tariq - avatar
+ 1
Ahsan Tariq Happy coding ☺️
2nd May 2021, 6:50 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
0
Hi Владимир with the second pair Animals and Countries needs to be capital. try that and it might work - also it should be from just Animals not Animals and Countries like this... SELECT Animals.name, Animals.type, Countries.country FROM Animals INNER JOIN Countries ON Animals.country_id = Countries.id ORDER BY Countries.country;
16th Feb 2021, 7:11 AM
Ollie Q
Ollie Q - avatar
0
Try this. It will works. /* name - "Slim", type - "Giraffe", country_id - 1 */ 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;
18th Feb 2021, 2:18 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar