Skip to content

Instantly share code, notes, and snippets.

@gbarreiro
Created August 20, 2020 12:11
Show Gist options
  • Save gbarreiro/89e1edf7df0ed5ecdf6191c2a12dd521 to your computer and use it in GitHub Desktop.
Save gbarreiro/89e1edf7df0ed5ecdf6191c2a12dd521 to your computer and use it in GitHub Desktop.
MySQL cheatsheet: insert a row
-- Insert a single row, providing a value for each column
INSERT INTO Students VALUES (1, 'Peter', 25);
-- Insert a single row, not providing a value for every column
INSERT INTO Students(id, name) VALUES (1, 'Peter');
-- Insert multiple rows at the same time
INSERT INTO Students VALUES (1, 'Peter', 25), (2, 'Frank', 19), (3, 'William', 21);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment