mysql -u root -p |
Use this command to login into MySQL Server |
 |
Link |
Data types |
Data types are what can be used as values in a SQL database table, the table to the right has some examples. |
 |
Link |
Comments |
You can input comments into your database tables via # , -- , or /* |
 |
Link |
Literal Values |
This is a specific value that is directly represetned in a SQL statement. It is fixed value such as a number or a string, that is provided directly in the SQL code. |
 |
Link |
SHOW DATABASES |
Use this command to show existing databases |
 |
Link |
CREATE DATABASE databasename; |
Use this command to create a database |
 |
Link |
USE databasename; |
Use this command to pick the database you want to work with |
 |
Link |
CREATE TABLE tablename |
Use this command |
 |
Link |
DESCRIBE |
Use this command to show information on all columns of a table. |
 |
Link |
INSERT INTO databasename(x,y,z) VALUES |
Use this command to add records into a table |
 |
Link |
SELECT * FROM databasename; |
Use this command to display all columns in the database table. The * means `match all columns. |
 |
Link |
SELECT value FROM database WHERE value='x'; |
Use this command to select a specific column and row by a certain condition using the WHERE clause. |
 |
Link |
DELETE FROM databasename |
Use this command to delete a record from a table. In the example you can use the WHERE clause to delete a record by specifiying the criterion for deletion. |
 |
Link |
ALTER TABLE databasename ADD value |
Use this command to add a column. In this example the AFTER clause is used to specify the location of the new column. |
 |
Link |
ALTER TABLE databasename DROP value |
Use this command to delete a column in the table. |
 |
Link |