oracle table
来源:互联网 发布:双十一淘宝交易额图表 编辑:程序博客网 时间:2024/06/06 12:31
create table product(
Product_id varchar2(10) not null,
Product_name varchar2(20),
ProductPrice number(8,2),
Quantity number(10),
Category varchar2(10),
Desperation varchar2(1000),
Origin varchar2(10)
);
drop table product;
alter table product
add remark varchar2(200);--增加列remark
alter table product
modify remark number(10,2);--修改列remark datatype
select *from product
alter table product drop column remark;--删除列remark
alter table product add constraints pk_product primary key(Product_id);--主键是由一个列组成
alter table product add constraints pk_product primary key(Product_id,product_name);--主键是由两个列组成
create table categoryinfo(
CategoryId varchar2(10),
CategoryName varchar2(30),
primary key(CategoryId)
);
drop table categoryinfo
alter table product
Drop constraint pk_product
create table productinfo1(
Product_id varchar2(10) not null,
Product_name varchar2(20),
ProductPrice number(8,2),
Quantity number(10),
Category varchar2(10),
Desperation varchar2(1000),
Origin varchar2(10),
primary key(Category),
constraint fk_pro foreign key(category)
references categoryinfo(CategoryId)
);
alter table productinfo1
add Constraint fk_pro foreign key(category)
References categoryinfo(CategoryId);
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- Oracle Temp Table
- Oracle Pipelined Table
- Temp Table in Oracle
- Oracle Pipelined Table Functions
- Oracle Pipelined Table
- oracle nested table
- Oracle alter table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- oracle table
- WEBLOGIC负载均衡原理
- 用printf输出长整形__int64
- oracle 报告
- oracle 报告
- ANDROID问题总结
- android.view.View
- 感觉HY越来越走向尽头