Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the SQL writing specifications?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what the SQL writing specifications are, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Absolutely forbid 1: multiple tables with a long list of left join associations

Absolutely forbid 2: the act of not writing comments

Absolutely forbid 3: table aliases use a single meaningless letter

4: nested queries with more than two layers are absolutely prohibited

Recommendation 1: when making a fuzzy query, the string in the prohibition condition begins with "%" directly.

Recommendation 2: when merging result sets (union or union all), if there is no need for result deduplication, union all must be used, but union; cannot be used and data set deduplication must be minimized

Suggestion 3: try to avoid using reverse writing methods such as not exist/no in. If you have to use it, try to choose not exist

Recommendation 4: minimize the use of null processing such as is null/is not null

It is recommended that the value in the IN clause in the 5:SQL statement should not exceed 30

Recommendation 6: for columns in large table queries, conversions such as CAST () or CONVERT () should be avoided as far as possible

What about the SQL writing specifications to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report