Can some one tell me how many table in the database i need to put and explain to me how each table is related in the forum and last how the forum work...
Building even a basic forum is a pretty big project. I recommend working on some smaller projects first. All of your questions are very broad questions that you should be able to at least start
to answer yourself before you start trying to build a forum.
If you're determined, my recommendation is that you download some freely-available forum software. phpBB
is, of course, the most popular, but a good place to start would be miniBB
for its simplicity. Download that and look at the source -- try to understand the database structure and how posting works. If you can grasp those things in at least a basic way, then you might be ready to attempt a forum on your own. But if you get completely lost, then you need more practice on smaller projects.