3 Replies - 2183 Views - Last Post: 15 November 2012 - 03:14 AM Rate Topic: -----

#1 max_lk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-November 12

db design problem (Library Management System)

Posted 15 November 2012 - 01:56 AM

Hi,

I'm going to develop basic library management system using java swing.

Now my problem is this,

What is the easiest way to add new book to the DB with several number of copies?

As an example if, 'Book A' has two copies how do i need to insert? I'm thinking to generate book id for a book...but if there are more than one cope there will be a conflict. (Because 2 books can not have 1 book id )

any solution???

thank you in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: db design problem (Library Management System)

#2 rnty  Icon User is offline

  • D.I.C Head

Reputation: 20
  • View blog
  • Posts: 150
  • Joined: 14-August 12

Re: db design problem (Library Management System)

Posted 15 November 2012 - 03:02 AM

Hello max_lk
Libraries often keep a single copy of a particular book that is never rented out,just as a reference for the books available in the library.
You can go for a composite primary key I suggest.Say you bought 10 copies of Book A.One copy can be labelled as the reference version and the others as rent version.So now you have Book A with book ID say bk0001.

Book_ID Book_Type
bk0001 ref
bk0001 rent01
bk0001 rent02
...and so on.Hope this helps
Was This Post Helpful? 0
  • +
  • -

#3 rnty  Icon User is offline

  • D.I.C Head

Reputation: 20
  • View blog
  • Posts: 150
  • Joined: 14-August 12

Re: db design problem (Library Management System)

Posted 15 November 2012 - 03:03 AM

Hello max_lk
Libraries often keep a single copy of a particular book as a reference for the books available in the library.This copy is never rented out.
You can go for a composite primary key I suggest.Say you bought 10 copies of Book A.One copy can be labelled as the reference version and the others as rent version.So now you have Book A with book ID,say bk0001.

Book_ID Book_Type
bk0001 ref
bk0001 rent01
bk0001 rent02
...and so on.Hope this helps

Hello max_lk
Libraries often keep a single copy of a particular book that is never rented out,just as a reference for the books available in the library.
You can go for a composite primary key I suggest.Say you bought 10 copies of Book A.One copy can be labelled as the reference version and the others as rent version.So now you have Book A with book ID say bk0001.

Book_ID Book_Type
bk0001 ref
bk0001 rent01
bk0001 rent02
...and so on.Hope this helps

This post has been edited by rnty: 15 November 2012 - 03:06 AM

Was This Post Helpful? 0
  • +
  • -

#4 max_lk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-November 12

Re: db design problem (Library Management System)

Posted 15 November 2012 - 03:14 AM

View Postrnty, on 15 November 2012 - 03:03 AM, said:

Hello max_lk
Libraries often keep a single copy of a particular book as a reference for the books available in the library.This copy is never rented out.
You can go for a composite primary key I suggest.Say you bought 10 copies of Book A.One copy can be labelled as the reference version and the others as rent version.So now you have Book A with book ID,say bk0001.

Book_ID Book_Type
bk0001 ref
bk0001 rent01
bk0001 rent02
...and so on.Hope this helps

Hello max_lk
Libraries often keep a single copy of a particular book that is never rented out,just as a reference for the books available in the library.
You can go for a composite primary key I suggest.Say you bought 10 copies of Book A.One copy can be labelled as the reference version and the others as rent version.So now you have Book A with book ID say bk0001.

Book_ID Book_Type
bk0001 ref
bk0001 rent01
bk0001 rent02
...and so on.Hope this helps


tanx for the comment, dat may be a good idea
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1