Results 1 to 9 of 9

Thread: [RESOLVED] Library Management System

  1. #1
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 07
    Location
    Death Valley
    Posts
    2,521

    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 04
    Location
    All useless places
    Posts
    916

    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
    Hirsute Mumbler FunkyDexter's Avatar
    Join Date
    Apr 05
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    2,437

    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.
    When one of my minions says, "Hey, he's just one guy, what can he do?" I say "This"... and shoot them.

    The problem with putting your lair in a volcano is keeping your robot army from melting.

    I know that the human being and the fish can coexist peacefully - George Bush

  4. #4
    Fanatic Member
    Join Date
    Jun 04
    Location
    All useless places
    Posts
    916

    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 02
    Posts
    21,791

    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 subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * 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??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  6. #6
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 07
    Location
    Death Valley
    Posts
    2,521

    Re: Library Management System

    Thanks guys. Will go with tg's answer

  7. #7
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 07
    Location
    Death Valley
    Posts
    2,521

    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 02
    Posts
    21,791

    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 subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * 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??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  9. #9
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 07
    Location
    Death Valley
    Posts
    2,521

    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
  •