Basics
Create Database
CREATE DATABASE tutorial;Access Database
# Login to database (-u username, -p authenticate with password)
mysql -u root -p
# Enter Password: **********
# You can also login
sudo mysqlBackup Database
# Login to database
sudo mysql
# Create a new database
mysql > CREATE DATABASE tutorial_backup;
# Exit mysql with exit command and export table tutorial into a file
mysqldump -u root -p tutorial > tutorial.sql
# Enter Password: **********
# Import the tutorial table into a backup table, for example tutorial_backup
mysql -u root -p tutorial_backup < tutorial.sql
# Enter Password: **********Create Table
Insert Data Into Table
Deleting Data
Updating Data
Add Extra Column
Example Query
Aggregate Function
SQL Joins
INNER JOIN
FULL OUTER JOIN
LEFT OUTER JOIN
Last updated