Create a database:
CREATE DATABASE stefan;
Delete database:
DROP DATABASE stefan;
Rename a database:
There is no direct way to rename the database.
Methods that are no longer used:
RENAME DATABASE stefan TO LCDB;
Create Table Syntax:
Create table Name (column name 1 data type, column name 2 data type, column name 3 data type ,....)
View the structure of a table:
DESCRIBE Persons;
The alter table statement is used to add, modify, or delete columns in an existing TABLE.
Syntax:
To add columns to a table, use the following syntax:
ALTER TABLE table_nameADD column_name datatype
To delete columns in a table, use the following syntax:
ALTER TABLE table_name DROP COLUMN column_name
Note: Some database systems do not allow this method of deleting columns in database tables (drop column column_name ).
To change the data type of columns in a table, use the following syntax:
ALTER TABLE table_nameALTER COLUMN column_name datatype