Oracle基础知识-SQL简单命令

时间:2022-04-22
本文章向大家介绍Oracle基础知识-SQL简单命令,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

SQL语句包括两个部分:1 DDL 数据定义语言 2 DML 数据控制语言

DDL:

create:创建一个表

create table b(
clob char(1)
);

alter:增加已经定义的表列的分配

drop:删除一个表

desc:查看一个表的定义

DML:

selelct:

select * from b;

insert:

insert into state values('fds','fds');

update:修改已有的数据

delete:删除已有的数据

带or/and的where子句:

    select a,b,c from tablename where a='111',and b='222';

    select a,b,c from tablename where a='111',or b ='222';

带not的where子句

   select a,b,c from tablename where a != 1;

带搜索范围的where子句

   select a,b,c  from tablename where b between 1 and 19;

带搜索列表的where子句

   select a,b,c  from tablename where a in ('1','2');

带模式搜索的where子句

   select a,b,c from tablename where a like 'a%';