I am planning to build a database for a school application. I have designed a database to hold time tables for all the classes. It should also relate to the teachers taking the subject for the class. Also should be able to handle a public holidays mentioned. Also the attendance of all the students and teachers. Please guide me with the best possible table structure with the foreign key mapping if any. Thanks in advance.
The best advice I could tell you would be to try to put some basic effort in doing your school assigments. This is the key in becoming an accomplished programmer and professional.
i hope this link help :
http://www.hsc.csu.edu.au/ipt/info_systems/2-3/database_design.htm
There are numerous examples of database design here : http://www.databaseanswers.org/data_models/index.htm
An excellent technique you can use is called Entity-Relationship diagrams. They help you model out the aspects of your universe (in this case the school) you care about in order to build a good database.
There are many books that dwell on the question. But for a simple introduction (and links to other very useful articles) wikipedia is the place to start link.
A very useful rule-of-thumb to remember when using Entity-Relationship diagrams is that most of the time (almost always) a box in the ER diagram is a table in the database. A diamond on the other hand sometimes is and sometimes is not.
Read on this kinds of Diagrams, after you've done the first you will see it is an extremely powerful tool for modeling different universes.
Google for "open source school administration software". Then comparing all the solutions you will find with what you know about your domain will give you a far better idea of your requirements than we can.