Advertisement
Guest User

Untitled

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