01:SELECT 列名称 FROM 表名称
02:SELECT DISTINCT 列名称 FROM 表名称
03;SELECT 列名称 FROM 表名称 WHERE 列 运算符 值
04:AND&OR
eg:SELECT * FROM Persons WHERE FirstName='Thomas' AND LastName='Carter'
eg:SELECT * FROM Persons WHERE firstname='Thomas' OR lastname='Carter'
结合使用
eg:SELECT * FROM Persons WHERE (FirstName='Thomas' OR FirstName='William') AND LastName='Carter'
05:ORDER BY 语句用于对结果集进行排序(逆序在列后加DESC,顺序加ASC)
06:INSERT INTO 表名称 VALUES (值1, 值2,....)
INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....)
07:UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值
08:DELETE FROM 表名称 WHERE 列名称 = 值
09:SELECT TOP number|percent column_name(s) FROM table_name
10:SELECT column_name(s) FROM table_name WHERE column_name LIKE pattern
11:SELECT column_name(s) FROM table_name WHERE column_name IN (value1,value2,...)
12:SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2
13:表的 SQL Alias 语法:SELECT column_name(s) FROM table_name AS alias_name
列的 SQL Alias 语法:SELECT column_name AS alias_name FROM table_name
......
31:DROP INDEX index_name ON table_name
DROP TABLE 表名称
DROP DATABASE 数据库名称
32:TRUNCATE TABLE 表名称
(delete、drop、truncate:delete语句用于删除表中的行;drop语句删除索引、表和数据库;truncate仅删除表格中的数据)
33:ALTER TABLE table_name ADD column_name datatype
ALTER TABLE table_name DROP COLUMN column_name
ALTER TABLE table_name ALTER COLUMN column_name datatype
(陆续更新中~)
注:转载自http://www.w3school.com.cn/sql/index.asp
如有侵权请联系删除,谢谢!