--建表create table book(
book_id number(10),
book_name varchar2(20),
book_price number(10,2),
book_author varchar2(20),
book_publish_time date,
book_introduction varchar2(100)
);--設定主鍵 constraint :約束
alter table book add constraint pk_id primary key (book_id);
--新增和刪除列
alter table book add book_remark varchar2(20);
alter table book add(
book_ext1 varchar2(20),
book_ext2 varchar2(20)
);alter table book drop column book_ext1;
--修改表名稱
alter table book rename to new_book;
alter table new_book rename to book;
--修改列名稱
alter table book rename column book_name to book_name_new;
alter table book rename column book_name_new to book_name ;
--修改字段屬性型別
alter table book modify book_name varchar2(40);
--修改字段屬性預設值
alter table book modify book_name default 'green tale';
--刪除表
drop table book;
建表時的引數:
create table ab_xiaofswjlb( id varchar2(90) not null,
mingc varchar2(90) not null,
xiezbm varchar2(90) not null,
shiwnr varchar2(1024) not null,
riq char(14) not null,
beiz varchar2(300),
guanlryj varchar2(300),
shencrid varchar2(90),
shencr varchar2(90),
shenczt varchar2(90),
shencrq char(14),
jilrid varchar2(90),
jilr varchar2(90),
jilrq char(14),
corpid varchar2(90) not null,
depid varchar2(90) not null
)pctfree 10
initrans 1
storage
( initial 64k
minextents 1
maxextents unlimited
)tablespace users
logging;
oracle建表設定主鍵自增
首先建立一張表 create table member memberid number primary key,membermail varchar2 20 not null,membername varchar2 20 not null,memberpassword varchar2 20 然後,...
oracle建表設定主鍵自增
oracle建表設定主鍵自增 首先建立一張表 create table member memberid number primary key,membermail varchar2 20 not null,membername varchar2 20 not null,memberpassword ...
oracle建表設定主鍵自增
首先建立一張表 create table member memberid number primary key,membermail varchar2 20 not null membername varchar2 20 not null memberpassword varchar2 20 然後,...