《SQL反模式》的原文摘录

  • 这句查询语句所找到的后代路径分别是 1/4/5、1/4/6 以及 1/4/6/7。 (查看原文)
    银河 2回复 2012-04-28 23:06:23
    —— 引自第25页
  • 在多个列中查找一个值的语法是冗长乏味的。你可以通过一种非传统的方式来使用 IN,从而使得这个查询变得更加精简: (查看原文)
    银河 2012-04-29 21:18:02
    —— 引自第77页
  • 类似地,用户不能直接输入一个NULL。程序的输入端可能会使用一些特殊处理来引导用户输入NULL。比如,微软的.NET 2.0及以上版本,为Web界面提供了一个叫做ConvertEmptyStringToNull的方法。参数和绑定字段会自动地将空字符串转换成NULL。 (查看原文)
    银河 2012-04-30 19:17:19
    —— 引自第131页
  • Parameter.ConvertEmptyStringToNull 属性:获取或设置一个值,该值指示在 Parameter 对象绑定到的值为 String.Empty 时是否应将其转换为 null。 语法:public bool ConvertEmptyStringToNull { get; set; } 属性值:类型:System.Boolean。如果在 Parameter 绑定到的值为 String.Empty 时应将其转换为 null,则为 true;否则为 false。 默认值为 true。 (查看原文)
    银河 2012-04-30 19:17:19
    —— 引自第131页
  • ①搜索用户指定关键字。从 keywords、keyword_id 或 NULL 返回整型主键,如果这个词之前未出现过。 (查看原文)
    银河 2012-04-30 19:40:19
    —— 引自第160页
  • 比如,SHA-256 算法将我们的密码 xyzzy,转换成了一个 256 位的串,若使用 16 进制表示是一个 64 字节的字符串。 (查看原文)
    银河 2012-04-30 19:51:30
    —— 引自第184页
  • 下面是对 Accounts 表的重定义。SHA-256 的哈希密码总是一个 64 字节的字符串,因此这一列的类型是固定长度的 CHAR。 (查看原文)
    银河 2012-04-30 19:51:30
    —— 引自第184页
  • 比如,MySQL 6.0.5 的 SSL 扩展支持包含了 SHA2() 的函数,它默认返回一个 256 位的哈希串。 (查看原文)
    银河 2012-04-30 19:51:30
    —— 引自第184页
  • 所谓专家,就是在一个很小的领域里把所有错误都犯过了的人.----尼尔斯.波尔 (查看原文)
    shenzhw 2013-01-31 09:26:59
    —— 引自第1页
  • 如果你想把一只猫肢解了来研究它是怎么工作的,那么首先你要得到一只不工作的猫 (查看原文)
    shenzhw 2013-01-31 10:37:26
    —— 引自第50页
  • Mitch Ratcliff说:“计算机是人类历史中,最容易让你犯更多错误的发明……除了手枪和龙舌兰之外。” (查看原文)
    麦秆书虫 2013-05-13 16:19:20
    —— 引自第204页
  • 这个项目在技术方面背负重重债务——使用捷径而不是最佳实践的后果。技术债务(technical debt)会不断给项目带来风险和额外的工作,直到你重构、测试并为代码编写文档。 (查看原文)
    麦秆书虫 2013-05-14 11:12:52
    —— 引自第215页
  • 在技术团队,对于数据库的通常认识和做法就是全由一个人来负责——DBA。因为DBA是唯一有权限访问数据库服务器的人,他通常被看作是一个活的资料库和版本控制系统。 (查看原文)
    麦秆书虫 1回复 2013-05-14 11:25:56
    —— 引自第216页
  • One weakness of Adjacency List is that it’s expensive to retrieve ancestors of a given node in the tree. In Path Enumeration, this is solved by storing the string of ancestors as an attribute of each node. You can see a form of Path Enumeration in directory hierarchies. A UNIX path like /usr/local/lib/ is a Path Enumeration of the filesystem, where usr is the parent of local, which in turn is the parent of lib. In the Comments table, instead of the parent_id column, define a column called path as a long VARCHAR. The string stored in this column is the sequence of ancestors of the current row in order from the top of the tree down, just like a UNIX path. You can even choose / as a separator character. (查看原文)
    龙三 2014-04-03 16:22:25
    —— 引自第41页
  • In the television series Star Trek,1 “tribbles” are small furry animals kept as pets. Tribbles are very appealing at first, but soon they reveal their tendency to reproduce out of control, and managing the overpopulation of tribbles becomes a serious problem. (查看原文)
    龙三 2014-04-08 11:14:23
    —— 引自第111页
  • Jamie Zawinski: Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems. (查看原文)
    龙三 2014-04-10 17:42:40
    —— 引自第190页
  • if the only tool you have is a hammer, treat everything as if it were a nail. (查看原文)
    龙三 2014-04-18 09:47:18
    —— 引自第281页