Skip to content

Instantly share code, notes, and snippets.

@PhillipsHoward
PhillipsHoward / quest_unix
Created December 17, 2018 11:21
quete_unix
2001 cd quete
2002 ls
2003 cd clmystery/
2004 ls
2005 cd clmystery-master\(1\)/
2006 ls
2007 clmystery-master/
2008 ls
2009 cd clmystery-master/
2010 ls
@PhillipsHoward
PhillipsHoward / SQL_Quest_SelectChallenge.sql
Last active December 11, 2018 09:53
SQL_Quest_SelectChallenge
/*Ecris une requête retournant tous les id et les localités des campus.*/
SELECT id_camp, localite FROM campus;
/*Ecris une requête retournant le nom de chaque membre de l'équipe et le nom de son campus associé.*/
SELECT equipe.nom, campus.nom_camp AS campus
FROM equipe JOIN campus ON equipe.id_camp = campus.id_camp;
/*Ecris une requête retournant les membres de l'équipe qui ont la fonction Assistant dans les campus de La Comté et Lorien.*/
SELECT equipe.nom, campus.nom_camp AS campus
FROM equipe JOIN campus ON equipe.id_camp = campus.id_camp
@PhillipsHoward
PhillipsHoward / SQL_schools_quest.sql
Last active December 10, 2018 14:34
SQL_schools_quest
-- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64)
--
-- Host: localhost Database: Schools
-- ------------------------------------------------------
-- Server version 5.7.24-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@PhillipsHoward
PhillipsHoward / SQLAtelier
Created December 3, 2018 13:27
SQL_Atelier
1) Le prénom, nom et âge des personnages :
SELECT firstname, lastname, age FROM Person;
2) Le prénom, nom des personnages ainsi que leur royaume,
uniquement pour ceux étant reliés à un royaume :
SELECT Person.firstname, Person.lastname, Kingdom.name AS Kingdom
FROM Person JOIN Kingdom ON Person.kingdom_id = Kingdom.id;
3) La même chose en incluant tous les personnages :
SELECT Person.firstname, Person.lastname, Kingdom.name AS Kingdom
@PhillipsHoward
PhillipsHoward / SQL_delete_quest
Created November 27, 2018 09:49
quete-SQL-delete
DELETE FROM movie WHERE (id=10);
DELETE FROM movie WHERE (id>10);
@PhillipsHoward
PhillipsHoward / updateSQLQuest.txt
Created November 6, 2018 09:14
updateSQLQUEST
UPDATE movie
SET lastname='Men in black'
WHERE id='5';
UPDATE movie SET name='Deadpool', poster = 'https://upload.wikimedia.org/wikipedia/en/thumb/2/23/Deadpool_%282016_poster%29.png/220px-Deadpool_%282016_poster%29.png'
WHERE id='8';
UPDATE movie SET comment='' WHERE id='10'
@PhillipsHoward
PhillipsHoward / movieinsertquestSQL
Created November 6, 2018 08:57
movieInsertQuestSQL
INSERT INTO movie VALUES (1000, 'Jackouille se les gratte', 'https://d9nvuahg4xykp.cloudfront.net/7387597935954517416/4172306069362681719.jpg', 'Un chef d\'oeuvre')
INSERT INTO movie (name, poster, comment)
VALUES ('RDV à Gros-les-bains', 'https://d9nvuahg4xykp.cloudfront.net/7387597935954517416/4172306069362681719.jpg', 'Incroyable');
INSERT INTO movie (name, poster, comment)
VALUES ('Shark Attack le Retour', 'https://d9nvuahg4xykp.cloudfront.net/7387597935954517416/4172306069362681719.jpg', 'C\'était bien drôle'),
('Jacky Tunning casse des bouches', 'https://d9nvuahg4xykp.cloudfront.net/7387597935954517416/4172306069362681719.jpg', 'Un sommet de l\'action'),
('Flip flip fait un flop', 'https://d9nvuahg4xykp.cloudfront.net/7387597935954517416/4172306069362681719.jpg', 'La quintessence du drâme contemporain');
SELECT * FROM movie;
SELECT name FROM movie;
SELECT id, poster FROM movie;
SELECT poster, comment AS 'avis_spectateur' FROM movie;
@PhillipsHoward
PhillipsHoward / tihbault_g_wcs_toulouse.sql
Created November 5, 2018 11:14
tihbault_g_wcs_toulouse.sql
-- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64)
--
-- Host: localhost Database: thibault_g_wcs_toulouse
-- ------------------------------------------------------
-- Server version 5.7.24-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@PhillipsHoward
PhillipsHoward / Regex
Last active October 23, 2018 10:17
RegexTraining
Trouver le prénom de Néo : /A\./g
Trouver la date : /\d{2}\/\d{2}\/\d{4}/g
Trouver la note : /\b\d\/\d{2}/g
Trouver un mot de 14 caractères : /[\w]{14,}/g
Trouver l'url : /https:\/\/www\.[\w]+\.com\/[\w]+\/[\w]+/g