sql 常用语句大全(SQL common sentences Daquan) Learn the basic syntax of dynamic SQL statements that SQL should know 1, ordin' select * from'+***@filename) In addition, if you want to use single quotes' ' in the SQL statement string can be used in any - statement function 一 SELECT 一 operation data from the database table to retrieve data rows and columns 一 INSERT database table to add new rows of data from the DELETE database table UPDATE - update delete data in the database table data, data definition CREATE TABLE to create a database table DROP TABLE removed from the database table ALTER TABLE alter table CREATE - VIEW - DROP - VIEW create a view from the database CREATE INDEX to delete view database tables to create an index DROP INDEX index CREATE PROCEDURE removed from the database to create a stored procedure drop procedure — 从数据库中删除存储过程create trigger -创 建一个触发器drop trigger -从数据库中删除触发器create schema 向数据库添加一个新模式drop schema 从数据库中删除一 个模式create domain 创建一个数据值域alter domain 改 变域定义drop domain 从数据库中删除一个域 数 据控制grant授予用户访问权限deny拒绝用户访问revoke --解除用户访问权限 事务控制commit结束当前事务rollback -- 中止当前事务set transaction 为查询设定游标explan 程序化sqldeclare定义当前事务数据访问特征为查询描述数据访 问计划open 关闭检索一行查询结果close检索 查询结果打开一个游标fetch游标PREPARE —为动态执行准备SQL 语句EXECUTE —动态地执行SQL语句DESCRIBE —描述准备好的查 询 局部变量 declare ***@id char (10) 一set ***@id = 'lOOlOOOr select ***@id = ' 10010001, —-全局变量一-必须以@@开头 一IF ELSEdeclare ***@x int ***@y int ***@z intselect