1) SQL - Create a table
To create a table in the selected database.
Syntax -
create table table_name (
column1 datatype(range),
column2 datatype(range),
column3 datatype(range),
....
);
2) SQL - Show tables
To show all tables in the selected database.
Syntax -
show tables;
3) SQL -Describe table name
To show detail about any table in selected database like number of fields, key, extra (auto-increment), data type, null etc.
Syntax -
desc table_name ;
4) SQL - Delete a table
To delete a table in the selected database.
Syntax -
drop table table_name ;
5) SQL- Insert data into a table
To insert data in a table.
Syntax -
insert into table_name ( coloumn1_name, coloumn2_name, coloumn3_name, ………….. ) ;
values ( coloumn1_value, coloumn2_value, coloumn3_value, ……….);
Note:- varchar value must be in the ‘…..’ or “…..” when inserting data.
OR
We can also insert value by below code
Syntax -
insert into table_name;
values ( coloumn1_value, coloumn2_value, coloumn3_value, ……….);
6) SQL - Show data of table
To show inserted data in the table which we created in the database.
Syntax -
select * from table_name ;
7) SQL- Add column in a table
Using this, we can add a column in any table.
Syntax -
alter table table_name add column_name data_type(range) ;
8) SQL - Delete a column from the table
Using this we can delete any column from a table.
Syntax -
alter table table_name drop column column_name;