新建视图 点击视图 ctrl+s保存
SELECT s_id,s_name,s_class from student
image.png
image.png
脚本语句
视图
视图的查询
image.png
视图的脚本语句的创建
create view newview as select * from student
image.png
image.png
视图与表之间能互相影响,同步数据改变 但很少用视图去修改元数据
存储过程(函数)
选函数
BEGIN
SELECT count(*)into zongshu from student where s_sex = '男';
END
image.png
image.png
BEGIN
if sex then
select count(*) into shu from student where s_sex = '女';
else
select count(*) into shu from student where s_sex = '男';
end if;
END
image.png
网友评论