Skip to content

Instantly share code, notes, and snippets.

@cormobro
Created Jan 10, 2019
Embed
What would you like to do?
queries for sql
-- #1
SELECT id_camp, localite FROM `campus` WHERE 1;
-- #2
SELECT equipe.nom, campus.nom_camp FROM equipe INNER JOIN campus ON equipe.id_camp=campus.id_camp;
-- #3
SELECT nom FROM `equipe` WHERE fonction="assistant" AND id_camp > 120
-- #4
SELECT nom FROM `equipe` WHERE fonction!="assistant" AND date_embauche LIKE "2017%"
-- #5
SELECT nom FROM `equipe` WHERE nom LIKE "%a%" AND nom LIKE "%r%"
-- #6
SELECT nom FROM `equipe` WHERE nom LIKE "%a%a%"
-- #7
SELECT nom FROM `equipe` WHERE campus_mgr IS NULL
-- #8
SELECT nom, id_camp, fonction, date_embauche FROM `equipe` ORDER BY date_embauche desc
SELECT nom, id_camp, fonction, date_embauche FROM `equipe` ORDER BY nom asc
SELECT nom, id_camp, fonction, date_embauche FROM `equipe` ORDER BY id_camp asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment