1.SQL AND/OR 子句:
SELECT column1, column2....columnNFROM table_nameWHERE
CONDITION-1 {AND|OR} CONDITION-2;
2.In 子句
SELECT column1, column2....columnN FROM table_name WHERE
column_name IN (val-1, val-2,...val-N);
3.BETWEEN 子句
SELECT column1, column2....columnN FROM table_name
WHERE column_name
BETWEEN val-1 AND val-2;
4.like 子句
SELECT column1, column2....columnN FROM table_name
WHERE column_name
LIKE { PATTERN };
5.SQL ORDER BY 子句:
SELECT column1, column2....columnN FROM table_name
WHERE CONDITION
ORDER BY column_name {ASC|DESC};
6.SQL GROUP BY 子句:
SELECT SUM(column_name) FROM table_name
WHERE CONDITION
GROUP BY column_name;
7.SQL COUNT 子句:
SELECT COUNT(column_name) FROM table_name
WHERE CONDITION;
8.SQL HAVING 子句:
SELECT SUM(column_name) FROM table_name
WHERE CONDITION
GROUP BY column_name
HAVING (arithematic function condition);
9.SQL CREATE TABLE 语句:
CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
PRIMARY KEY( one or more columns )
);
10.SQL DROP TABLE 语句:
DROP TABLE table_name;
11.SQL CREATE INDEX 语句 :
CREATE UNIQUE INDEX index_name ON table_name (
column1,
column2,
...
columnN
);
12.SQL DROP INDEX 语句
ALTER TABLE table_name
DROP INDEX index_name;
13.SQL DESC 语句 :
DESC table_name;
13.SQL TRUNCATE TABLE 语句:
TRUNCATE TABLE table_name;
14.SQL ALTER TABLE 语句:
ALTER TABLE table_name
{ADD|DROP|MODIFY} column_name {data_ype};
15.SQL ALTER TABLE 语句 (重命名)
ALTER TABLE table_name
RENAME TO new_table_name;
16.SQL INSERT INTO 语句:
INSERT INTO table_name( column1, column2....columnN)
VALUES ( value1, value2....valueN);
17.SQL UPDATE 语句:
UPDATE table_nameSET column1 = value1, column2 = value2....columnN=valueN
[ WHERE CONDITION ];
18.SQL DELETE 语句:
DELETE FROM table_nameWHERE {CONDITION};
19.SQL CREATE DATABASE 语句:
CREATE DATABASE database_name;
20.SQL DROP DATABASE 语句:
DROP DATABASE database_name;
21.SQL USE 语句:
USE database_name;