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 |
Can we use ddl statements in stored procedure?
What is difference between joins and union?
Which is the correct statement about truncate and delete?
how to get @@error and @@rowcount at the same time? : Sql dba
Is primary key clustered or nonclustered?
What is break?
What is the maximum number of triggers, you can apply on a single table?
Which one is better sql or oracle?
what is the difference between cluster and non cluster index? : Sql dba
How many levels can subqueries be nested in a FROM clause?
What is bitemporal narrowing?
how u can find the n row from a table?
Oracle (3259)
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)