Results 1 to 9 of 9

Thread: [RESOLVED] Library Management System

  1. #1

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Resolved [RESOLVED] Library Management System

    Hi Guys,

    I am creating a Library Management system. I've got the basic tables like members, books etc. I'm wondering how I should handle borrowing and returning of books. Should I use one table or two? Please advise.

  2. #2
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: Library Management System

    I would say two tables.
    1.) to maintain transactions with fields, BookId, MemberId, BorrowedDate, ReturnDate, IsCheckedOut (or IsBorrowed, whatever makes sense).
    2.) To maintain active check outs. This table will have a row inserted every time there is an insert in transactions table above and a delete every time there's an update to the table above (to set IsCheckedOut to false).

  3. #3
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Library Management System

    I would disagree with the second table, that's a denormalisation and just means you have to maintain checked out books in two places instead of one.

    Instead you just need the transactions table with BookID, MemberID, CheckedOutDate and CheckedInDate.

    To see checked out books you just look for transactions with a checked out date but no checked in date.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  4. #4
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: Library Management System

    Quote Originally Posted by FunkyDexter View Post
    I would disagree with the second table, that's a denormalisation and just means you have to maintain checked out books in two places instead of one.
    Right. For a moment I guess I forgot about views.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Library Management System

    a table for books, a table for borrowers, and one table for check outs & ins..... the checkout table would have an ID, the book ID, the borrower id, the checkout date, and a due date... the check-in date would be left null, until the book is checked in.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: Library Management System

    Thanks guys. Will go with tg's answer

  7. #7

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: Library Management System

    hey techgnome,

    a table for books, a table for borrowers, and one table for check outs & ins..... the checkout table would have an ID, the book ID, the borrower id, the checkout date, and a due date... the check-in date would be left null, until the book is checked in.
    I'm using the table for borrowers as you suggested. I need to be able to reserve a book as well if it is out. How should I handle this?

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] Library Management System

    Expand the check out table ... add a Reserved field, then when a book is reserved... set the flag, and don't set a checkout date...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: [RESOLVED] Library Management System

    thanks techgnome

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width