Comments on: A review of SQL Antipatterns by Bill Karwin http://www.xaprb.com/blog/2011/06/11/a-review-of-sql-antipatterns-by-bill-karwin/ Stay curious! Thu, 02 May 2013 12:36:53 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: Xaprb http://www.xaprb.com/blog/2011/06/11/a-review-of-sql-antipatterns-by-bill-karwin/#comment-19440 Xaprb Mon, 20 Jun 2011 14:09:05 +0000 http://www.xaprb.com/blog/?p=2371#comment-19440 Lonny, Google Adwords does something similar, too — they call it “micros”. I didn’t know about the accounting standards. Thanks!

]]>
By: Lonny Eachus http://www.xaprb.com/blog/2011/06/11/a-review-of-sql-antipatterns-by-bill-karwin/#comment-19437 Lonny Eachus Fri, 17 Jun 2011 16:11:14 +0000 http://www.xaprb.com/blog/?p=2371#comment-19437 Here is your message:

Storing pennies is not a good idea, and not just because it doesn’t meet accounting standards (you must have at least two decimal places past the smallest unit). Standards aside, you still need those extra digits to avoid rounding errors, AND if you are going to scale it anyway (storing pennies means you still have to shift decimal places by 2 to represent dollars), then you might as well go the full route and scale it by 4 places rather than two.

That is the approach taken by Microsoft in their “currency” data type: it is represented internally be an integer, but when displayed it appears as though it has been scaled by 10^4 (hundredths of a penny).

]]>
By: Shlomi Noach http://www.xaprb.com/blog/2011/06/11/a-review-of-sql-antipatterns-by-bill-karwin/#comment-19417 Shlomi Noach Sun, 12 Jun 2011 05:02:55 +0000 http://www.xaprb.com/blog/?p=2371#comment-19417 I share your view of this book. It is an easy, yet instructive read.

I think the success of this book comes from Bill’s excellent observation, which he shares up front:
Developers are excelling with their programming skills; are taught how to optimize their Java/PHP/C++ code; know their libraries. SQL, however, is not a major skill for them, and they do not expertise with it.

This observation cannot be stressed enough, I believe. All developers doing SQL coding should think this over.

One thing to note about the book: although it may appeal to all RDBMS SQL developers, all examples in this book use MySQL dialect, and many issues revolve around what MySQL can or cannot do.

]]>