adspace


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

Is primary key always clustered index?

1095


what are aggregate and scalar functions? : Sql dba

1129


what is bcp? When does it used? : Sql dba

1056


what is dbms? : Sql dba

1061


how to use regular expression in pattern match conditions? : Sql dba

1113


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2091


Does group by remove duplicates?

1112


Can delete statement be rollbacked?

1054


what are all the common sql function? : Sql dba

1131


how many tables will create when we create table, what are they? : Sql dba

1144


How do I remove duplicates in two columns?

1187


What is the best sql course?

1050


Is inner join faster than left join?

1277


If a cursor is open, how can we find in a pl/sql block?

1238


how to start mysql server? : Sql dba

1267