Database design help please.
Posted by: Maa Miin
Date: March 16, 2012 03:37AM

I have messed around with my database , but still didnt get good and optimized structure. Currently I did one big table hundred of duplicated records with it :(

Please can anybody give some good advice how to solve this quite simple looking project :)
Problem description:
* I have 1..N warehouses.
* Each warehouse has products in it (all with same parameters).
* There are 2 type of products depend of lifetime.
A. Best before (starts ticking when added to database)
B. Usage time in years (starts when product will loaned out to someone)
* Products are in groups (2-level products tree Group->Product)

Events that can occur with product:
ADD: set product params + number of product, time, place, cash_amount, Paym.method, descr of payment.
MOVE: from one warehouse to other (1..N products)
LOAN: loan out 1..N products to person (time) (persons list is in table t_person)
MAINTENANCE: Any product can be in maintenance: loaned or in warehouse (maintenance start time, description and duration)
END_OF_EXPL.: time, reason

My problem is that I cant design properly that when I buy by example 100 new products and put in Warehouse A (with lifetime N). How to store information for that I put 25 products to Warehouse B, 2 products loaned out to person X and 3 to person Y and 10 are in maintenance. And after some time Warehouse B sent some products back to Warehouse A. And after some time added more of same products to warehouse A (with other lifetime). etc etc...
How to save all this kind activity in normalized way? So I can any time ask from database how many items are in Warehous A, B, ..., how many products are in maintenance total and in each warehouse. How many products in which warehouse is over due ( by best before time, by loaned out product lifetime, and maintenance duration ended...) etc etc.
When somebody can help with better and normalized structure I can do other queries to get all those required info.

This is not school project, its real project. But I'm not wery good with databases. I can do programming thats all ok, but database designing makes some difficulties..

Sorry my bad english...

Thank You for any help!

Options: ReplyQuote


Subject
Written By
Posted
Database design help please.
March 16, 2012 03:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.