Skip to content

Instantly share code, notes, and snippets.

@gyommy
Created November 25, 2021 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gyommy/f37efa33d4d586623a0585322d0f6c8e to your computer and use it in GitHub Desktop.
Save gyommy/f37efa33d4d586623a0585322d0f6c8e to your computer and use it in GitHub Desktop.
-- 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`
FROM `wizard` JOIN `player`
ON wizard.id = player.id
WHERE `role` = 'seeker'
ORDER BY `last_name`, `first_name`;
-- Question 3 :
SELECT *
FROM `wizard` LEFT JOIN `player`
ON wizard_id = wizard.id
WHERE `wizard_id` IS NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment