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

Syntax differences between sql and mysql

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly gives you a brief introduction to the grammatical differences between sql and mysql. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here, so let's go straight to the topic. I hope this article on the grammatical differences between sql and mysql can bring you some practical help.

The differences between sql and mysql syntax are: mysql supports enum and set types, sql does not, mysql needs to specify a storage type for tables, text field types in mysqlL are not allowed to have default values, sql allows, and so on.

Grammatical differences between MySQL and SQLServer

1. MySQL supports enum and set types, but not SQL Server.

2. MySQL does not support nchar,nvarchar,ntext type.

3. The increment statement of MySQL is AUTO_INCREMENT, while MS SQL is identity.

4. By default, the default value of MS SQL everywhere table creation statement is ((0)), but two parentheses are not allowed in MySQL.

5. MySQL needs to specify the storage type for the table

6. The MS SQL identifier is [], and [type] indicates that it is different from the keyword, but MySQL is `, that is, the symbol to the left of button 1.

7. MS SQL supports the getdate () method to get the current time and date, but MySQL can be divided into date type and time type. The current date is current_date (), and the current full time is the now () function.

8. MS SQL does not support replace into statements, but in the latest sql20008, merge syntax is also supported

9. MySQL support

Insert into table1 set T1 = "", T2 = ""

But MS SQL does not support writing like this.

10. MySQL support

Insert into tabl1 values (1), (1), (1), (1), (1), (1)

11. MySQL specifies a storage engine type for each table when creating tables, while MS SQL supports only one storage engine

12. MySQL does not support the datetime type whose default value is the current time (MS SQL is easy to do). In MySQL, the timestamp type is used.

13. Check whether the table is deleted in MS SQL. You need to do this:

If exists (select * from dbo.sysobjects where id = object_id (newpm') and OBJECTPROPERTY (id,N'IsUserTable') = 1)

But in MySQL, all you need is

DROP TABLE IF EXISTS cdb_forums

14. If MySQL supports unsigned integers, it can store twice as much maximum data as MS SQL without symbols.

15. MySQL does not support the very convenient varchar (max) type in MS SQL. This type can be used for both general data storage and blob data storage in MS SQL.

16. For MySQL to create a nonclustered index, you only need to specify key when creating the table, for example:

KEY displayorder (fid,displayorder)

In MS SQL, you must:

Create unique nonclustered index index_uc_protectedmembers_username_appid on dbo.uc_protectedmembers (username asc,appid asc)

17. Default values are not allowed for MySQL text field types

18. The total field length of a table in MySQL does not exceed 65XXX.

19, a very superficial difference is that MySQL installation is very simple, and the file size is only 110m (non-installation version), compared with the Microsoft behemoth, the installation progress is simply …

20. MySQL stored procedures only appear in the latest version, and their stability and performance may not be as good as MS SQL.

21. Under the same load pressure, MySQL consumes less CPU and memory, and MS SQL really consumes a lot of resources.

22. The ifnull () function of mysql corresponds to the isnull () function of sql

23. Remove @ from the definition of variables in the stored procedure of mysql

24. Use ";" at the end of each sentence of mysql.

25. The AS of SQLServer stored procedures needs to use begin in MySql. End replacement

This is the difference between sql and mysql grammar. If you want to know about other related issues, you can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

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

Database

Wechat

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

12
Report