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

SQL Cheat Sheet Intermediate - MD

This document provides an overview of intermediate SQL commands including LIKE, ORDER BY, GROUP BY, and BETWEEN. It defines each command and provides basic syntax and examples. LIKE is used to search for patterns in a column. ORDER BY sorts result sets in ascending or descending order. GROUP BY arranges identical data into groups. BETWEEN selects values within a given numeric or date range.

Uploaded by

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

SQL Cheat Sheet Intermediate - MD

This document provides an overview of intermediate SQL commands including LIKE, ORDER BY, GROUP BY, and BETWEEN. It defines each command and provides basic syntax and examples. LIKE is used to search for patterns in a column. ORDER BY sorts result sets in ascending or descending order. GROUP BY arranges identical data into groups. BETWEEN selects values within a given numeric or date range.

Uploaded by

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

12/9/22, 10:28 AM https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DB0201EN-SkillsNetwork/labs/CheatSheet/SQL-Cheat-Sheet-Intermediate.md.html?origin=www.

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
table_name
WHERE column_name within a given range. The values can be salary BETWEEN 40000 AND 80000;
BETWEEN 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 SELECT dep_id, COUNT(*)
FROM
table_name
WHERE condition
GROUP BY collaboration with the SELECT employees
GROUP BY dep_id;
column_name(s)
ORDER BY statement to arrange identical data
column_name(s); into groups.

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