Show Menu
Cheatography

testing Cheat Sheet (DRAFT) by

A cheatsheet on MySQL's CRUD commands.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Operation

Create
This operation is used to create a new database or table, and to add new records to a table.
CREATE DATABASE databa­se_­name;

CREATE TABLE table_name (column1 datatype, column2 datatype, ...);

INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
READ
This operation is used to retrieve data from a database.
SELECT column­_name FROM table_name WHERE condition;

SELECT * FROM table_­name;
UPDATE
This operation is used to modify existing records in a table.
UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition;
DELETE
This operation is used to remove records from a table, or to remove entire tables or databases.
DELETE FROM table_name WHERE condition;

DROP TABLE table_­name;

DROP DATABASE databa­se_­name;

code

CREATE DATABASE database_name;
CREATE TABLE table_name (column1 datatype, column2 datatype, ...);
INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
 

Image