- 3
Sql zoo
/* 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 Animals.country_id desc Is it right
8 Answers
+ 6
Garima
Try this one :
/* 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;
Happy Coding đ
+ 4
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 asc ;
+ 3
Garima
No there should be s caps in slim
2nd you have to use INNER JOIN
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 Animals.country_id DESC;
+ 2
This zoo project is making me bored
It really made me feel bad for solo learn I have tried all my plans yet nothing is happening I have got the required output
I think solo learn should check against the output not the code cause coding is an art
+ 1
/* This lines is to insert data into the three columns in the animals table*/
INSERT INTO animals
VALUES ('Slim', 'Giraffe', 1);
/* This lines is to select the columns we wish to JOIN*/
SELECT animals.name, animals.type, countries.country
FROM countries
/* This lines is to match the data types we are JOINING*/
INNER JOIN animals ON animals.country_id = countries.id
/*This line is to order our table by the name of the countries*/
ORDER BY countries.country;
0
Hey can any one provide correct answer for this zoo project kindly message me . I have tried all queries but not work getting same answer with non capital letters.
0
/* name - "Slim", type - "Giraffe", country_id - 1 */
here we are inserting info into tables :
=> insert into Animals (name,type,country_id) values ('Slim','Giraffe',1);
for result we use select & unner join to take from Countries table country and use it in animals table :
=> SELECT Animals.name,Animals.type,Countries.country
FROM Animals INNER JOIN Countries
ON Animals.country_id=Countries.id order by Countries.country;
0
it is 'Slim' not 'slim'