Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. mysql> INSERT INTO school (name, country, capacity)
  2. -> VALUES ('Beauxbatons Academy of Magic', 'France', 550),
  3. -> ('Castelobruxo', 'Brazil', 380),
  4. -> ('Durmstrang Institute', 'Norway', 570),
  5. -> ('Hogwarts School of Witchcraft and Wizardry', 'United Kingdom', 450),
  6. -> ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300),
  7. -> ('Koldovstoretz', 'Russia', 125),
  8. -> ('Mahoutokoro School of Magic', 'Japan', 800),
  9. -> ('Uagadou School of Magic', 'Uganda', 350);
  10. Query OK, 8 rows affected (0.00 sec)
  11. Records: 8 Duplicates: 0 Warnings: 0
  12.  
  13. ==========================================
  14.  
  15. mysql> UPDATE school
  16. -> SET country='Sweden'
  17. -> WHERE id=3;
  18. Query OK, 1 row affected (0.00 sec)
  19. Rows matched: 1 Changed: 1 Warnings: 0
  20.  
  21. ==========================================
  22.  
  23. mysql> UPDATE school
  24. -> SET capacity=700
  25. -> WHERE id=7;
  26. Query OK, 1 row affected (0.00 sec)
  27. Rows matched: 1 Changed: 1 Warnings: 0
  28.  
  29. ==========================================
  30.  
  31. mysql> DELETE FROM school
  32. -> WHERE name LIKE '%Magic';
  33. Query OK, 3 rows affected (0.01 sec)
  34.  
  35. ==========================================
  36.  
  37. mysql> SELECT * FROM school;
  38. +----+----------------------------------------------+----------+----------------+
  39. | id | name | capacity | country |
  40. +----+----------------------------------------------+----------+----------------+
  41. | 2 | Castelobruxo | 380 | Brazil |
  42. | 3 | Durmstrang Institute | 570 | Sweden |
  43. | 4 | Hogwarts School of Witchcraft and Wizardry | 450 | United Kingdom |
  44. | 5 | Ilvermorny School of Witchcraft and Wizardry | 300 | USA |
  45. | 6 | Koldovstoretz | 125 | Russia |
  46. +----+----------------------------------------------+----------+----------------+
  47. 5 rows in set (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement