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%';

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章