SQL Commands Cheat Sheet – How to Learn SQL in 10 Minutes

PHOTO EMBED

Thu Nov 25 2021 13:01:27 GMT+0000 (Coordinated Universal Time)

Saved by @moonbells #sql

% -- Equates to zero or more characters.
-- Example: Find all customers with surnames ending in ‘ory’.
SELECT * FROM customers
WHERE surname LIKE '%ory';

_ -- Equates to any single character.
-- Example: Find all customers living in cities beginning with any 3 characters, followed by ‘vale’.
SELECT * FROM customers
WHERE city LIKE '_ _ _vale';

[charlist] -- Equates to any single character in the list.
-- Example: Find all customers with first names beginning with J, K or T.
SELECT * FROM customers
WHERE first_name LIKE '[jkt]%';
content_copyCOPY

https://www.freecodecamp.org/news/learn-sql-in-10-minutes/