Show Menu
Cheatography

Consultes SQL Cheat Sheet (DRAFT) by

Resum consultes simples SQL

This is a draft cheat sheet. It is a work in progress and is not finished yet.

CONSULTES SIMPLES

SELECT c1,c2
filtre columnes
FROM taula
orígen dades
[WHERE cond_cerca]
filtre files
[GROUP BY cols_agrupar]
[HAVING cond_cerca]
[ORDER BY cols [ASC | DESC]]

OPERADORS PER LA CLÀUSULA WHERE

OPERADORS MATEMÀTICS
>
major que
<
menor que
>=
major o igual que
<=
menor o igual que
<>
diferent de
=
igual a
OPERADORS LÒGICS
AND
i (producte lògic)
OR
o (suma lògica)
NOT
no (negació)

ALTRES OPERADORS

LIKE
IN / NOT IN
IS NULL /
IS NOT NULL
BETWEEN
DISTINCT
/ UNIQUE