Help in SQL !! | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 6

Help in SQL !!

if i like to get an information that is in the first table and one other from a second table that is classified as the Fourth table ( there are relations between those 4 tables ) ... where person.Name=employee.Name AND employee.id=(something here).id AND (something here).code=(another something here).code I just did that to explain šŸ˜ so if I wanna to go select the name from person and the code from (another something here) I do all that ??????

16th Jan 2018, 10:03 PM
Rayen Jbahi
Rayen Jbahi - avatar
9 Respostas
+ 18
select artist_table.name, company_personel.name from artist_table inner join company on artist_table.artist_id = company.artist_id inner join company_personel on company.employee_id = company_personel.employee_id
17th Jan 2018, 12:21 AM
Mark McGhee
Mark McGhee - avatar
+ 6
Sorry, English is not my native language. I don't get it. you can explain better?
16th Jan 2018, 10:56 PM
Malkon F
Malkon F - avatar
+ 5
let's suppose you have albums and people table and you want to select the name of David's albums. SELECT ALBUM FROM ALBUMS WHERE NAME='David'; Sorry if this is not your question.
16th Jan 2018, 11:02 PM
Malkon F
Malkon F - avatar
+ 5
SELECT name, song, album FROM person, song, album WHERE person.id = album.id; it would be something like that.
16th Jan 2018, 11:31 PM
Malkon F
Malkon F - avatar
+ 4
my problem is that the name and the album are not in the same table, and there is relations between those table ( person , song , album, relation)
16th Jan 2018, 11:09 PM
Rayen Jbahi
Rayen Jbahi - avatar
+ 4
thank you for your help , šŸ˜„but this is not what I really want to reach, but in all ways thank you for your patient
16th Jan 2018, 11:53 PM
Rayen Jbahi
Rayen Jbahi - avatar
+ 3
the example which I am talking about is that one about the singer and song
16th Jan 2018, 10:48 PM
Rayen Jbahi
Rayen Jbahi - avatar
+ 3
if you didn't understand some words I could help šŸ˜‰
16th Jan 2018, 11:10 PM
Rayen Jbahi
Rayen Jbahi - avatar
+ 2
singer ( NumS (primary key) ,NameS) song ( NumSo (primary key) , NameSo, NumS( foreign key) ) Album ( NumAlb (primary key ) , NameAlb) Relation ( NumSo ( foreign key ), NumAlb ( foreign key ) ) so I wanna to show the name of the albums of David ( for example)
16th Jan 2018, 10:25 PM
Rayen Jbahi
Rayen Jbahi - avatar