I have recently learnt the basics of mysql, ie - creating a table, select queries, using joins etc.
However I have a couple of questions before rushing into designing the database for my site and was hoping I could get some advivce here?
If I have say list of books with title, author, date added, id and a couple of other columns. Would this be best going in one big table or several smaller ones, bearing in mind the following:
- I would never actually need to display all the books from the table at once, because the way the site is laid out you select the catergory you are interested in from the index page for instance sci-fi or romance, soi was thinking that when a user went to there chosen section I would have a column on the table called genre and use a where genre = \"romance\", however would this be slower than me simply creating a seperate table for romance, sci-fi etc. There would eventully be about 15,000 rows.
My other question is regarding locking tables, I did not really get this in the manual and the tutorial from sitepoint did not go into it. But I think I may need to lock tables because I want to give people the option to rate books, but am worried that when someone votes and the column with the current rating gets updated, if someone else looks at the table and starts a select query that either it wont update correctly, get corrupted or just crash. Should I be locking the tables or not?
If anyone knows a good tutorial on locking that is simple (I am a rank amatuer at this) then I would be very grateful for there help.
Thanks for any help - Neil