Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

If we have n no of columns in a table, can we add new
column in that table with not null constraint?

Answer Posted / srinu

U r correct Chandan.But one thing,what is that is if the
table contains some data at that time syntax for adding new
column to that table with notnull constraint is....

alter table table_name add column_name datatype default
value constraint constraint_name not null;

if we want 2 know which columns have which constraints then
the syntax is

select column_name,constraint_type
from user_cons_columns
where table_name='EMP';

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is foreign key? : Sql dba

977


What is having clause in sql?

933


What does pragma mean?

986


How do you write a complex sql query?

1016


Where the sql database files are stored?

962


What is before and after trigger?

901


What is rowid in sql?

919


What is the max nvarchar size?

906


What is varray in pl sql?

1024


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

964


What is online transaction processing (oltp)?

971


Can we commit inside a trigger?

950


In pl/sql, what is bulk binding, and when/how would it help performance?

947


How to add a column ‘salary’ to a table employee_details?

961


How do you define a foreign key?

945