Skip to content

Instantly share code, notes, and snippets.

mysql> select * from wizard w left join player p on p.wizard_id = w.id order by role is null desc limit 9;
+----+-----------+----------+------+-----------+---------+------+-----------------+
| id | firstname | lastname | id | wizard_id | team_id | role | enrollment_date |
+----+-----------+----------+------+-----------+---------+------+-----------------+
| 65 | Horace | Slughorn | NULL | NULL | NULL | NULL | NULL |
| 80 | Charles | Weasley | NULL | NULL | NULL | NULL | NULL |
| 9 | Terry | Boot | NULL | NULL | NULL | NULL | NULL |
| 84 | Molly | Weasley | NULL | NULL | NULL | NULL | NULL |
| 15 | Crabbe | | NULL | NULL | NULL | NULL | NULL |
| 45 | Remus | Lupin | NULL | NULL | NULL | NULL | NULL |
@Jeremy-san
Jeremy-san / digifactory.css
Last active October 11, 2019 18:48
test technique
header{
background-color: #FEFEFE;
width: 100%;
z-index: 1;
border-bottom: 0.5px solid grey;
}
h2{
border-bottom: 0.5px solid grey;
}
// écoute de l'url "/api/employees"
app.delete('/api/movies/:id', (req, res) => {
// récupération des données envoyées
const idMovies = req.params.id;
// connexion à la base de données, et suppression d'un film
connection.query('DELETE FROM movies WHERE id = ?', [idMovies], err => {
if (err) {
app.put('/api/movies/:id', (req, res) => {
// récupération des données envoyées
const idMovies = req.params.id;
const formData = req.body;
// connection à la base de données, et insertion de l'employé
connection.query('UPDATE movies SET ? WHERE id = ?', [formData, idMovies], err => {
if (err) {
// écoute de l'url "/api/movies"
app.post('/api/movies', (req, res) => {
const formData = req.body;
// connection à la base de données, et sélection des movies
connection.query('INSERT INTO movies SET ?', formData, (err, results) => {
if (err) {
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const connection = require('./config');
const port = 3000;
app.get('/', (req, res) => {
res.status(200);
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (request, response) => {
response.send('Bienvenue sur Express');
});
app.get('/api/movies', (req, res ) => {
const http = require("http")
const url = require("url")
const port = 3000
const server = http.createServer((req, res) => {
const page = url.parse(req.url).pathname
let name = page.slice(9)
INSERT INTO school (name, country, capacity) VALUES ('Castelobruxo', 'Brazil', 380), ('Durmstrang Institute', 'Norway', 570), ('Hogwarts School of Witchcraft and Wizardry', 'United Kingdom', 450), ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), ('Koldovstoretz', 'Russia', 125), ('Mahoutokoro School of Magic', 'Japan', 800), ('Uagadou School of Magic', 'Uganda', 350);
Query OK, 7 rows affected (0,01 sec)
Records: 7 Duplicates: 0 Warnings: 0
+----+----------------------------------------------+----------+----------------+
| id | name | capacity | country |
+----+----------------------------------------------+----------+----------------+
| 1 | Beauxbatons Academy of Magic | 550 | France |
| 2 | Castelobruxo | 380 | Brazil |
| 3 | Durmstrang Institute | 570 | Norway |
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01';
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
| 6 | fred | weasley | 1978-04-01 | | | 0 |