Is there such a thing as Design Patterns in SQL ???
-
3Does this refer to DB design or patterns for queries?Robben_Ford_Fan_boy– Robben_Ford_Fan_boy2010-05-06 20:49:25 +00:00Commented May 6, 2010 at 20:49
-
1If you're talking about how to write a select statement for a certain scenario then I totally hear you on this question.Steven– Steven2010-10-27 23:10:50 +00:00Commented Oct 27, 2010 at 23:10
-
Joe Celko's SQL Programming StyleGiorgi– Giorgi2012-04-30 20:09:56 +00:00Commented Apr 30, 2012 at 20:09
Add a comment
|
3 Answers
Yes. :)
SQL Design Patterns: Expert Guide to SQL Programming
(Not even sure if this is a recommended book.. just illustrating that "proper design" exists).
3 Comments
dannyrosalex
I live in a universe of "improper design" in both the host side(.NET) and database side(MS SQL SERVER). I am just wondering if I will ever get to work in an evironement where fellow programmers DON'T take pride in shunning books and "GETTING THE JOB DONE".
08Hawkeye
You and me both my man. We are constantly balancing results vs. good OO code. Seems like one or the other always has to suffer...
CheckRaise
This book costs as much as a SQL Server License
You may want to look at database normalization which is some sort of general Design Pattern in SQL.
3 Comments
Eno
There is also a SQL 'anti-pattern' book coming soon. pragprog.com/titles/bksqla/sql-antipatterns
Adam Musch
And I've looked at two chapters of said book, and at this point, it's got some magnificent errors in it. The following from the book is supposed to fetch a random row from a table in Oracle, and it's got two showstopper errors in it: $offset = $pdo->query("SELECT dbms_random.value(1, (SELECT COUNT(*) FROM Bugs) AS offset FROM dual)")->fetch(); $stmt = $pdo->prepare("SELECT * FROM Bugs WHERE ROWNUM = :offset" ); $stmt->execute( $offset ); $rand_bug = $stmt->fetch();
Nazar Merza
SQL design pattern is different from Database Design Pattern. SQL design pattern is about programming, not database design.