Add constraint to a column and give it a name : Contraint Name « Constraints « Oracle PL / SQL






Add constraint to a column and give it a name

  

SQL>
SQL> create table emp_1
  2  (emp_id    number constraint pk_emp_id primary key,
  3   firstname  varchar2(15) constraint firstname_nn not null,
  4   lastname   varchar2(20) constraint lastname_nn not null,
  5   midinit    char(1) );

Table created.

SQL>
SQL> drop table emp_1;

Table dropped.

   
    
  








Related examples in the same category

1.Name the constraint
2.SYS.SYS_C004353 is the contraint name