MySQL Cheat Sheet

MySQL is a popular open-source relational database used for web and enterprise applications. Here’s a quick cheat sheet for essential commands:

  • Connect to MySQL:
    mysql -u username -p

  • Create Database:
    CREATE DATABASE db_name;

  • Use Database:
    USE db_name;

  • Create Table:
    CREATE TABLE table_name (id INT, name VARCHAR(100));

  • Insert Data:
    INSERT INTO table_name VALUES (1, 'John');

  • Select Data:
    SELECT * FROM table_name;

  • Update Data:
    UPDATE table_name SET name='Jane' WHERE id=1;

  • Delete Data:
    DELETE FROM table_name WHERE id=1;

  • Drop Table:
    DROP TABLE table_name;


This cheat sheet covers the basics, helping you quickly recall the most used MySQL commands. Perfect for developers, DBAs, and learners.

Leave a Reply

Your email address will not be published. Required fields are marked *