chris webster wrote:
Jacky Luk wrote:should i keep more than one of these tables,one for customers, transactions, sales etc?
Don't use this approach at all if you can help it, because you will spend lots of time chasing race conditions, duplicate fetches or dead-locks and other sources of inconsistency and misery.
If you want a unique ID for e.g. a Customer, use the built-in facilities provided by your database to generate unique numbers. On Oracle/PostgreSQL, you can use a sequence to populate an ID. On MySQL/MariaDB you can define auto-increment columns that can be populated by the database. These solutions will be robust, transaction-safe and scalable. Your hand-crafted solution probably will not.
Thanks Chris, I've got one more question to ask you.
Say if I have a log table in which there is a id, customerid,
And the maintaience table has a id, customerid
Notice these 2 ids are not identical. By using relational database, they are
generated at different places as you can see, if these 2 ids are not the same
I can't uniquely identify which elog entry belongs to which maintainence record.
How do I solve this issue?
Thanks
Jack