oracle基础语句

Posted on 2019-09-04 14:20  橙子j  阅读(151)  评论(0编辑  收藏  举报

进入sql   https://blog.csdn.net/weixin_33908217/article/details/89804916

sqlplus.exe / as 用户名;

 

创建表   https://www.cnblogs.com/qmfsun/p/3817344.html

create table emp(  
  empid      interger   primary key,  
  empname    varchar2(20) not null,  
  empsex     varchar2(2)  default 'male' check(stusex in('male','female')),
  empdate    date,
  empmoney   number(50,2)
); 

 


oracle数据类型:https://www.cnblogs.com/buxingzhelyd/p/8984173.html
oracel没有布尔类型

 

增删改查

insert into emp values(1,'test','male',to_date('20140214','yyyymmdd'),1200.55);

delete from emp where empid=1 and empname='test';

update emp set empname='test2' where empid=1;

select distinct empid,empname,empsex from emp group by empsex order by empid;

 

 

插入date:https://blog.csdn.net/paullinjie/article/details/80615310