数据定义语言DDLcreate database db_name;create table table_name (column_name data_type,...);create view view_n
数据定义语言DDL
create database db_name;
create table table_name (column_name data_type,...);
create view view_name as select .....;
create index on table_name (column_name,...);
drop database db_name;
drop table table_name;
drop view view_name;
drop index table_name.index_name;(不同sql方言不同,这是SQL Server的写法)
alter table table_name
add column_name data_type
drop column_name;
change column_name new_column_name data_type,...
modify column_name data_type,...
数据操纵语言DML
select column_name from table_name where ...
update table_name set column_name=value where ...
insert into table_name (cloumn_name,...) values (value1,...)
delete from table_name where ...
数据控制语言DCL:控制权限
grant select,updat,insert,delete on table_name to 'user_name'@'host_name';
revoke select,updat,insert,delete on table_name to 'user_name'@'host_name';
事务控制语言TCL:控制事务
commit
rollback
--结束END--
本文标题: sql语句分类总结
本文链接: https://lsjlt.com/news/43559.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0