Re: Upgrade from 5.6 => 5.7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 9/16/11, Always Learning <centos@xxxxxxxxxxx> wrote:
> 	C1
>
> 	c1ref
> 	c1customer	(code)
> 	c1quantity	(integers only)
> 	c1price		(in cents)
> 	c1discount	(2 decimal places held as integers)
> 	c1catalogue	(code)
> 	c1date		(yymmdd)
> 	c1order		(number)
> 	c1comments	(text)
>
> then do a query:
>
> select c1quantity, c1price, c1discount from c1 where c1customer =
> 'joebloggs' and c1date like '10%'

Isn't it bad practise to store customer reference by name? What
happens if we want to look up a customer called John Smith and there
are say a dozen of them?

I would at the very least have a separate table holding core customer
information with an auto-incremented ID so that customers with the
same name won't cause a problem. Of course, that would mean requiring
a join on the query, or at the very least two queries with one pulling
the customer ID first. Although since the base customer ID table is
usually a frequently accessed but not changed table, it's likely to be
in memory and therefore faster to issue a join, which the dbms should
handle smartly enough than to separate queries.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux