How to Drop Column From MySQL Existing Table Example
Open your MySQL Query Editor then copy & paste the below code to make a table "users"
Then copy & paste the below code to Drop a column from a MySQL Existing table "users"
----------- making a table users ---- ---- CREATE TABLE users( id INT UNSIGNED AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, password CHAR(40) NOT NULL, PRIMARY KEY(`id`) ); ---- -- MySQL Drop Column From Existing Table -- -- Lets have a look an existing table "users" -- desc users; -- -- Now drop the column "active" from the table "users" -- ALTER TABLE users DROP COLUMN active; -- -- -- Finally Lets have a look into the table "users" again to get the desired output -- desc users; --
-- is comment in MySQL
-- in fact it is comment in MSSQL and Oracle as well
How to Drop Column From MySQL Existing Table Example - Result in MySQL Query Editor
Related Tutorial Examples
- MySQL sample database script: Create Database using SQL Statement Example
- MySQL IF() Function Boolean Value Example
- MySQL strcmp() Function Number Value Example
- How to ADD Column In MySQL Existing Table Example
- How To Find MySQL SERVER VERSION Information
- Operator precedence in SQL Command MySQL Example
- Arithmetic operators in SQL Command MySQL Example
- Describe Table Structure using SQL Command MySQL Example
- MySQL Stored Procedure: INSERT INTO SELECT... Example
- MySQL Stored Procedure: CREATE TABLE SELECT... Example
- 20 steps to make CakePHP Blog Project

No comments:
Post a Comment
leave your comments here..