SQL Antipatterns (for Amanda Dunlap) by Bill Karwin
Author:Bill Karwin
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 1-934356-55-7
Publisher: The Pragmatic Bookshelf, LLC (212800)
SELECT * FROM Bugs WHERE assigned_to <> NULL;
The condition in a WHERE clause is satisfied only when the expression is true, but a comparison to NULL is never true; itâs unknown. It doesnât matter whether the comparison is for equality or inequality; itâs still unknown, which is certainly not true. Neither of the previous queries return rows where assigned_to is null.
Using Null in Query Parameters
Itâs also difficult to use null in a parameterized SQL expression as if the null were an ordinary value.
Fear-Unknown/anti/parameter.sql
SELECT * FROM Bugs WHERE assigned_to = ?;
The previous query returns predictable results when you send an ordinary integer value for the parameter, but you canât use a literal NULL as the parameter.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7894)
Learning SQL by Alan Beaulieu(5464)
Weapons of Math Destruction by Cathy O'Neil(5094)
Big Data Analysis with Python by Ivan Marin(3263)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(2961)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(2942)
Blockchain Basics by Daniel Drescher(2927)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(2853)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(2640)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2600)
Pandas Cookbook by Theodore Petrou(2526)
Mastering Python for Finance by Unknown(2523)
Driving Data Quality with Data Contracts by Andrew Jones(2518)
Data Engineering with dbt by Roberto Zagni(2341)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(2308)
How The Mind Works by Steven Pinker(2252)
Network Science with Python and NetworkX Quick Start Guide by Edward L. Platt(2081)
Building Machine Learning Systems with Python by Richert Willi Coelho Luis Pedro(2072)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2050)