SQL Cheat Sheet Intermediate - MD
SQL Cheat Sheet Intermediate - MD
cour…
LIKE SELECT column1, column2, ... FROM LIKE operator is used in a WHERE SELECT f_name , l_name FROM
table_name WHERE columnN LIKE clause to search for a specified pattern employees WHERE address LIKE
pattern; in a column. '%Elgin,IL%';
There are two wildcards often used in
conjunction with the LIKE operator
which are percent sign(%) and
underscore sign (_).
BETWEEN SELECT column_name(s) FROM The BETWEEN operator selects values SELECT * FROM employees WHERE salary
table_name WHERE column_name BETWEEN within a given range. The values can be BETWEEN 40000 AND 80000;
value1 AND value2; numbers, text, or dates. The BETWEEN
operator is inclusive: begin and end
values are included.
ORDER BY SELECT column1, column2, ... FROM ORDER BY keyword is used to sort the SELECT f_name, l_name, dep_id FROM
table_name ORDER BY column1, result-set in ascending or descending employees ORDER BY dep_id DESC,
column2, ... ASC|DESC; order. The default is ascending. l_name;
GROUP BY SELECT column_name(s) FROM GROUP BY clause is used in collaboration SELECT dep_id, COUNT(*) FROM
table_name WHERE condition GROUP BY with the SELECT statement to arrange employees GROUP BY dep_id;
column_name(s) ORDER BY identical data into groups.
column_name(s);
Author(s)
Lakshmi Holla
Changelog
Date Version Changed by Change Description
https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DB0201EN-SkillsNetwork/labs/CheatSheet/SQL-Cheat-Sheet-Intermediate.md.html?origin=www.coursera.org 1/1