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
5 Answers
+ 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 đ
+ 1
*Giraffe
+ 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;
+ 1
Thank u guys
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