Created
January 14, 2019 12:45
-
-
Save cormobro/8620d14d85523a973a1b67da4a8151e8 to your computer and use it in GitHub Desktop.
query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- #1 | |
SELECT nom, salaire FROM `equipe` WHERE campus_mgr IS NULL | |
-- #2 | |
SELECT IF(id_camp=140, "#####", nom) FROM `equipe` | |
-- #3 | |
SELECT nom, SUBSTR(date_embauche, 6, 2) FROM `equipe` | |
-- #4 | |
SELECT nom, IF(SUBSTR(date_embauche, 1, 4)!=2017, "13", 13 - SUBSTR(date_embauche, 6, 2)) FROM `equipe` | |
-- #5 | |
SELECT nom, fonction, date_embauche, campus.nom_camp, campus.nom_camp FROM `equipe` INNER JOIN campus ON equipe.id_camp=campus.id_camp WHERE campus.nom_camp="nurn" | |
-- #6 | |
SELECT nom FROM `equipe` WHERE date_embauche < "2017-12-03" | |
-- #7 | |
SELECT IF(b.date_embauche < a.date_embauche, b.date_embauche, NULL), IF(b.date_embauche < a.date_embauche, b.nom, NULL) FROM equipe b INNER JOIN equipe a ON b.campus_mgr=a.id_eqp | |
-- #8 | |
SELECT IF(date_embauche="2017-01-23", IF(nom="Pippin", NULL, nom), NULL), IF(date_embauche="2017-01-23", IF(nom="Pippin", NULL, date_embauche), NULL) FROM equipe | |
-- #9 | |
SELECT nom, date_embauche FROM equipe WHERE date_embauche < "2017-01-23" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment