SHARE
TWEET

Untitled

a guest May 23rd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mysql> INSERT INTO school (name, country, capacity) VALUES ('Beauxbatons Academy of Magic', 'France', 550), ('Castelobruxo', 'Brazil', 380), ('Durmstrang Institute', 'Norway', 570), ('Hogwarts School of Witchcraft and Wizardy', 'United Kingdom', 450), ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), ('Koldovstoretz', 'Russia', 125), ('Mahoutokoro School of Magic', 'Japan', 800), ('Uagadou Schhol of Magic', 'Uganda', 350);
  2. Query OK, 8 rows affected (0.01 sec)
  3. Records: 8  Duplicates: 0  Warnings: 0
  4.  
  5. mysql> DESCRIBE school
  6.     -> DESCRIBE school ;
  7. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESCRIBE school' at line 2
  8. mysql> DESCRIBE school;
  9. +----------+--------------+------+-----+---------+----------------+
  10. | Field    | Type         | Null | Key | Default | Extra          |
  11. +----------+--------------+------+-----+---------+----------------+
  12. | id       | int(11)      | NO   | PRI | NULL    | auto_increment |
  13. | name     | varchar(100) | NO   |     | NULL    |                |
  14. | capacity | int(11)      | YES  |     | NULL    |                |
  15. | country  | varchar(225) | NO   |     | NULL    |                |
  16. +----------+--------------+------+-----+---------+----------------+
  17. 4 rows in set (0.00 sec)
  18.  
  19. mysql> SELECT * FROM school;
  20. +----+----------------------------------------------+----------+----------------+
  21. | id | name                                         | capacity | country        |
  22. +----+----------------------------------------------+----------+----------------+
  23. |  1 | Beauxbatons Academy of Magic                 |      550 | France         |
  24. |  2 | Castelobruxo                                 |      380 | Brazil         |
  25. |  3 | Durmstrang Institute                         |      570 | Norway         |
  26. |  4 | Hogwarts School of Witchcraft and Wizardy    |      450 | United Kingdom |
  27. |  5 | Ilvermorny School of Witchcraft and Wizardry |      300 | USA            |
  28. |  6 | Koldovstoretz                                |      125 | Russia         |
  29. |  7 | Mahoutokoro School of Magic                  |      800 | Japan          |
  30. |  8 | Uagadou Schhol of Magic                      |      350 | Uganda         |
  31. +----+----------------------------------------------+----------+----------------+
  32. 8 rows in set (0.00 sec)
  33.  
  34. mysql> UPDATE school SET capacity=700 WHERE name='Mahoutokoro School of Magic';
  35. Query OK, 1 row affected (0.01 sec)
  36. Rows matched: 1  Changed: 1  Warnings: 0
  37.  
  38. mysql> SELECT * FROM school;
  39. +----+----------------------------------------------+----------+----------------+
  40. | id | name                                         | capacity | country        |
  41. +----+----------------------------------------------+----------+----------------+
  42. |  1 | Beauxbatons Academy of Magic                 |      550 | France         |
  43. |  2 | Castelobruxo                                 |      380 | Brazil         |
  44. |  3 | Durmstrang Institute                         |      570 | Norway         |
  45. |  4 | Hogwarts School of Witchcraft and Wizardy    |      450 | United Kingdom |
  46. |  5 | Ilvermorny School of Witchcraft and Wizardry |      300 | USA            |
  47. |  6 | Koldovstoretz                                |      125 | Russia         |
  48. |  7 | Mahoutokoro School of Magic                  |      700 | Japan          |
  49. |  8 | Uagadou Schhol of Magic                      |      350 | Uganda         |
  50. +----+----------------------------------------------+----------+----------------+
  51. 8 rows in set (0.00 sec)
  52.  
  53. mysql> DELETE FROM school WHERE name='%Magic';
  54. Query OK, 0 rows affected (0.00 sec)
  55.  
  56. mysql> DELETE FROM school WHERE name LIKE 'Magic%';
  57. Query OK, 0 rows affected (0.00 sec)
  58.  
  59. mysql> DELETE FROM school WHERE name LIKE '%Magic';
  60. Query OK, 3 rows affected (0.01 sec)
  61.  
  62. mysql> SELECT * FROM school;
  63. +----+----------------------------------------------+----------+----------------+
  64. | id | name                                         | capacity | country        |
  65. +----+----------------------------------------------+----------+----------------+
  66. |  2 | Castelobruxo                                 |      380 | Brazil         |
  67. |  3 | Durmstrang Institute                         |      570 | Norway         |
  68. |  4 | Hogwarts School of Witchcraft and Wizardy    |      450 | United Kingdom |
  69. |  5 | Ilvermorny School of Witchcraft and Wizardry |      300 | USA            |
  70. |  6 | Koldovstoretz                                |      125 | Russia         |
  71. +----+----------------------------------------------+----------+----------------+
  72. 5 rows in set (0.00 sec)
  73.  
  74. mysql> UPDATE school SET country='Sweden' WHERE country='Norway';
  75. Query OK, 1 row affected (0.00 sec)
  76. Rows matched: 1  Changed: 1  Warnings: 0
  77.  
  78. mysql> SELECT * FROM school;
  79. +----+----------------------------------------------+----------+----------------+
  80. | id | name                                         | capacity | country        |
  81. +----+----------------------------------------------+----------+----------------+
  82. |  2 | Castelobruxo                                 |      380 | Brazil         |
  83. |  3 | Durmstrang Institute                         |      570 | Sweden         |
  84. |  4 | Hogwarts School of Witchcraft and Wizardy    |      450 | United Kingdom |
  85. |  5 | Ilvermorny School of Witchcraft and Wizardry |      300 | USA            |
  86. |  6 | Koldovstoretz                                |      125 | Russia         |
  87. +----+----------------------------------------------+----------+----------------+
  88. 5 rows in set (0.00 sec)
  89.  
  90. mysql>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top