Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql doubt

 
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: 68
Firefox Browser Java Windows XP
  • 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: 51390
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would fit better in our databases forum: moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic