0% found this document useful (0 votes)
16 views

SQL Cheat Sheet Intermediate - MD

The document provides an overview of intermediate SQL commands like LIKE, BETWEEN, ORDER BY and GROUP BY. It defines each command and provides an example usage. The document also lists the author and changelog.

Uploaded by

Andres Rincon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

SQL Cheat Sheet Intermediate - MD

The document provides an overview of intermediate SQL commands like LIKE, BETWEEN, ORDER BY and GROUP BY. It defines each command and provides an example usage. The document also lists the author and changelog.

Uploaded by

Andres Rincon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

18/2/23, 21:11 https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DB0201EN-SkillsNetwork/labs/CheatSheet/SQL-Cheat-Sheet-Intermediate.md.html?origin=www.

cour…

SQL Cheat Sheet: Intermediate - LIKE, ORDER BY, GROUP BY

Command Syntax Description Example

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

2021-07-28 1.0 Lakshmi Holla Initial Version

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

You might also like