I am very new to database designing.
I have a doubt. The question is very basic. But please help me out. i will try to expain it through an example.
Suppose, I got books in one table and their authors in the other(assuming that one book is written by just one author(one to many) and one author can write many books(many to one)). I am not getting how exactly to link the tables and what should be auto-incremented?
tblBooks //Table 1 contains two entities
{
bookId // This field is auto-incremented
bookName
}
tblAuthors //Table 2
{
authorId // Should this field also be auto-incremented?
authorName
Field3 // What should be the 'Field3' then which acts as link between both the tables?
// What exactly is foreign key? Here 'Field3' would be foreign key or what?
}
Help appreciated