Deadly mistakes when working with SQL

Introduce

A few days ago, when I went to stackoverflow to ask some questions related to SQL, I heard about the concept of SQL Antipattern. Unlike design patterns , anti pattern is a way to solve problems, but using it … causes more problems. A well-known antipattern is smoking tobacco instead of cigarettes , this is a way to stop smoking but will cause more sanitation and environmental problems.

image-1431423806-cach-hut-thuoc-lao
Since I used this, I quit smoking cigarettes

Find out more, I found this book "SQL Antipattern". This book is highly appreciated on amazon, talking about mistakes that are easily made when designing and using SQL Database. The content is very useful for database administrators or back-end developers .

Summary

The book content consists of 4 small parts:

  • Part 1 : Antipattern in database design (Logical Level)
  • Part 2 : Antipattern in database design (Physical Level)
  • Part 3 : Antipattern when writing a Query
  • Part 4 : Antipattern when working with code

The book layout is quite clear, each part is divided into chapters, each chapter refers to a design pattern . The structure of each chapter is easy to understand, including 5 parts:

  • The problem we need to solve
  • Common mistakes, use Antipattern to solve
  • How to recognize Antipattern
  • Pros and cons of that antipattern
  • Correct solution

Screen Shot 2016-09-22 at 10.42.40 AM

The author explained very briefly and easily understand the pros / cons that these anti-patterns bring. Instead of lengthy explanations, the author also suffers from accompanying diagrams and SQL statements, making it easy to visualize problems and solutions.

Screen Shot 2016-09-22 at 10.43.03 AM

Part 1 to Part 3 is quite good, knowledge in these sections is very useful and can be applied immediately. The last part is a bit biased towards programming languages , those who use PHP will find it useful, myself find it a bit redundant.

Comment

My feeling after I finished reading this book is "I have sunshine in my life since then", feeling that I have enlightened many things that were still difficult before. The text in the book is quite simple to understand, with many diagrams and SQL attached, so it is easy to absorb. However, to be able to read this book, you should have a little basic knowledge about SQL (Table, row, column, index, v … v), should also have some experience in database design.

Maybe some of you will ask: O, DB design is the job of Database Admin, I only use it, so is there any useful reading? Let's go along, because books also mention quite a bit wrong when we write queries and so on. Also, knowing DB and DB design is almost mandatory if you want to do a full-stack developer.

Screen Shot 2016-09-22 at 10.44.03 AM

Some of you will wonder: Eh, now I use Hibernate, Entity Framework, etc. What do I need to know about SQL? In essence, these frameworks still create pure SQL. In order for the code to run fast, you must learn the nature, know how to index the table and so on, so the knowledge in the book is not redundant.

As I mentioned at the beginning of the post, the back-end developers and database administrators should read this book, so do students. Encouraging new students to complete the Advanced Database course to read the book once, after working for a while, contacting the database will read it again for permeability.

Rating : 8.5 / 10

Bonus : Some good friend made a slide summarizing the main points of the book here, anyone who is afraid of reading can come and see.

Share the news now