Skip to content

Instantly share code, notes, and snippets.

Avatar

gyommy

  • Joined Nov 24, 2021
View GitHub Profile
View gist:fde7e3e0d57be10024418877b7bd92fa
-- Question 1 :
SELECT `first_name`, `last_name`
FROM `wizard`
WHERE wizard.id IN (
SELECT `wizard_id`
FROM `player`
WHERE `enrollment_date`
BETWEEN '1995-01-01' AND '1998-12-31'
);
View gist:13cb3c47b778a69bbc39f5a9a8be74c5
-- Question 1 :
SELECT `name`, COUNT(*) AS nb_player
FROM `player` INNER JOIN `team`
ON team.id = team_id
GROUP BY `team_id`
ORDER BY nb_player DESC;
-- Question 2 :
View gist:f37efa33d4d586623a0585322d0f6c8e
-- Question 1 :
SELECT `last_name`, `first_name`, `role`, `team_id`
FROM `wizard` JOIN `player`
ON wizard.id = player.id
ORDER BY `team_id`, `role`, `last_name`, `first_name`;
-- Question 2 :
SELECT `first_name`, `last_name`
View gist:839d0c5da1218412d788ac49d10fd24b
UPDATE school
SET country = 'Sweden'
WHERE id = 3;
UPDATE school
SET capacity = 700
WHERE id = 7;
DELETE FROM school
WHERE name LIKE '%Magic%';