X-No-Archive: true
Good advice... and no, the 'four tables' was a typo; :) So far, there are only three...
I reckon we're not going to split stock into two tables, but your point raises an important question. If I look over my shoulder, say we take Spanish books. There are six or seven copies of each. Does each one have an unique stock_id?
And our ultimate aim is for a barcode reader to be used by the librarian. Any good sources to learn about that ?
Thanks again.
D.
Shane Ambler <pgsql@xxxxxxxxxxxxxxxx> a écrit :
Shane Ambler <pgsql@xxxxxxxxxxxxxxxx> a écrit :
Desmond Coughlan wrote:
> X-No-Archive: true
>
> Hi,
> Thanks for all the help: we have our postgreSQL server on a 'backend' machine, and the client on a webserver.
>
> The application I want to develop is a school library, and as this is new to me, I come looking for ideas. Here's what I've done: on the backend, two users (in addition to 'pgsql'): dba and 'cdi' (the name of the library, as in the _premises_ where the library is located). I create a database 'library', owned by dba, but with cdi having update privileges (but not 'drop table' etc).
>
> 'library' has four tables...
>
> 1. users (with user_ids, surname, first_name, dob, address etc...)
> 2. stock (stock_id, ISBN, title...)
> 3. loans (loan_id, stock_id [foreign key to stock_id], date_due)...
Not sure how complete your list is but I would add user_id [foreign key
to users] to loans - so you know who to chase when it isn't back - stop
them borrowing if they have overdues?
Personally I would have stock as two tables - one with book details
(which can include details for titles you don't have and maybe a list of
requests for them to decide new purchases) and the other with a stock_id
of each copy that you have and include a reason for removing stock
(damaged/never returned/missing/unwanted).
Or is that your missing fourth table?
--
Shane Ambler
pgSQL@xxxxxxxxxxxxxxxx
Get Sheeky @ http://Sheeky.Biz
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org/
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.