Advertisement
Guest User

Untitled

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