字符型
char		定长	最大2000
varchar2()	变长	最大4000
clob		字符型大对象 最大4G
数字型
number范围 -10的38次方到10的+38次方;
number(5,2)	一个小数,有效位5个,小数点后2个数字
number(5)	表示一个5位的整数
日期类型
date
timestamp
二进制数据
blob 保密性较高,存入数据库/其他情况,保持在文件服务器,数据库只存文件路径
create table student(
       stuId varchar2(10),
       age number(2),
       birthday date
)
--添加一个字段
alter table student add(name varchar2(10));
--修改字段长度
alter table student modify (name varchar2(20));
null值:is null , is not null
select * from student t where t.name is not null;
SQL> savepoint firstPoint;
Savepoint created
delete from student;
rollback to firstPoint;
drop from student;
delete from student where age>10;
truncate table student;--删除所有记录,表结构还在,不写日志,速度极快
列别名,函数nvl
select t.age "年龄" ,nvl( t.age,0) "年龄为null显示0",t.rowid from STUDENT t;
字符串连接:||
select t.name||‘-‘|| t.age from student t;
like操作符:
%:任意0到多个字符
_:单个任意字符
原文:https://www.cnblogs.com/ICE_Inspire/p/9297406.html