SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite DROP COLUMN Keyword



The SQLite DROP COLUMN keyword is used to a delete columns from an existing table.

Syntax

The syntax for using DROP COLUMN keyword to drop columns in SQLite is given below:

ALTER TABLE table_name
DROP COLUMN column_name;

Example:

Consider a database table called Employee with the following records:

EmpIDNameCityAgeSalary
1JohnLondon253000
2MarryNew York242750
3JoParis272800
4KimAmsterdam303100
5RameshNew Delhi283000
6HuangBeijing282800

DROP COLUMN

To drop the Salary column from the Employee table, the following statement can be used:

ALTER TABLE Employee 
DROP COLUMN Salary;

--see the result
SELECT * FROM Employee;

This will produce the below mentioned result:

EmpIDEmployeeCityAge
1JohnLondon25
2MarryNew York24
3JoParis27
4KimAmsterdam30
5RameshNew Delhi28
6HuangBeijing28

❮ SQLite Keywords