Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgres alter table add column with default value

ALTER TABLE <TableName> ADD COLUMN <ColumnName> <ColumnType> NOT NULL default <DefaultValue>;

ALTER TABLE customers ADD COLUMN phone integer NOT NULL default 0;
ALTER TABLE customers ADD COLUMN gender varchar(255) NULL default 'Other';
Comment

add column postgres with default value

ALTER TABLE users
  ADD COLUMN "priv_user" BOOLEAN DEFAULT FALSE;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql get latest duplicate rows 
Sql :: mysql delete table with foreign key 
Sql :: select list is not in group by clause and contains nonaggregated column codeigniter 
Sql :: varchar vs nvarchar sql 
Sql :: sql left characters 
Sql :: check if value is equal to something sql 
Sql :: sql server case sensitive search 
Sql :: sql server datetime to string 
Sql :: check if a column is a primary key in sql server 
Sql :: insensitive case match sqlalchemy 
Sql :: date format mysql 
Sql :: sql select first and last record of each group 
Sql :: how to connect sql database in python 
Sql :: sql change date format 
Sql :: mysql get all tables from a specific database 
Sql :: snowflake drop column 
Sql :: mysql regexp match word 
Sql :: add multiple row table pl sql 
Sql :: truncate all tables 
Sql :: current date in sql 
Sql :: mysqlclient error 
Sql :: opening xampp mysql in cmd ubuntu 
Sql :: bigquery add days to date 
Sql :: how to remove unique key in mysql 
Sql :: how to display value of variable in mysql 
Sql :: combine 2 columns search query mysql 
Sql :: mysql function 
Sql :: how insert auto increment 
Sql :: how to find unique element in sql 
Sql :: sql select where clause 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =