What is MySQL and How Does it Work?
Advertisement
Ad
What is MySQL?
MySQL is the world's most popular open-source relational database. It stores data in tables and uses SQL to manage it. It powers WordPress, Facebook (originally), and countless web apps.
Basic Setup
CREATE DATABASE shop;
USE shop;
CREATE TABLE products (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
price DECIMAL(10,2)
);
CRUD Operations
INSERT INTO products (name, price) VALUES ('Pen', 2.50);
SELECT * FROM products WHERE price < 5;
UPDATE products SET price = 3 WHERE id = 1;
DELETE FROM products WHERE id = 1;
Why MySQL?
- Free and open source.
- Fast, reliable, mature.
- Huge community and hosting support.
- Works with every language.
FAQs
MySQL vs PostgreSQL?
MySQL is simpler and very fast for reads; PostgreSQL has more advanced features. More in our MySQL guides.
Is MySQL free?
The Community Edition is free and open source.
