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 |
Is it mandatory for the primary key to be given a value when a new record is inserted?
What are the different ddl commands in sql?
How would you convert date into julian date format?
What is the difference between partition and index?
Explain UNION,MINUS,UNION ALL, INTERSECT?
what are numeric data types? : Sql dba
What is a sql profiler?
What is the current version of postgresql?
Why do we need unique key in a table?
what are the differences among rownum, rank and dense_rank? : Sql dba
What is the difference between join and union.
27 Answers 3i Infotech, ABC, Oracle, Polaris, TCS, XT Global,
How does one load ebcdic data? : aql loader
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)