Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Table Design

Author  Topic 

john.lam
Starting Member

12 Posts

Posted - 2010-01-15 : 01:13:43
Hi all,

I have a table udt_HireItems which stores all the items hired by the customers. I need to store additional data into the database for the returns records, like return date, status, penalty amount etc. My question is, should I store these returns data into the same table, i.e. udt_HireItems, by adding additional columns, or create a new table for these returns data and reference to the RecordId for each item?

Thanks

John Lam

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-15 : 01:31:52
since items can be hired by several customers over period of time its better to keep them in separate table with two dates hiredate (start of hiring) and return date (end of hire period) and with your other details. also you could put customerid here as same item can be hired by different customers in different period.
Go to Top of Page

john.lam
Starting Member

12 Posts

Posted - 2010-01-15 : 01:58:07
quote:
Originally posted by visakh16

since items can be hired by several customers over period of time its better to keep them in separate table with two dates hiredate (start of hiring) and return date (end of hire period) and with your other details. also you could put customerid here as same item can be hired by different customers in different period.



Sorry that I didn't mention clearly, the table udt_HireItems stores the items hired by customers, i.e. transaction records for particular customers. So does it mean it's ok for me to put the returns data into udt_HireItems?

John Lam
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-15 : 02:03:22
quote:
Originally posted by john.lam

quote:
Originally posted by visakh16

since items can be hired by several customers over period of time its better to keep them in separate table with two dates hiredate (start of hiring) and return date (end of hire period) and with your other details. also you could put customerid here as same item can be hired by different customers in different period.



Sorry that I didn't mention clearly, the table udt_HireItems stores the items hired by customers, i.e. transaction records for particular customers. So does it mean it's ok for me to put the returns data into udt_HireItems?

John Lam


ok in that case just put date and other fields in that table itself.
Go to Top of Page
   

- Advertisement -