-1

While using Create table condition how can i give a specific numeric value to a column

Column Name: Quantity
Data Type: NUMBER(4)
Constraints: Greater than or equal to 0;
Default Value is 0
jarlh
  • 42,561
  • 8
  • 45
  • 63
ayushi
  • 15
  • 3

1 Answers1

2

You mean something like this?:

create table mytable (
  quantity number(4) default 0
);
alter table mytable 
   add (constraint chkQuantity check (quantity >= 0) enable validate);
MarEll
  • 296
  • 2
  • 9