1. 视图
2. 存储过程和函数
2.1 存储过程
2.2 函数
3. 流程控制结构
3.1 分支结构
3.2 循环结构
CREATE VIEW world.SOMECOUNTRYINFO
AS
SELECT world.country.`Name`,world.country.Population
FROM world.country
WHERE world.country.Population>10000000
ORDER BY world.country.Population DESC;
SELECT *
FROM SOMECOUNTRYINFO;
ALTER VIEW SOMECOUNTRYINFO
AS
SELECT
DROP VIEW world.SOMECOUNTRYINFO;
CREATE OR REPLACE VIEW SOMECOUNTRYINFO
AS
INSERT INTO world.somecountryinfo
VALUES("AC",123456789);
UPDATE world.somecountryinfo
SET world.somecountryinfo.Population=987654321
WHERE world.somecountryinfo.`Name`="AC";
DELETE FROM world.somecountryinfo
WHERE world.somecountryinfo.`Name`="AC";
SELECT *
FROM world.somecountryinfo;