0

Guys plz help l have an SQL qstn

I was given two tables and one of them shld insert values then afterwards l have to join the two tables by an inner join l tried it it's failing to come out plz help out

30th Jun 2022, 7:24 PM
Thandolwenkosi
5 odpowiedzi
+ 2
The following module covers how to insert data into a table, and how to join tables. It's the first part of "JOIN, Table operations" module, so you might want to review it. https://www.sololearn.com/learn/SQL/1865/ Please edit the thread to add SQL in the tags 👍
30th Jun 2022, 8:55 PM
Chris Coder
Chris Coder - avatar
+ 1
*Giraffe
30th Jun 2022, 10:17 PM
SoloProg
SoloProg - avatar
+ 1
insert into Animals values ('Slim', 'Giraffe', 1); select a.name, a.type, c.country from Animals a inner join Countries c on c.id=a.country_id order by c.country;
30th Jun 2022, 10:18 PM
SoloProg
SoloProg - avatar
+ 1
Thank u guys
1st Jul 2022, 9:07 AM
Thandolwenkosi
0
Hie please help me on this code and tell me where l went wrong /* name - "Slim", type - "Giraffe", country_id - 1 */ INSERT INTO animals(name,type,country_id) values('Slim' , 'Girafee' , 1) SELECT animals.name,animals.type,animals.country_id,countries.id,countries.country FROM animals,countries FROM animals INNER JOIN countries ON animals.country_id=countries.country ORDER BY country Thus my code for the qstn
30th Jun 2022, 7:24 PM
Thandolwenkosi