END OF MODULE PROJECT | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

END OF MODULE PROJECT

Please help me :(( 1) A new animal has come in, with the following details: name - "Slim", type - "Giraffe", country_id - 1 Add him to the Animals table. 2) You want to make a complete list of the animals for the zoo’s visitors. Write a query to output a new table with each animal's name, type and country fields, sorted by countries.

15th Feb 2021, 6:04 AM
Justin Victor S. Mancilla
Justin Victor S. Mancilla - avatar
19 Answers
0
Answerpl
16th Feb 2021, 11:53 AM
merjulie Benelayo
merjulie Benelayo - avatar
0
Answer plzzz
16th Feb 2021, 11:53 AM
merjulie Benelayo
merjulie Benelayo - avatar
0
This will works
17th Feb 2021, 3:09 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
0
/* name - "Slim", type - "Giraffe", country_id - 1 */ INSERT INTO Animals (name, type, country_id) VALUES('Slim', 'Giraffe', '1'); SELECT name, type, country FROM Animals, Countries where Countries.id = Animals.country_id order by Countries.id DESC; this works perfectly for me and it easy
31st Mar 2021, 2:51 PM
Benjamin Franck Mukadi
Benjamin Franck Mukadi - avatar
0
INSERT INTO Animals (name, type, country_id) VALUES ('Slim', 'Giraffe', 1); select animals.name as name, animals.type as type, countries.country as country from animals inner join countries on animals.country_id=countries.id order by countries.country;
15th Apr 2021, 11:37 PM
Mohammad A. Khatim
Mohammad A. Khatim - avatar
0
With my code, why is the output changing the format of the info? USA should be all caps. How do I get the output to not change from capitals? /* 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, Countries WHERE Animals.country_id=Countries.id ORDER BY Countries.country;
30th Apr 2021, 12:37 PM
Gregory Dappert
Gregory Dappert - avatar
0
This is what I used and it works! insert into animals values ('Slim','Giraffe',1); SELECT initcap(a.name) as name, initcap(a.type) as type, (CASE when a.country_id=3 then initcap('India') when a.country_id=2 then initcap('Russia') when a.country_id=1 then upper('USA') END) AS country FROM Animals AS a inner join Countries AS c on a.country_id=c.id order by c.country Asc;
3rd May 2021, 9:11 AM
Gregory Dappert
Gregory Dappert - avatar
0
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;
22nd Mar 2022, 10:55 AM
Emmanuella
0
Pls can someone show me where I went wrong here, Sololearn kept seeing errors, pointing out that Slim is not a column or not seeing input at all INSERT INTO Animals (name,type,country_id) VALUES ('Slim','Giraffe',1); Pls tell me what went wrong
5th May 2022, 5:58 PM
Atinuke Mobolaji Bashorun
0
i use this and works 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 country_id DESC;
22nd Aug 2022, 7:04 AM
Tsabita Umar
Tsabita Umar - avatar
0
INSERT INTO Animals (name, type, country_id) VALUES('Slim', 'Giraffe', '1'); SELECT name, type, country FROM Animals, Countries where Countries.id = Animals.country_id order by Countries.id DESC;
17th Oct 2022, 10:51 AM
ozodjon
0
/* name - "Slim", type - "Giraffe", country_id - 1 */ 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
20th Nov 2022, 10:02 AM
Ganiou IDOLEKE
Ganiou IDOLEKE - avatar
0
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
12th Dec 2022, 10:56 AM
Ashenafi Ayele
Ashenafi Ayele - avatar
- 1
Here's my answer but it is not taking it: /* name - "Slim", type - "Giraffe", country_id - 1 */ Insert into animals values ('Slim', 'Girrafe', 1); select animals.name, animals.type, countries.country from animals inner join countries on animals.country_id=countries.id order by country; ERROR: syntax error at or near "select" LINE 5: select animals.name, animals.type, countries.country ^
16th Feb 2021, 3:40 AM
Nathania Rae Cruz
Nathania Rae Cruz - avatar
- 1
/* name - "Slim", type - "Giraffe", country_id - 1 */ Insert into animals values ('Slim', 'Girrafe', 1); select animals.name AS name, animals.type as type, countries.country as country from animals INNER JOIN countries ON animals.country_id=countries.id order by countries.country;
16th Feb 2021, 12:15 PM
KONTIO LONLAK KUETE Jordan Anderson
KONTIO LONLAK KUETE Jordan Anderson - avatar
- 1
/* name - "Slim", type - "Giraffe", country_id - 1 */ Insert into animals values ('Slim', 'Girraffe', 1); select animals.name AS name, animals.type as type, countries.country as country from animals INNER JOIN countries ON animals.country_id=countries.id order by countries.country; Good answer
16th Feb 2021, 1:28 PM
KONTIO LONLAK KUETE Jordan Anderson
KONTIO LONLAK KUETE Jordan Anderson - avatar
- 1
Here is my second attempt. Everything looks good except the USA outputs Usa. Any ideas? /* name - "Slim", type - "Giraffe", country_id - 1 */ INSERT INTO Animals (name,type,country_id) VALUES ('Slim','Giraffe',1); SELECT INITCAP (Animals.name) AS name, INITCAP (Animals.type) AS type, INITCAP (Countries.country) AS country FROM Animals INNER JOIN Countries ON Animals.country_id = Countries.id ORDER BY Countries.Country
30th Apr 2021, 4:42 PM
Gregory Dappert
Gregory Dappert - avatar
- 2
Hi! Your attempt?
15th Feb 2021, 8:12 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
- 2
/* 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;
17th Feb 2021, 3:08 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar