+ 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 ??????
9 ответов
+ 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
+ 6
Sorry, English is not my native language. I don't get it. you can explain better?
+ 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.
+ 5
SELECT name, song, album FROM person, song, album WHERE person.id = album.id;
it would be something like that.
+ 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)
+ 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
+ 3
the example which I am talking about is that one about the singer and song
+ 3
if you didn't understand some words I could help 😉
+ 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)