create table productinfo
(ProductID varchar2(10),ProductName varchar2(20),ProductPrice number(8,2)
,Quantity number(10),Category varchar2(10),Desperation varchar2(1000),Origin varchar2(10));
alter table productinfo add remark varchar2(200);
alter table productinfo modify remark number(2,2);
alter table productinfo drop column remark;
create table categoryinfo(
CategoryId varchar2(10),
CategoryName varchar2(30),
primary key(CategoryId));
alter table categoryinfo
add constraints pk_category primary key(CategoryId);
alter table categoryinfo drop constraints CategoryId;
create table productinfo1
( productid varchar2(20),
productname varchar2(20),
productprice number(8,2),
quantity number(10),
desperation varchar2(1000),
category varchar2(10),
origin varchar2(10),
primary key (productid),
constraints fk_pro foreign key(category)
references categoryinfo(CategoryId)
on delete cascade);
alter table productinfo1 drop constraints fk_pro;
create table custominfo
( CumstomId varchar2(10),
Name varchar2(10),
Age number(2),
Gender varchar2(2),
Tel varchar2(10),
Address varchar2(100),
constraint chk_age check(age>=18 and age<=50));
)
alter table custominfo drop constraint chk_age;
alter table custominfo add constraint chk_age check(age>=18 and age<50);
alter table custominfo add constraint my_unique unique(Name);
alter table custominfo add constraint my_unique2 unique(Age);
alter table custominfo drop constraint my_unique;
alter table custominfo modify Name not null;