To remove a column in MySQL is easy.
ALTER TABLE users DROP email;
Although it is very simple, but use it with caution as it permanently removes data without a warning.
To select a database is not a query. It is a ‘statement’ and does not require a semicolon at the end. Here is how you can do it:
USE recruit_db
It tells MySQL to select ‘recruit_db’ as the default database to work with, for the current session.
To delete a table in MySQL, you can use the DROP TABLE command, for instance:
DROP TABLE users;
Be careful while using this function, this query deletes a table and its contents, without a warning.
To see the structure of an existing table, you can use this query.
EXPLAIN countries;
In the example above, fields (aka. columns) from a table named ‘countries’ are listed in the results, with their properties.
In MySQL, the command to list all databases looks like the one below:
SHOW DATABASES;
This query is used to get a list of all databases you have.