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

SQL Presentation

The SQL SELECT statement is used to select data from database tables. It includes clauses like FROM to specify the table, WHERE to filter records, ORDER BY to sort results, and GROUP BY to group rows. Other clauses like HAVING are used with aggregate functions since WHERE cannot be. JOINS combine data from multiple tables, and functions like SUM, SUBSTR, TO_DATE, and BETWEEN operate on the selected data.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

SQL Presentation

The SQL SELECT statement is used to select data from database tables. It includes clauses like FROM to specify the table, WHERE to filter records, ORDER BY to sort results, and GROUP BY to group rows. Other clauses like HAVING are used with aggregate functions since WHERE cannot be. JOINS combine data from multiple tables, and functions like SUM, SUBSTR, TO_DATE, and BETWEEN operate on the selected data.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

SQL

SELECT

The SELECT statement is used to select data from a database


FROM

The FROM command is used to specify which table to select or delete data from.
WHERE

The WHERE clause is used to filter records.


ORDER BY

The ORDER BY keyword is used to sort the result-set in ascending or descending


order.
GROUP BY

The GROUP BY statement groups rows that have the same values into summary rows, like
"find the number of customers in each country".
HAVING

The HAVING clause was added to SQL because the WHERE keyword cannot
be used with aggregate functions.
INSTR

The INSTR() function returns the position of the first occurrence of a


string in another string.
JOINS
A JOIN clause is used to combine rows from two or more tables

(INNER) JOIN
Returns records that have matching values in both tables
LEFT (OUTER) JOIN
Returns all records from the left table, and the matched records from the right table
RIGHT (OUTER) JOIN
Returns all records from the right table, and the matched records from the left table
FULL (OUTER) JOIN
Returns all records when there is a match in either left or right table
SUM
The SUM() function returns the total sum of a numeric column.

MINUS
The MINUS operator is used to subtract the result set obtained by first SELECT query from the
result set obtained by second SELECT query.
NVL

NVL2
DECODE
CASE

SUB QUERY

SUBSTR
TO_DATE

TO_CHAR
UNION

UNION ALL

BETWEEN

You might also like