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
-- 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' | |
); |
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
-- 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 : |
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
-- 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` |
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
UPDATE school | |
SET country = 'Sweden' | |
WHERE id = 3; | |
UPDATE school | |
SET capacity = 700 | |
WHERE id = 7; | |
DELETE FROM school | |
WHERE name LIKE '%Magic%'; |