Skip to content

Instantly share code, notes, and snippets.

@bradsi
Last active April 1, 2021 12:46
Show Gist options
  • Save bradsi/6bb7b7bd392b846ae2985db9f893695b to your computer and use it in GitHub Desktop.
Save bradsi/6bb7b7bd392b846ae2985db9f893695b to your computer and use it in GitHub Desktop.
SQL Commands that deal with the manipulation of data. - INSERT - UPDATE - DELETE
-- insert single entry into table
INSERT INTO users (first_name, last_name, email)
VALUES ('John', 'Smith', 'johnsmith@gmail.com');
-- insert multiple entries
INSERT INTO users (first_name, last_name, email)
VALUES ('John', 'Smith', 'johnsmith@gmail.com'),
('John', 'Doe', 'johndoe@gmail.com');
-- update
UPDATE users
SET email = 'newemail@gmail.com'
WHERE id = 1;
-- delete
DELETE FROM users WHERE id = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment