Learn MySQL from scratch: installation, databases, tables, CRUD, joins, indexes and stored procedures.
The Most Popular Open Source Database MySQL is an open source relational database management system (RDBMS) owned by Oracle Corporation. It stores data in tables made of rows and ...
Downloading MySQL Visit the official MySQL community downloads page and choose MySQL Community Server for your operating system. On Windows, the MSI installer is the easiest path; ...
Two Ways to Talk to MySQL You can interact with MySQL using a graphical tool, MySQL Workbench, or the text-based command line client. Both connect to the same server and execute ...
Creating a Database For fresh installations always specify utf8mb4 as the character set so you can store emoji and any world language safely. Creating a Table Explaining the ...
The INSERT Statement You add rows to a table with INSERT . The column list after the table name is optional, but providing it is safer when column order changes. Selecting What ...
The SELECT Statement * means every column. DISTINCT removes duplicate rows from the result. Filtering With WHERE = , <> , > , <= compare values. AND and OR combine conditions. IN ...
Updating Rows Always include a WHERE clause, or every row in the table will be changed. The WHERE decides which rows the update touches. Deleting Rows Without a WHERE clause, ...
Why Constraints Matter Constraints are rules that protect the integrity of your data. They stop invalid rows from ever being written. Common Constraint Types PRIMARY KEY: unique ...
Combining Tables A JOIN returns rows from two or more tables based on a matching condition. This is the heart of relational databases. The Dataset INNER JOIN Returns only rows ...
Summarising Data Aggregate functions collapse many rows into one summary value. Common Aggregate Functions COUNT(*) counts all rows; COUNT(col) counts non-null values. SUM(col) ...
Why Indexes Exist An index is a separate structure that lets MySQL find rows quickly without scanning the whole table. Searching without an index is a linear scan; with a good ...
Stored Procedures A stored procedure is SQL logic saved inside the database that you can call by name. It centralises business rules and reduces traffic between app and DB. Stored ...
Logical Backups With mysqldump mysqldump produces a text file of SQL statements that recreate the schema and data. Restoring a Backup Backing Up All Databases and Only Structure ...