SELECT - Get data from a Table
UPDATE - update data in a Table
DELETE - delete data from a Table
INSERT INTO - inserts new data into a Table
CREATE DATABASE - create a new DataBase
ALTER DATABASE - modifies a DataBase
CREATE TABLE - create a new Table
ALTER TABLE - modifies a Table
DROP TABLE - delete a table
Example
select * from table1;
select Column1,Column2,Column3 from table1;
Example
update table1 set Column2='Value2',Column3='Value3' where Column1='Value1'
Example
update table1 where Column1='Value1'
Example
insert into table1 (Column2,Column3) values ('Value2','Value3')
Example
create database DataBaseName;
Example
ALTER DATABASE
OLDDataBaseName MODIFY NAME = newDBName
Example
CREATE TABLE table_name (column_name1
data_type(size),column_name2 data_type(size),column_name3
data_type(size),....);
CREATE TABLE table1(column1 int,column2 varchar(255),column3 varchar(255));
Now we want to add a column named "Column4" in the "table1" table. We use the following SQL statement:
Example
ALTER TABLE table1 ADD
column4 decimal(25,3)
Drop Column Example
ALTER TABLE table1 DROP COLUMN column4
Example
DROP TABLE table1