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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / chandan kumar

If table is empty (means no records are there) then we can
add the constraint.

alter table tablename add (col_name datatype not null)

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

what is meant by urlencode and urldocode? : Sql dba

0 Answers  


What is sql and also describe types of sql statements?

0 Answers  


Are sql views compiled?

1 Answers  


What is cursor status?

0 Answers  


Which is faster truncate or drop?

0 Answers  


How do I create a memory optimized filegroup?

0 Answers  


What are triggers, and when would you use them?

3 Answers  


What is composite primary key in sql?

0 Answers  


What is the difference between rollback and rollback to statements?

0 Answers  


What is spool?

0 Answers  


what's the difference between a primary key and a unique key? : Sql dba

0 Answers  


What is a primary key, and how is it different from a unique key?

3 Answers  


Categories