delete a column in sql code example

Example 1: how remove column in mysql

ALTER TABLE "table_name" DROP "column_name";

Example 2: sql drop column

ALTER TABLE my_schema.my_table DROP COLUMN my_column;

Example 3: mssql remove column

ALTER TABLE table_name
DROP COLUMN column_name;

Example 4: sql delete column

Deletes a column from a table.
Example: Removes the first_name column from the users table.
ALTER TABLE users
DROP COLUMN first_name

Example 5: sql remove column from table

ALTER TABLE tableName DROP columnName;

Example 6: what is delete in sql

DELETE -
-DML COMMAND
-Delete Rows from the table one by one
-We can use where clause with Delete to delete single row
-Delete is slower than truncate
-ROLLBACK is possible with DELETE

DROP-
-DDL COMMAND
-Delete the entire structure or schema
-We can't use where clause with drop
-Drop is slower than DELETE & TRUNCATE
-ROLLBACK IS NOT POSSIBLE WITH DROP

TRUNCATE-
-DDL COMMAND
-Truncate deletes rows at a one goal
-We can't use where clause with Truncate
-Truncate faster than both DELETE & DROP
-Rollback is not possible with Truncate

Tags:

Sql Example