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 primary key? : Sql dba

710


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

773


What is %type in pl sql?

705


What operators deal with null?

813


How to move files from one directory to another in pl sql?

854






What is keys and its types?

747


Can I learn sql in a week?

753


What are sql objects?

736


What are literals in sql server?

734


How many types of cursors are available in pl/sql?

771


what are the limitations of identity column? : Transact sql

822


How do you truncate?

660


What is normalisation in sql?

773


What are types of joins?

701


what is schema? : Sql dba

738