Skip to content

Instantly share code, notes, and snippets.

@evadav
Created May 28, 2019 08:27
Show Gist options
  • Save evadav/ee64079c8ad0e2f03016739f92ce4bc5 to your computer and use it in GitHub Desktop.
Save evadav/ee64079c8ad0e2f03016739f92ce4bc5 to your computer and use it in GitHub Desktop.
Wizardry schools- Quest3-Data_Handling
8 rows in set (0.00 sec)
mysql> UPDATE school
-> SET country = `Sweden`
-> WHERE id = 3;
ERROR 1054 (42S22): Unknown column 'Sweden' in 'field list'
mysql> UPDATE school
-> SET ountry = 'Sweeden'
-> WHERE id = 3;
ERROR 1054 (42S22): Unknown column 'ountry' in 'field list'
mysql> UPDATE school
-> SET country = 'Sweeden'
-> WHERE id = 3;
Query OK, 1 row affected (0.22 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> UPDATE school
-> SET capacity = 700
-> WHERE id = 11;
Query OK, 1 row affected (0.10 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> DELETE * FROM school
-> WHERE name LIKE 'Magic';
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 '* FR
OM school
WHERE name LIKE 'Magic'' at line 1
mysql> DELETE FROM school
-> WHERE name LIKE 'Magic';
Query OK, 0 rows affected (0.08 sec)
mysql> DELETE FROM school
-> WHERE name LIKE '%Magic%';
Query OK, 3 rows affected (0.12 sec)
mysql> SELECT * FROM school;
+----+-------------------------------------------------+----------+-------------
---+
| id | name | capacity | country
|
+----+-------------------------------------------------+----------+-------------
---+
| 2 | Castelobruxo | 380 | Brazil
|
| 3 | Durmstrang Institute | 570 | Sweeden
|
| 4 | Hogwarts School of Witchcraft and Wizardry | 450 | United Kingd
om |
| 9 | Ilvermorny School of Witchcraft and Wizardry | 300 | USA
|
| 10 | Koldovstoretz | 125 | Russia
|
+----+-------------------------------------------------+----------+-------------
---+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment