CREATE DATABASE: used to create a new SQL database
Syntax
CREATE DATABASE *databasename*;
DROP DATABASE: to drop an existing SQL database
Syntax
DROP DATABASE *databasename;*
CREATE TABLE: to create a new table in a database
CREATE TABLE *table_name* (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
Create table using another table
CREATE TABLE *new_table_name* AS
SELECT *column1, column2, ...*
FROM *existing_table_name*
WHERE ...;
: used to drop an existing table in a database
DROP TABLE *table_name*;
TRUNCATE TABLE: to delete the data inside a table but not the table itself
TRUNCATE TABLE table_name;
ADD column
ALTER TABLE *table_name*
ADD *column_name datatype*;
DROP column
ALTER TABLE *table_name*
DROP COLUMN *column_name*;
MODIFY column
ALTER TABLE *table_name*
MODIFY COLUMN *column_name datatype*;
This post is based on W3School's articles about SQL.