YouTip LogoYouTip

MySQL Tutorial - Getting Started

What is MySQL?

MySQL is the most popular open-source relational database.

Create Table

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(100) UNIQUE,
    age INT DEFAULT 0
);

CRUD

INSERT INTO users (name, email, age) VALUES ("Alice", "a@b.com", 25);
SELECT * FROM users WHERE age > 20;
UPDATE users SET age = 26 WHERE name = "Alice";
DELETE FROM users WHERE id = 3;

Summary

  • CREATE TABLE defines structure
  • INSERT/SELECT/UPDATE/DELETE for CRUD
← MySQL Joins and AggregationRust Ownership and Borrowing β†’