yggl.sql

简介:

/*
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 /

/Table structure for table employees /

DROP TABLE IF EXISTS employees;

CREATE TABLE 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,
PRIMARY KEY (employeeid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/Data for the table employees /

insert into employees(employeeid,name,education,birth,sex,workyear,address,phonenumber,departmentid) values ('1','张一','本科','1998-01-28','男',1,'山东省','10001','1');

/Table structure for table salary /

DROP TABLE IF EXISTS salary;

CREATE TABLE salary (
employeeid char(6) NOT NULL,
income float(8,2) NOT NULL,
expend float(8,2) NOT NULL,
PRIMARY KEY (employeeid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/Data for the table 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 /;

相关文章
|
6月前
|
SQL HIVE
每天一道大厂SQL题
每天一道大厂SQL题
61 1
每天一道大厂SQL题
|
6月前
|
SQL 存储 关系型数据库
什么是SQL?
什么是SQL?
67 0
|
3月前
|
SQL 数据库 开发者
SQL中为什么不要使用1=1?
【8月更文挑战第11天】在SQL查询语句中,偶尔会遇到使用1=1作为WHERE子句一部分的情况,这种做法看似无害,实则隐藏着一些潜在的问题和更好的替代方案。本文将深入探讨为什么不建议在SQL中使用1=1,并分享更优化的查询构建策略。
85 2
|
6月前
|
SQL 关系型数据库 MySQL
|
SQL
SQL 更新视图
SQL 更新视图
65 0
|
SQL Oracle 关系型数据库
一个需求的三种实现(sql)
一个需求的三种实现(sql)
一个需求的三种实现(sql)
|
SQL 存储 搜索推荐
几个SQL问题
几个SQL问题
134 0
|
SQL
xttcnvrtbkupdest.sql
---- Convert the incremental backup (target convert) -- Inputs: cross-plaform backups set serveroutput on;set termout on;set verify off; DE...
851 0