/*
SQLyog Ultimate v10.00 Beta1
MySQL - 5.7.29 : Database - yggl
*/
/!40101 SET NAMES utf8 /;
/!40101 SET SQL_MODE=''/;
/!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 /;
/!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /;
/!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' /;
/!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 /;
CREATE DATABASE /!32312 IF NOT EXISTS/
yggl
/!40100 DEFAULT CHARACTER SET utf8 /;
USE
yggl
;
/Table structure for table
departments
/
DROP TABLE IF EXISTS
departments
CREATE TABLE
departments
(
department_number
char(3) NOT NULL,
department_name
char(20) NOT NULL,
remark
varchar(100) DEFAULT NULL,
PRIMARY KEY (
department_number
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/Data for the table
departments
employees
employees
employees
employeeid
char(6) NOT NULL,
name
char(10) NOT NULL,
education
char(4) NOT NULL,
birth
date NOT NULL,
sex
char(2) NOT NULL,
workyear
int(1) DEFAULT NULL,
address
varchar(20) DEFAULT NULL,
phonenumber
char(12) DEFAULT NULL,
departmentid
char(3) DEFAULT NULL,
employeeid
employees
insert into
employees
employeeid
,
name
education
birth
sex
workyear
address
phonenumber
departmentid
) values ('1','張一','大學','1998-01-28','男',1,'山東省','10001','1');
salary
salary
salary
employeeid
income
float(8,2) NOT NULL,
expend
employeeid
salary
/ Procedure structure for procedure
proc_name
/!50003 DROP PROCEDURE IF EXISTS
proc_name
/;
DELIMITER $$
/*!50003 CREATE DEFINER=
root
@
localhost
PROCEDURE
proc_name
()
begin
select * from departments;
select * from employees;
end */$$
DELIMITER ;
/!40101 SET SQL_MODE=@OLD_SQL_MODE /;
/!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS /;
/!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS /;
/!40111 SET SQL_NOTES=@OLD_SQL_NOTES /;