Created
January 31, 2020 09:50
-
-
Save jonny-gates/8051a59015e604d6f4f946c012ee6080 to your computer and use it in GitHub Desktop.
CRUD SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://airbnb.com/flats/42 | |
SELECT * FROM flats | |
WHERE id = 42 | |
# https://github.com/users/jonnygates | |
SELECT * FROM users | |
WHERE username = 'jonnygates' | |
# Gmail Delete | |
UPDATE messages SET deleted=true WHERE id = 3 | |
# SQL Injection Protection | |
DB.execute('SELECT * FROM users WHERE id = ?', 3) | |
DB.execute('UPDATES users SET username = ?, age = ? WHERE id = ?','jonnygates', 30, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment