Top "Alter-table" questions

The "ALTER TABLE" is a SQL statement that allows you to make schema changes to a database table (i.e. add, drop or alter columns from an existing table).

how to modify the size of a column

I created the table Test_Project2 in Oracle SQL Developer. After that I realized that the column proj_name is …

oracle oracle-sqldeveloper alter-table
How to alter a column's data type in a PostgreSQL table?

Entering the following command into a PostgreSQL interactive terminal results in an error: ALTER TABLE tbl_name ALTER COLUMN col_…

sql postgresql psql alter-table alter-column
How do I rename a column in a SQLite database table?

I would need to rename a few columns in some tables in a SQLite database. I know that a similar …

sqlite alter-table
How do I add more members to my ENUM-type column in MySQL?

The MySQL reference manual does not provide a clearcut example on how to do this. I have an ENUM-type column …

mysql enums alter-table
Alter table to modify default value of column

I have a requirement where we need to modify a column's default value in database table. The table is already …

sql oracle alter-table
Change a Nullable column to NOT NULL with Default Value

I came across an old table today with a datetime column called 'Created' which allows nulls. Now, I'd want to …

sql sql-server alter-table alter-column
ALTER TABLE on dependent column

I am trying to alter column datatype of a primary key to tinyint from int.This column is a foreign …

sql-server-2008 alter-table alter-column
MySQL: ALTER TABLE if column not exists

I have this code: ALTER TABLE `settings` ADD COLUMN `multi_user` TINYINT(1) NOT NULL DEFAULT 1 And I want to alter …

mysql ddl alter-table
Alter MySQL table to add comments on columns

I have been checking the MySQL Documentation for ALTER TABLE and it does not seem to include a way to …

mysql alter-table
How do I alter the position of a column in a PostgreSQL database table?

I've tried the following, but I was unsuccessful: ALTER TABLE person ALTER COLUMN dob POSITION 37;

sql database postgresql alter-table