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 |
Explain foreign key in sql?
I want to create synonym for table emp but in my pc it is giving insufficient previliges.I am using user scott.Please suggest me.
How does postgresql compare to mysql?
can i give user defined exception in a package
What are the parameter modes supported by pl/sql?
How do you add a column to a table?
Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?
Is progress software supports to ( pl/sql )?
What is rownum in sql?
What is compound trigger?
can we use out parameter in a function?Give an example.
how to retrieve the top 2 salaried persons from a database?