For marketers
who love technology
Home » , , » A first tutorial to learn Basic sql commands - SQL cheatsheet

A first tutorial to learn Basic sql commands - SQL cheatsheet

You can enter the mysql console with:
mysql -u root -p
 

Then you can select a database

show databases;
use my_db;


Then you can see the tables
show tables;


To see the content of a given table:
select * from my_table;


To add a column named 'email' to the table
ALTER TABLE table_name ADD email Text;


To check the datatype of the columns in a table
describe table_name


SHARE

About Gilles

0 comments :

Post a Comment