Skip to content

Instantly share code, notes, and snippets.

@51enra
Created December 2, 2019 12:03
Show Gist options
  • Save 51enra/a7bd1611879b29524510326ad6e1b2f2 to your computer and use it in GitHub Desktop.
Save 51enra/a7bd1611879b29524510326ad6e1b2f2 to your computer and use it in GitHub Desktop.
Wild Code School SQL Quest 3
mysql> INSERT INTO school (name,country, capacity) VALUES
-> ('Beauxbatons Academy of Magic', 'France', 550),
-> ('Castelobruxo', 'Brazil', 380),
-> ('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),
-> ('Durmstrang Institute', 'Norway', 570);
mysql> UPDATE school
-> SET country='SWEDEN'
-> WHERE id=8;
mysql> UPDATE school
-> SET capacity = 700
-> WHERE name LIKE 'Mahou%';
mysql> DELETE FROM school
-> WHERE name LIKE '%Magic%';
mysql> SELECT * FROM school;
+----+----------------------------------------------+----------+----------------+
| id | name | capacity | country |
+----+----------------------------------------------+----------+----------------+
| 2 | Castelobruxo | 380 | Brazil |
| 3 | Hogwarts School of Witchcraft and Wizardry | 450 | United Kingdom |
| 4 | Ilvermorny School of Witchcraft and Wizardry | 300 | USA |
| 5 | Koldovstoretz | 125 | Russia |
| 8 | Durmstrang Institute | 570 | SWEDEN |
+----+----------------------------------------------+----------+----------------+
5 rows in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment