2
TABLE REGISTER A
Attributes: Code, name, type
TABLE NUMBER B
Attributes: Code, number
TABLE PERSON C
Attributes: Code, gender
I need to bring the information name and type of table A with the corresponding numbers of table B filtering by the attributes "type" of table A and "gender" of table C.
Follow my attempt to consult:
select A.NOME, B.NUMERO
from A
left join B on
A.codigo = B.codigo
where
A.tipo=B and
C.genero='Homem'
Where is the link of "C.genero" with tables A and B? Column "A.tipo" is a foreign key for B? It seems to me that you need to improve the modeling of tables. Post more information about the business rule that we can help you with.
– brunoapimentel