<p>We may tag a question with multiple tags in StackOverflow website, I'm wondering how to find out the most related questions with common tags.</p>

<p>Assume we have 100 questions in a database, each question has several tags. Let's say user is browsing a specific question, and we want to make the system to display the related questions on the page. The criteria for related question is they have most common tags.</p>

<p>For example:
Question 1 is tagged with AAA, BBB, CCC, DDD, EEE.</p>

<p>Question 2 is top 1 related because it also has all those 5 tags.
Question 3 is top 2 related because it has only 4 or 3 tags that Questio1 has.
......</p>

<p>So my question is how to design the database and find out the questions that's related to Question 1 quickly. Thank you very much.</p>

Not entirely sure what you mean, but
the Tags page
lists tags in order of popularity (as in amount tagged).
Edit:
is this about SO or about your own application? If it is about your own app, remove the SO tag as it's kind of misleading.
Edit2:
I'd say something like:
```
```
SELECT * FROM `questions` WHERE `tag` LIKE '%tagname%' OR (looped for each tag) LIMIT 5,0
```
```
Where 5 is the maximum results you want to return (for at least some optimisation). Probably not the best solution, but I could see it working.
You might also want to try a
```
LIKE
```
match using the title.