sql 03-Manipulate.sql

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 03-Manipulate.sql相关的知识,希望对你有一定的参考价值。

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 Wizardry,', 'United Kingdom', 450),
('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300),
('Koldovstoretz', 'Russia', 125),
('Mahoutokoro School of Magic', 'Japan', 800),
('Uagadou School of Magic', 'Uganda', 350);

------------------------------------

UPDATE school
SET country='Sweden'
WHERE name='Durmstrang Institute';

------------------------------------

UPDATE school
SET capacity='700'
WHERE name='Mahoutokoro School of Magic';

------------------------------------

DELETE FROM school
WHERE name LIKE '%Magic%';

------------------------------------

SELECT *
FROM school;

------------------------------------

+----+----------------------------------------------+----------+----------------+
| id | name                                         | capacity | country        |
+----+----------------------------------------------+----------+----------------+
|  2 | Castelobruxo                                 |      380 | Brazil         |
|  3 | Durmstrang Institute                         |      570 | Sweden         |
|  4 | Hogwarts School of Witchcraft and Wizardry,  |      450 | United Kingdom |
|  5 | Ilvermorny School of Witchcraft and Wizardry |      300 | USA            |
|  6 | Koldovstoretz                                |      125 | Russia         |
+----+----------------------------------------------+----------+----------------+
5 rows in set (0.00 sec)

以上是关于sql 03-Manipulate.sql的主要内容,如果未能解决你的问题,请参考以下文章

sql 2008和sql 2012的区别

sql [sql技巧]一些sql技巧#sql

sql 2008 r2 在sql 2008上兼容么

SQL基础

有大神知道,sql server 中如何批量执行sql语句吗?

pl sql developer怎么执行sql