What is SQL?

SQL here means the statements that move a table into a database: INSERT INTO with a VALUES list, and optionally the CREATE TABLE that defines the columns.

Who uses it

Anyone seeding a database, moving a spreadsheet into an application, or writing a migration.

Reading SQL

Column names come from the INSERT column list, or from a CREATE TABLE if one is present. Quoted strings are unquoted, doubled quotes are collapsed, and NULL becomes an empty cell.

Writing SQL

String values are escaped by doubling any single quote. Statements are written in batches so a large table does not become one statement megabytes long, which many clients refuse. Ask for CREATE TABLE as well and column types are inferred: a column stays INT until a value does not fit, then widens to DECIMAL, then to VARCHAR.

What it can hold

SQL is a database format. Column names come from the INSERT list or a CREATE TABLE, and NULL is a distinct value rather than an empty string. A machine can read the table back out of it without guessing, which is what makes it safe to convert into and out of.

It keeps

It cannot express

What it looks like

Example SQL
INSERT INTO `staff` (`id`, `name`, `role`, `started`, `hours`) VALUES
  ('007', 'Halima Yusuf', 'Analyst, data', '2024-03-15', '38.5'),
  ('012', 'Jonah "Jo" Pryce', 'Engineer', '2025-11-02', NULL),
  ('104', 'Wei Chen', 'Manager', '2023-06-30', '40');

Questions

Are the generated INSERT statements safe to run?

Quotes in your data are escaped, so the statements are syntactically correct. They are not parameterised, which is fine for a one-off import you are running yourself and not fine as a pattern for application code that takes user input.

How do I open SQL files?

Any text editor will show you the contents. To read it as a table, paste it into the converter on this site and it appears in an editable grid. Nothing is uploaded.

Is SQL a good format for sharing data?

It depends who is receiving it. Anyone seeding a database, moving a spreadsheet into an application, or writing a migration. If the recipient is outside that group, a plain CSV travels further than anything else.

Convert SQL to something else

Convert something else to SQL