I am developing a web based system involving branch and headquarters information for my project. HQ can access all the branch data and generate report. How am i suppose to design the database? Do i need a separate database for each branch or can i store all the branch info in one database together with the HQ information. If i use separate database, will this slow down the query in MYSQL?

Hmm... no genius, but I think you can do it several ways.... depends on what you want!

You could have one db.... and just limit the access to things dependant upon user...ie the branches can only input and view their input, where as hq can llok at all input.

Alternatively, you could make multiple copies of the db framework, supply it to all branches, and have them send daily/hourly updates to the main hq db that will import them all...... so you make a big db and a little db... make sense?

or you can make a cross of the two main methods.....
have to careful about security though!

The more you have a permenant connection, tyhe easier to get at.... so I'd recommend have shuttered end db's... (one db per branch, have set times to send the info out to hq!)..... so you have start of day, mid day and end of day.... this means that there are 2 cross check files to ensure the figures add up, (start and end of current/previous/next!).... and the mid day for projection reasons!

If you make the db so that it is web based, you could have it easier... you set it up as an extra-net, (like a ntwork but over the web!).... that way it is safer to protect the connection ends!

still, see what others say!