0% found this document useful (0 votes)
7 views3 pages

My SQL Shortcut

Uploaded by

rajritsanvin9839
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

My SQL Shortcut

Uploaded by

rajritsanvin9839
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

COUNT

--COUNT)returns the number of rowsthat match a specified condition --

SELECT COUNT(*)FROM students;

SUM
--SUM) calculates the sum of a numeric column --

SELECT SUM(revenue) FROM sales;

AVG
-- AVG0 calculates the average of a numeric column --

SELECTAVG(salary) FROMemployees;
MIN
--MINO returns the smallest value in a column -

SELECTMIN(price) FROMproducts;

MAX
--MAX)returns the largest value in a column --

SELECT MAX(age) FROM employees;

UPPER
--UPPER) is used to convert all characters in a strin tou ercase --
SELECT UPPER('helloworld');
LOWER
--LOWER)is used to convert all characters in a stringto lowercase --

SELECT LOWER('hello world');

JOIN
--JOINO combines2 or moretables into a single result
set basedon a common column between them.

SELECT* FROM customers JOINorders


ON customers.customer_id = orders.customer_id;

DISTINCT
--DISTINCT) returns only distinct(unique) values in a column --

SELECT DISTINCT city FROMcustomers;

You might also like