My colleague says they write MySQL, not SQL. How do you explain the difference, and does it change the SQL I write day to day?
Your colleague is using the same word for two different things. SQL is the language, and MySQL is one engine that speaks it.
SQL is a standard, written down and agreed on. It says what the words SELECT, INSERT and CREATE TABLE mean. MySQL is a program that implements that standard, and it also adds some things of its own on top.
There are several engines that speak SQL. There is MySQL, there is PostgreSQL, there is SQLite, there is SQL Server, and there is Oracle. They all agree on the core of the language, and they each have their own spelling for some parts of it.
-- Portable ANSI SQL: this runs unchanged on MySQL, PostgreSQL, SQLite and SQL Server.
CREATE TABLE customers (
id INTEGER PRIMARY KEY,
name VARCHAR(120) NOT NULL,
city VARCHAR(60) NOT NULL
);
INSERT INTO customers (id, name, city) VALUES (1, 'Ada', 'London');
SELECT name FROM customers WHERE city = 'London';
So does it change the SQL you write day to day? Usually not, and here is why. The core of the language is the same everywhere. A select with a filter, a join and a group by behaves the same way on every engine, and almost all of the SQL you write in ordinary application code is exactly that.
What is different is the edges. The way you write an auto-numbering column is different. The way you write an upsert is different. The way you write a date and time is different. The way you limit the rows is different. The way you create an index is different. None of those are in the core, so they are the parts that you have to be careful about.
There is one more difference that matters more than the syntax. The engines do not behave the same way with transactions, with locking, and with the way they handle a failure in the middle of a set of changes. So the same query can have a different effect on two engines, even when the words are identical.
So the answer to the question is this. SQL is the language and MySQL is one engine. Write in the portable part of the language as much as you can, keep the parts that are engine specific in one place, and always test the query on the engine that will actually run it.
The next question in this topic asks for a script that both spellings accept.