This answer is not of a line but it works:
1) Which carriers are present in only 1 category?
SELECT t.Transportadora, v.Preferencia_Nacional_Voto, v.Transporte_Internacional_Voto, v.Transporte_Rodoaereo_Voto
FROM transportadora t
JOIN voto v on t.Id_Transportadora = v.Id_Transportadora
WHERE
(v.Preferencia_Nacional_Voto is null
and
v.Transporte_Internacional_Voto is not null
and
v.Transporte_Rodoaereo_Voto is not null)
OR
(v.Preferencia_Nacional_Voto is not null
and
v.Transporte_Internacional_Voto is null
and
v.Transporte_Rodoaereo_Voto is not null)
OR
(v.Preferencia_Nacional_Voto is not null
and
v.Transporte_Internacional_Voto is not null
and
v.Transporte_Rodoaereo_Voto is null);
2) Which carriers are present in 2 categories?
SELECT t.Transportadora, v.Preferencia_Nacional_Voto, v.Transporte_Internacional_Voto, v.Transporte_Rodoaereo_Voto
FROM transportadora t
JOIN voto v on t.Id_Transportadora = v.Id_Transportadora
WHERE
(v.Preferencia_Nacional_Voto is null
and
v.Transporte_Internacional_Voto is null
and
v.Transporte_Rodoaereo_Voto is not null)
OR
(v.Preferencia_Nacional_Voto is null
and
v.Transporte_Internacional_Voto is not null
and
v.Transporte_Rodoaereo_Voto is null)
OR
(v.Preferencia_Nacional_Voto is not null
and
v.Transporte_Internacional_Voto is null
and
v.Transporte_Rodoaereo_Voto is null);
What you’ve tried that didn’t work out?
– Boneco Sinforoso