Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL DEFAULT Constraint With Alter Table

#SQL Server

ALTER TABLE College
ADD CONSTRAINT country_default
DEFAULT 'US' FOR college_country;

#PostgreSQL

ALTER TABLE College
ALTER COLUMN college_code SET DEFAULT 'US';

#MySQL

ALTER TABLE College
ALTER college_country SET DEFAULT 'US';

#Oracle

ALTER TABLE College
MODIFY college_country DEFAULT 'US';
 
PREVIOUS NEXT
Tagged: #SQL #DEFAULT #Constraint #With #Alter #Table
ADD COMMENT
Topic
Name
2+2 =