Hi,



I'm a non-computer teacher, trying to teach computers!

I'm trying to make a basic class library.

I've done this with 3 tables;
(i) Students (student ID primary key, first name, last name etc).
(ii) Books (book ID primary key, author, year of publication etc)
(iii) Loans (loan ID primary key, student ID, Book ID, date out, date returned etc).

I made a one-to-many relationship between Students and Loans (because one student can have many loans) and between books and loans (because one book can go out on many loans ? - not too sure about this relationship, because a book can only go out on one loan at a time?).

I've managed to make queries that give me the loan status of books that have gone out. Ie: Query tells me whether they're still out, or have been returned, whether they were returned late or on time, and if they're overdue, by how much. That part has been done successfully.

The problem is that I can't seem to make a query that involves books that have not been loaned out. I guess that is because there is no relatonship between the book and loan tables until it has been taken out on loan.

Ideally I'd like a books query that says the stuff I've figured out above (ie: due in x days, overdue by x days or ... (the part I can't do)...still on shelf.

Do I need to change my relationships to do this? Any advice is much appreciated.

Dave