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 |
What are different types of sql?
How do you optimize SQL queries ?
6 Answers CarrizalSoft Technologies, Infosys, Oracle,
how to enter characters as hex numbers? : Sql dba
What is faster join or subquery?
What are views in sql?
is it necessary to write group by and order by clause together
What does select * from mean in sql?
How do you get all records from 2 tables. Which join do you use?
Is it possible to create startup or shutdown trigger for on-schema?
i have doubt that any one tell ref cursor comes in sql pl/sql? pls clarify?
what are the advantages of sql ? : Sql dba
What is an implicit commit?
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)