I need to create a query in SQL
.
I have three tables:
TABELA 1: EMPRESA
emp_codigo (chave primaria)
emp_nome
TABELA 2: PALAVRAS_CHAVE
pal_codigo (chave primaria)
pal_nome
TABELA 3: VINCULO
vin_codigo (chave primaria)
vin_empresa (chave secundaria de emp_codigo)
vin_palavra (chave secundaria de pal_codigo)
I'm trying to mount a query to display only the keywords that were not linked to the company specified in the query .
Example :
Let's consider that the table of keywords has 5 key words: A, B, C, D and E, and that the company "Supermercado Boa Ideia" has a link with the words A, C and E. Logo , I need the query to return to me only B and D when this company is searched.
Detail: This is not just about listing records that do not match, but also filtering the records according to the company specified in the search.