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
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 |
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 |
what is meant by urlencode and urldocode? : Sql dba
What is sql and also describe types of sql statements?
Are sql views compiled?
What is cursor status?
Which is faster truncate or drop?
How do I create a memory optimized filegroup?
What are triggers, and when would you use them?
What is composite primary key in sql?
What is the difference between rollback and rollback to statements?
What is spool?
what's the difference between a primary key and a unique key? : Sql dba
What is a primary key, and how is it different from a unique key?