Skip to content

Instantly share code, notes, and snippets.

View elneris's full-sized avatar
🚀
Working at Omnilog

Elneris Dang elneris

🚀
Working at Omnilog
View GitHub Profile
class person {
constructor(name, age) {
this.name = name;
this.age = age;
}
tellMyName() {
return `I am ${this.name}.`;
}
SELECT team.name as name, COUNT(player.id) as nb_player FROM player
INNER JOIN team ON player.team_id = team.id
GROUP BY team.name ORDER BY nb_player DESC;
+------------+-----------+
| name | nb_player |
+------------+-----------+
| Gryffindor | 36 |
| Slytherin | 21 |
| Ravenclaw | 15 |
SELECT wizard.firstname as firstname, wizard.lastname as lastname, player.role as role, team.name as team
FROM wizard
INNER JOIN player ON wizard.id = player.wizard_id INNER JOIN team ON team.id = player.team_id
ORDER BY team.name, player.role, wizard.lastname, wizard.firstname;
+-------------+-----------------+--------+------------+
| firstname | lastname | role | team |
+-------------+-----------------+--------+------------+
| Sirius | Black | beater | Gryffindor |
| Lavender | Brown | beater | Gryffindor |
INSERT INTO school (id, name, capacity, country) VALUES
(NULL, 'Beauxbatons Academy of Magic', '550', 'France'),
(NULL, 'Castelobruxo', '380', 'Brazil'),
(NULL, 'Durmstrang Institute', '570', 'Norway'),
(NULL, 'Hogwarts School of Witchcraft and Wizardry', '450', 'United Kingdom'),
(NULL, 'Ilvermorny School of Witchcraft and Wizardry', '300', 'USA'),
(NULL, 'Koldovstoretz', '125', 'Russia'),
(NULL, 'Mahoutokoro School of Magic', '800', 'Japan'),
(NULL, 'Uagadou School of Magic', '350', 'Uganda');
<?php
Class Personne
{
// Attributs
public $lastname;
public $firstname;
public $adress;
public $birthday;
@elneris
elneris / SQL.md
Last active March 21, 2019 15:56
mysql> SELECT * FROM wizard WHERE is_muggle = 0 AND birthdate BETWEEN '1975-01-01' AND '1985-01-01';
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthdate  | 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 |
@elneris
elneris / commande_base_git.md
Last active September 9, 2022 08:54
MEMO GIT

Configuration

# Identity Name
git config --global user.name "elneris"

# Identity Email
git config --global user.email "elneris.dang@gmail.com"

# Editor Tool
DELETE FROM movie WHERE id=5;
DELETE FROM movie WHERE id > 10;
UPDATE movie SET name='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;
INSERT INTO movie VALUES ('la guerre des etoiles', 'stargate', 'interstellar');
INSERT INTO movie (name, poster, comment) VALUES ('hello', 'je sais pas', 'cest un film sa');
INSERT INTO movie (name, poster, comment) VALUES
('les visiteur', 'ok', 'sympa'),
('les visiteurs 2', 'OK', 'bof'),
('les visiteur 3', 'ok ok', 'nul');
INSERT INTO movie (name) VALUES ('les visiteur 58');