Oracle alter table example

alter table brand add constraint uq_name unique(name) alter table brand add (description varchar2(100) ) alter table product modify (product_name varchar2(100) ) alter table brand rename column name to brand_name    alter table brand drop column description    alter table brand rename to brand_mst

Oracle foreign key constraint example

create table brand (  code char(5) not null, name varchar2(50), constraint pk_code primary key(code) ) create table product_group ( group_code number not null, group_name varchar2(50), brand_code char(5), constraint pk_group primary key(group_code), constraint fk_brand_code foreign key(brand_code) references brand(code) ) create table product ( product_code number, product_name varchar2(50), group_code number, constraint pk_product primary key(product_code), constraint fk_group_code foreign key(group_code) references product_group(group_code) )

Oracle table creation example

Table creation example create table Employee ( id number(4), name varchar2(50) ); Table created describe Employee Name    Null?    Type ——–     ——-   ——– ID                       NUMBER(4) Name                VARCHAR2(50) insert into Employee values(100,’John’); 1 row createdContinue reading “Oracle table creation example”