• Post Reply Bookmark Topic Watch Topic
  • New Topic

sql doubt  RSS feed

 
RabiDas Sharma
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

create table Customers
(
CustNo number(4) primary key,
First_Name varchar2(30) not null,
Last_Name varchar2(30) not null,
CustType char(1) not null,
Credit_Limit number(7,2),
Credit_Card_No number(16),
Credit_Card_Type varchar2(8)
);

I understood the above code but can't understand the following code.
please explain the following code::

alter table Customers add check(Credit_Limit<10001);


thanks in advance.
 
Dinesh Kumar Ramakrishnan
Ranch Hand
Posts: 86
AngularJS Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after creating table you are making check constraint(condition for each row)

in your problem you are making new condition Credit_Limit should be less then 10001
 
Campbell Ritchie
Sheriff
Posts: 54049
130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would fit better in our databases forum: moving.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!