Home > Database > Mysql Tutorial > What is the difference between sql and mysql syntax

What is the difference between sql and mysql syntax

清浅
Release: 2020-09-17 10:06:00
Original
3749 people have browsed it

The difference between sql and mysql syntax: 1. Mysql supports enum and set types, but sql does not support it; 2. MySQL’s increment statement is AUTO_INCREMENT, while SQL is identity(1,1); 3. Same Under load pressure, MySQL consumes less CPU and memory, while SQL consumes resources.

What is the difference between sql and mysql syntax

The syntax difference between MySQL and SQLServer

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

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

3. MySQL’s increment statement is AUTO_INCREMENT, while SQL is identity(1,1)

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

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

6. The SQL identifier is [], [type], which means it is different from keywords, but MySQL is `, which is the symbol on the left side of button 1

7. SQL supports the getdate() method to obtain the current time and date. However, MySQL can be divided into date type and time type. To obtain the current date is current_date (), and the current complete time is the now() function

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

9. MySQL supports

insert into table1 set t1 = „‟, t2 = „‟
Copy after login

but MS SQL does not support writing like this

10. MySQL supports

insert into tabl1 values (1,1), (1,1), (1,1), (1,1), (1,1), (1,1), (1,1)
Copy after login

11. MySQL is creating When creating a table, you must specify a storage engine type for each table, and MS SQL only supports 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. In MS SQL, to check whether the table exists before deleting it, you need this:

if exists (select * from dbo.sysobjects where id = object_id(N’uc_newpm’) 
and OBJECTPROPERTY(id,N’IsUserTable’)=1)
Copy after login

But in MySQL, you only need

 DROP TABLE IF EXISTS cdb_forums;
Copy after login

14 , MySQL supports unsigned integers, so it can store double the maximum number than MS SQL that does not support unsigned integers

15. MySQL does not support the use of varchar() which is very convenient in MS SQL. max) type, this type can be used for both general data storage and blob data storage in MS SQL

16. To create a non-clustered index in MySQL, you only need to specify it as the key when creating the table, for example:

KEY displayorder (fid,displayorder)
Copy after login

In MS SQL it is necessary to:

create unique nonclustered index index_uc_protectedmembers_username_appid 
on dbo.uc_protectedmembers (username asc,appid asc)
Copy after login

17. The MySQL text field type does not allow default values ​​

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

19. A very superficial difference is that the installation of MySQL is very simple, and the file size is only 110M (non-installation version). Compared with the behemoth Microsoft, the installation progress is simply...

20. MySQL’s 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, while MS SQL is indeed very resource-consuming.

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

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

24.mysql Each sentence must end with ";"

25. The AS of SQLServer stored procedure needs to be replaced with begin...end in MySql

The above is the detailed content of What is the difference between sql and mysql syntax. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template