oracle 选分类最新数据,Oracle (分类、数据库类型、序列)

分类:

1.DDL (定义语句) create  、alter 、drop

不需要commit

create table aaa(

tt1 varchart

)

2. DML (操纵语句)

lnset、update、delete

Select......for update

79b7e4f3ba01fe1bb17b5a5f3285fdb7.png

传统数据库

94b939e8c58eaf52e434bfbbc7db2cfb.png

Oracle数据库

7e7f80daed931a9693fa9c143cc50b3c.png

create table bbb(

tt1 varchar2(10)

)

insert into aaa values('123');

insert into aaa(tt1) values('123');

insert into aaa values('789'),('456'),('abc');

create table aaa(

tt1 varchar2(10),

tt2 varchar2(100)

);

--提交

commit

select * from aaa;

--物理

select rowid,rownum,tt1 from aaa;

update aaa set tt1='aaaaaa'

select * from aaa for update;

select * from aaa;

commit

--插入多条数据

insert all

into aaa values('123')

into aaa values('456')

into aaa values('789')

select 1 from dual;

--Oracle 数据类型

--1 char 类型 (固定长度的类型)

--数据不足长度,会填空格

create table test1(

a char(6)

)

insert into test1(a) values('123')

select * from test1;

--Oracle 数据类型

--2 varchar2 类型 (不固定长度的类型,少于4000)

--数据不足长度,会填空格

create table test2(

a varchar2(10)

)

insert into test2(a) values('1234567');

commit

select * from test2;

--Oracle 数据类型

--3 number 实数类型(默认就是38位)

create table test3(

a number

)

insert into test3 values (123)

insert into test3 values (134.12)

insert into test3 values (12312313456456456465456456)

select * from test3;

create table test4(

a number(10)

)

insert into test4(a) values (1234567890);

insert into test4(a) values (13215454);

insert into test4(a) values (123.99); --四舍五入 结果是 124

select *from test4;

create table test5(

a number(5,2) --整数五位,小数二位

)

--超出范围,不像整数的定义,整数会四舍五入

insert into test5(a) values(12345.789)

--Oracle 数据类型

--4 date 类型(日期加时间) 跟java.util.Date保持一致

--java

--java.sql.Date (日期)

--java.util.Date(日期加时间)

create table test6(

a date

)

select 1 from dual

select to_date('日期字符串','日期格式')from dual

select to_date('2018-03-09 10:16:33','yyyy-mm-dd hh24:mi:ss')from dual

insert into test6 values (to_date('2018-03-09 10:16:33','yyyy-mm-dd hh24:mi:ss'))

141209f0aa1edb281607ac87ced8c5df.png

e9bd1b284cd57354d8624b0dbf538c3f.png

0e36b3bf99fb17a6cc827f9d2d81b2d8.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值