########## MYSQL COMMANDS #######################
mysql -u root -p
use databasename;
1)display all tables in database.
show tables;
2)display all the fields from single table.
desc users;
3)Display all recorde in single table
select * from users;
4)Count the recorde in single table
select count(*) from users;
5)Display Distinct
select distinct name from users;
select * from users where first_name = "chinna";
select * from users where first_name = "chinna" and last_name = "ram";
select * from users where first_name = "chinna" or last_name = "ram";
delete from users;
delete from users where first_name = "chinna";
update from users set first_name "ramu" where user_id = 67;
select first_name from users order by first_name asc;
select first_name from users order by first_name desc;
explain select * from users;
mysql -u root -p
use databasename;
1)display all tables in database.
show tables;
2)display all the fields from single table.
desc users;
3)Display all recorde in single table
select * from users;
4)Count the recorde in single table
select count(*) from users;
5)Display Distinct
select distinct name from users;
select * from users where first_name = "chinna";
select * from users where first_name = "chinna" and last_name = "ram";
select * from users where first_name = "chinna" or last_name = "ram";
delete from users;
delete from users where first_name = "chinna";
update from users set first_name "ramu" where user_id = 67;
select first_name from users order by first_name asc;
select first_name from users order by first_name desc;
explain select * from users;
Comments
Post a Comment