Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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: 78
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
Marshal
Posts: 53134
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would fit better in our databases forum: moving.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!