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).

PostgreSQL - change precision of numeric?

I tried to change precision like this: ALTER Table account_invoice ALTER amount_total SET NUMERIC(5); But I get syntax …

sql postgresql postgresql-9.2 alter-table
MySQL dropping all indexes from table

I have a MySQL database that runs for some time now with many changes on it. Lately I looked over …

mysql indexing alter-table
What is the difference between "ADD KEY" and "ADD INDEX" in MySQL?

I dump database and i have one question. What does this query? ALTER TABLE `ps_cart_rule` ADD KEY `id_…

mysql key alter-table
How to alter a MySQL table's foreign key using the command line

How to alter an existing table in MySQL, setting foreign key to another table, using the command line?

mysql alter-table alter
Alter a live table to make a key non-unique

I saw some other questions related to this, but they were not MySQL. The database is a live database, so …

mysql unique alter-table
Best way to add a new column with an initial (but not default) value?

I need to add a new column to a MS SQL 2005 database with an initial value. However, I do NOT …

sql sql-server database alter-table
Default sort-ordering in MySQL (ALTER TABLE ... ORDER BY ...;)

Assume that the default ordering of a MySQL-table (ISAM) is changed by executing: ALTER TABLE tablename ORDER BY columnname ASC; …

mysql sorting alter-table
How do you ADD and DROP columns in a single ALTER TABLE

I tried the following but I got a syntax error ALTER TABLE Grades ( DROP COLUMN (Student_FamilyName, Student_Name), ADD …

sql syntax alter-table
How do I alter my existing table to create a range partition in Oracle

I have existing table which has 10 years of data (I have taken dump). I would like to Range partition the …

oracle create-table alter-table partition
Alter table after keyword in Oracle

ALTER TABLE testTable ADD column1 NUMBER(1) DEFAULT 0 NOT NULL AFTER column2; Why can't I use mySql syntax in Oracle too? …

oracle oracle11g ddl alter-table