The main reason why I wrote MYSQL articles: I found that there are few articles on MYSQL on the Internet, and many of them are uneven. I can hardly find a comprehensive introduction; for example, an article describes how to add, delete, modify, and query data, but does not introduce batch addition. The main reason why I need to write a MYSQL article next time I use it in my work: I found that there were few articles on MYSQL on the Internet, and many of them were uneven. I could not find a comprehensive introduction. for example, I wrote an article about how to add, delete, modify, and query data, but did not introduce batch addition; so when I use it in my next job, I need to search again and find the article about batch addition, but I didn't introduce how to copy table data. so I need to search again when I use it in my next job .... it is this scattered knowledge that makes me feel very complicated to search, so I plan to organize a piece of work material that can satisfy the general usage of MYSQL, which can summarize the knowledge and contribute to others. Hope you can stick to it and never forget your original intention.
Start text
This article mainly introduces some precautions for using mysql. it should have been the first article in the [MYSQL] Classification. However, in actual work, no one will teach you how to use MYSQL at the beginning, so I will summarize all kinds of difficulties in my work.
1. install the interface program
To do well, you must first sharpen your tools. Therefore, the first thing to do is to find a good tool. It is widely recognized on the Internet that it is difficult to get started with mysql because mysql does not have interface programs. To learn about mysql, you often need to remember a bunch of commands and then enter the command line in the dark cmd interface. This scenario is difficult for most users who are used to window.
In order to let everyone feel it, we specially seek images online.
I don't think it is necessary to write a command line. some things only need to know the principle, so you don't have to go into it. a person's life is limited, so you need to concentrate on learning the most valuable knowledge for yourself.
There are many interface programs for mysql. I recommend SQLyog (which is used by my company). The interface layout is quite similar to MSSQL, so that I can use it almost instantly when I use MSSQL, some functions are more convenient than MSSQL.
2. notes for writing statements
1. semicolon;
In MYSQL, if you want to execute multiple query statements at a time, each statement must be followed; therefore, you will get used to it after writing the SQL statement;
2. comment --
When you use -- to annotate a single line, you must add a space after --; otherwise, an error is reported.
3. process control statement if else, while
Mysql Query statements do not contain flow control statements such as if else and while. flow control statements must be written to the stored procedure.
4. space
Mysql has strict statement format. If an error is reported during statement execution but the cause cannot be found after multiple checks, you can delete unnecessary spaces.
Now I think of the above four points. after learning about the above points, I should be able to smoothly write SQL in mysql.