I have a questions table, a user table and an answers table with user_id and question_id as foreign keys.
I tried:
select questions.title from questions
full outer join answers on answers.question_id = questions.id
where answers.user_id = 1
group by questions.id
having count(answers.id) = 0
But the issue is that when questions.id is null it groups by null
Ideally the query should be doable with ActiveRecord (Ruby on Rails).