1.更新表结构
ALTER TABLE tablename(
ADD|DROP column datatype [NULL|NOT NULL] [CONSTRAINTS],
ADD|DROP column datatype [NULL|NOT NULL] [CONSTRAINTS],
...
);
2.创建索引
CREATE INDEX indexname ON tablename(colum,...)
3.将事务写入数据库
COMMIT[TRANSACTION];
4.创建存储过程
CREATE PROCEDURE
CREATE PROCEDURE procedurename [parameters] [options]
AS
SQL statement;
5.创建表
CREAT TABLE tablename
(
column datatype [NULL|NOT NULL] [CONSTRAINTS],
column datatype [NULL|NOT NULL][CONSTRAINTS],
...
);
6.创建视图
CREATE VIEW viewname AS
SELECT ...FROM ...[WHERE...][GROUP BY...][HAVING...];
7.删除一行或多行
DELETE FROM tablename
[where ...];
8.删除数据库对象【表、视图、索引等】
DROP INDEX|PROCEDURE|TABLE|VIEW indexname|procedurename|tablename|viewname;
9.将SELECT 内容插入数据表
INSERT INTO tablename[(columns,...)]
SELECT columns,...FROM tablename,...
[WHERE...];
10.插入一行
INSERT INTO tablename[(columns,...)] VALUES(values,...);
11.撤销事务块
ROLLBACK[TO savepointname];
ROLLBACK TRANSACTION;
12.检索数据
SELECT columnname,...
FROM tablename,...
[WHERE...]
[UNION...]
[GROUP BY...]
[HAVING...]
[ORDER BY...];
13.更新表中一行或多行
UPDATE tablename
SET columnname=value,...
[WHERE...];