0% found this document useful (0 votes)
12 views1 page

Dbms Notes

Uploaded by

Knothey Dulay
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)
12 views1 page

Dbms Notes

Uploaded by

Knothey Dulay
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/ 1

Select Distinct Statement Limit Clause

SELECT DISTINCT column1, column2, … SELECT column1, column2, …


FROM table_name; FROM table_name
WHERE condition
Where Clause LIMIT number;
SELECT column1, column2, …
FROM table_name
WHERE condition; Like Operator
% signify zero to multiple character
Logical AND Operator _ signify one or single character
SELECT column1, column2, …
FROM table_name LIKE „%m‟ - ends with m
WHERE condition1 LIKE „%sa%‟ - have “sa” in any position
AND condition2 LIKE „_o%‟ - have “o” in second position
AND condition3; LIKE „m%a‟ - start with “m” and ends with
“a”
Logical OR Operator
SELECT column1, column2, … SELECT column1, column2, …
FROM table_name FROM table_name
WHERE condition1 WHERE condition
OR condition2 LIKE „pattern‟;
OR condition3;
Aliases
Logical NOT Operator SELECT column_name AS alias_name
SELECT column1, column2, … FROM table_name;
FROM table_name
WHERE NOT condition1; SELECT alias1.column, alias2.column1,
alias2.column2
IN Operator FROM table1 AS alias1
SELECT column1, column2, … INNER JOIN table2 AS alias2
FROM table_name WHERE alias1.column=alias2.column;
WHERE column IN (value1, value2, …);
Order By Clause
BETWEEN Operator ASC - ascending
SELECT column1, column2, … DESC - descending
FROM table_name
WHERE column BETWEEN value1 SELECT column1, column2, …
AND value2; FROM table_name
ORDER BY column ASC | DESC;
AGGREGATE FUNCTIONS
MIN() SELECT column1, column2, …
MAX() FROM table_name
COUNT() ORDER BY column1 ASC, column2 DESC;
SUM()
AVG()

You might also like