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 important to partition hard disk?
How do I count rows in sql?
How long does it take to learn pl sql?
How do I view stored procedures?
What is a constraint. Types of constraints ?
5 Answers Accenture, BirlaSoft,
write an sql query to find names of employee start with 'a'? : Sql dba
What is a schema? How is it useful in sql servers?
What is the difference between subquery and correlated query?
what is a database lock ? : Sql dba
What is the usage of when clause in trigger?
How can the performance of a trigger be improved?
What are the set operators in sql?
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)