Page 1 of 1

work with an inventory, with some items having serial number

Posted: Tue Jun 26, 2018 10:50 pm
by Vegan
I was wondering how to use MySQL to handle an inventory system, easy enough when there is a simple count of the UPC for each item

I was wondering with electronics how to handle series numbers

clearly serial numbers are not useful as an index, while UPC is slightly more suitable

ideas?

Re: work with an inventory, with some items having serial nu

Posted: Wed Jun 27, 2018 12:50 pm
by Christopher
I would in general recommend an autoincrement INT for indexes. The product, serial, series, etc. numbers would be separate fields that can be indexed if they are to be searched in WHERE statements.

Re: work with an inventory, with some items having serial nu

Posted: Wed Jun 27, 2018 3:17 pm
by Vegan
That is more or less what I was figuring, more rows for those items with serial numbers.

products like iphone cables do not have a serial number, unlike the iphone itself

upc codes are abundant but imperfect

I was pondering 2 tables, one for the products and a bool then for those who have serial numbers,pull the data from another table which would simplify things a tad

Re: work with an inventory, with some items having serial nu

Posted: Thu Jun 28, 2018 11:17 pm
by Christopher
Vegan wrote:I was pondering 2 tables, one for the products and a bool then for those who have serial numbers,pull the data from another table which would simplify things a tad
Sounds like more work if there is just 1:1 relation -- just leave the serial number field empty if there isn't one. It's not like your disk will fill up with all those serial numbers.