Book description
SQL is the ubiquitous language for software developers working with structured data. Most developers who rely on SQL are experts in their favorite language (such as Java, Python, or Go), but they're not experts in SQL. They often depend on antipatterns - solutions that look right but become increasingly painful to work with as you uncover their hidden costs. Learn to identify and avoid many of these common blunders. Refactor an inherited nightmare into a data model that really works. Updated for the current versions of MySQL and Python, this new edition adds a dozen brand new mini-antipatterns for quick wins.
No matter which platform, framework, or language you use, the database is the foundation of your application, and the SQL database language is the standard for working with it. Antipatterns are solutions that look simple at the surface, but soon mire you down with needless work. Learn to identify these traps, and craft better solutions for the often-asked questions in this book. Avoid the mistakes that lead to poor performance and quality, and master the principles that make SQL a powerful and flexible tool for handling data and logic.
Dive deep into SQL and database design, and learn to recognize the most common missteps made by software developers in database modeling, SQL query logic, and code design of data-driven applications. See practical examples of misconceptions about SQL that can lure software projects astray. Find the greatest value in each group of data. Understand why an intersection table may be your new best friend. Store passwords securely and don't reinvent the wheel. Handle NULL values like a pro. Defend your web applications against the security weakness of SQL injection.
Use SQL the right way - it can save you from headaches and needless work, and let your application really shine!
What You Need:
The SQL examples use the MySQL 8.0 flavor, but other popular brands of RDBMS are mentioned. Other code examples use Python 3.9+ or Ruby 2.7+.
Publisher resources
Table of contents
- Â Acknowledgments
- Â Introduction
- 1. Whatâs an Antipattern?
- Part I. Logical Database Design Antipatterns
- Part II. Physical Database Design Antipatterns
- Part III. Query Antipatterns
- Part IV. Application Development Antipatterns
-
Part V. Bonus: More Foreign Key Mini-Antipatterns
-
26. Foreign Key Mistakes in Standard SQL
- Reversing the Direction of Reference
- Referencing Tables Before They Have Been Created
- Referencing No Key of the Parent Table
- Creating Separate Constraints for Each Column in a Compound Key
- Using the Wrong Column Order
- Using Mismatched Data Types
- Using Mismatched Character Collations
- Creating Orphan Data
- Using the SET NULL Option for Non-Nullable Columns
- Making Duplicate Constraint Identifiers
- Using Incompatible Table Types
- 27. Foreign Key Mistakes in MySQL
-
26. Foreign Key Mistakes in Standard SQL
- A1. Rules of Normalization
- Â Bibliography
Product information
- Title: SQL Antipatterns, Volume 1
- Author(s):
- Release date: October 2022
- Publisher(s): Pragmatic Bookshelf
- ISBN: 9781680508987
You might also like
book
SQL Antipatterns
Bill Karwin has helped thousands of people write better SQL and build stronger relational databases. Now …
book
Learning SQL, 3rd Edition
As data floods into your company, you need to put it to work right away—and SQL …
book
SQL in a Nutshell, 4th Edition
For programmers, analysts, and database administrators, this Nutshell guide is the essential reference for the SQL …
book
SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition
The #1 Easy, Common-Sense Guide to SQL Queries—Updated with More Advanced Techniques and Solutions Foreword by …