From: scubadiver on

http://www.databaseanswers.org/data_models/index.htm

go to the number 82 for some ideas.

"Kris D" wrote:

> I am trying to create a database for a book program that I run. I am
> currently using an excel spreadsheet to track all books in inventory and who
> they are checked out to, but I know a database would be a lot easier so that
> more than one person can make transactions at the same time.
>
> The problem I have is I don't know what should be set as the primary key,
> and how I should se the relationships. I made three tables; Students table
> (fields: social, student ID, name, address, phone number), book table
> (fields: ISBN number, title, author, category, purchase price, discontinue
> date), and transactions table (fields: Book, Checked Out To, Checked Out
> Date, Due Date, Checked In Date).
>
> I have several copies on most of the books in inventory with the same ISBN
> number, and wasn't sure how to distinguish each book as a different copy and
> which field should be a primary key. I thought of usig the ISBN number as a
> primary key and at the end of each ISBN number place a dash 01 for the first
> copy, dash 02 and so on???
>
> The second problem I am trying to do is relate all three tables together.
> One student can check out as many books as they want, so I wasn't sure if
> about the one-to many relationships, or one-to-one relationships.
>
> Can someone give me some suggestions on how to create this database?
>
> Thanks
>