#存储过程
#准备工作
CREATE DATABASE dbt1;
use dbt1;
CREATE TABLE employees
as
SELECT * FROM atguigudb.employees;
CREATE TABLE departments
as
SELECT * FROM atguigudb.departments;
#1 创建存储过程
# 举例1:创建存储过程 SELECT_all_data() ,查看emps表的所有数据
DELIMITER $
CREATE PROCEDURE SELECT_all_data()
BEGIN
SELECT * from employees;
end $
DELIMITER;
#2 存储结构的调用
CALL SELECT_all_data();