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

SQL Commands

Uploaded by

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

SQL Commands

Uploaded by

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

Major Commands:

SELECT UPDATE DELETE


INSERT WHERE

Operators:

Operator Description

= Equal

> Greater than

< Less than

>= Greater than or equal

<= Less than or equal

<> Not equal. Note: In some versions of SQL this operator may be written as !=

BETWEEN Between a certain range

LIKE Search for a pattern

IN To specify multiple possible values for a column

SELECT extracts data from a SELECT Country FROM Customers;


database
SELECT return only distinct SELECT DISTINCT Country FROM Customers;
DISTINCT (different) values.
SELECT COUNT lists the number of SELECT COUNT(DISTINCT Country) FROM Custo
different (distinct) mers;
customer countries
WHERE used to filter records. SELECT * FROM Customers
WHERE Country='Mexico';
SELECT * FROM Customers
WHERE CustomerID=1;
AND displays a record if all the
conditions separated
by AND are TRUE.
OR displays a record if any of
the conditions separated
by OR is TRUE.
NOT displays a record if the
condition(s) is NOT TRUE
ORDER BY
DESC
INSERT INTO inserts new data into a
database
IS NULL
IS NOT NULL
UPDATE updates data in a
database
DELETE deletes data from a
database

CREATE creates a new database


DATABASE
ALTER modifies a database
DATABASE
CREATE creates a new table
TABLE
ALTER TABLE modifies a table
DROP TABLE deletes a table
CREATE creates an index (search
INDEX key)
DROP INDEX deletes an index

You might also like