create sequence student_sequence
start with 10000
increment by 1
--建立时序数
create table students(
id number(5) primary key,
first_name varchar2(20),
last_name varchar2(20),
major varchar2(30),
current_credits number(3)
);
--相应的表格
insert into students(id,first_name,last_name,major,current_credits)
values(student_sequence.nextval,'jessica','niu','medicine',0);
insert into students(id,first_name,last_name,major,current_credits)
values(student_sequence.nextval,'jessica','niu','medicine',0);
student_sequence.nextval相应的调用
select * from students;
1 10000 jessica niu medicine 0
2 10001 jessica niu medicine 0
博客展示了在Oracle数据库中的操作,包括创建一个从10000开始、步长为1的序列student_sequence,创建students表并定义其字段,向students表插入两条数据,最后查询表数据并展示结果。
603

被折叠的 条评论
为什么被折叠?



