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

W3 School

The SELECT statement is used to select data from a database and can be modified using DISTINCT, WHERE, AND, OR, and ORDER BY clauses to filter and sort the results. The WHERE clause filters records by condition and AND/OR can combine multiple conditions while DISTINCT returns only unique values. ORDER BY sorts the selected records ascending or descending by specified columns.

Uploaded by

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

W3 School

The SELECT statement is used to select data from a database and can be modified using DISTINCT, WHERE, AND, OR, and ORDER BY clauses to filter and sort the results. The WHERE clause filters records by condition and AND/OR can combine multiple conditions while DISTINCT returns only unique values. ORDER BY sorts the selected records ascending or descending by specified columns.

Uploaded by

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

The SQL SELECT Statement

DISTINCT Statement
WHERE Clause
OR and NOT Operators
ORDER BY
The SELECT statement is used to select data from a database.
The SELECT DISTINCT statement is used to return only distinct (different) values.
The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition.
The AND and OR operators are used to filter records based on more than one condition:
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keywor
SELECT * FROM table_name;
SELECT DISTINCT Country FROM Customers;
SELECT * FROM Customers WHERE Country='Mexico';
SELECT column1, column2 FROM table_name WHERE condition1 AND condition2 AND condition3;
SELECT column1, column2 FROM table_name ORDER BY column1, column2, ... ASC/DESC;

You might also like