I've an existing site, whose DB is not designed correctly and contains lot of records, so we cant change DB structure.

Database for current issue mainly contains 4 tables, users, questions, options and answers. There is standard set of questions and options but for each user, there is one row in answers table for each set of question and options. DB structure and example data is available at [SQL fiddle](http://sqlfiddle.com/#!2/5cdc9/6).

Now as a new requirement of advanced search, I need to find users by applying multiple search filters. Example input and expected output is given in comments on [SQL Fiddle](http://sqlfiddle.com/#!2/5cdc9/6).

I tried to apply all type of joins, intersection but it always fail somehow. Can someone please help me to write correct query, preferably light weight/optimized joins as DB contain lot of records (10000+ users, 100+ questions, 500+ options and 500000+ records in answers table)?

**EDIT: Based on two answers, I used following query**

```
SELECT u.id, u.first_name, u.last_name
FROM users u
    JOIN answers a ON a.user_id = u.id
WHERE (a.question_id = 1 AND a.option_id IN (3, 5))
    OR (a.question_id = 2 AND a.option_id IN (8))
GROUP BY u.id, u.first_name, u.last_name
HAVING
    SUM(CASE WHEN (a.question_id = 1 AND a.option_id IN (3, 5)) THEN 1 ELSE 0 END) >=1
    AND SUM(CASE WHEN (a.question_id = 2 AND a.option_id IN (8)) THEN 1 ELSE 0 END) >= 1;

```

**Please note:** On real database, columns `user_id`, `question_id` and `option_id` of `answers` table are indexed.

Running query given on [SQL Fiddle](http://sqlfiddle.com/#!2/5cdc9/46).

[SQL Fiddle](http://sqlfiddle.com/#!2/5cdc9/43) for dnoeth's answer.

[SQL Foddle](http://sqlfiddle.com/#!2/5cdc9/45) for calcinai's answer.