网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

MYSQL工资管理系统

时间:2024-10-14 11:38:46

1、创建数据库使用create database语句创建“工资管理系统”数据库wage_management代码如下:Create database wage_management charset utf8;

2、创建表根据设计的表结构,使用create table语句创建表。代码如下:#创建员工档案钱砀渝测(file)表create table file(id bigint primary key not null,name varchar(20) not null,sex enum('男','女') not null,age tinyint,education varchar(20) not null,identify varchar(10) not null,school varchar(40) not null,major varchar(40) not null,birth datetime not null,department varchar(15) not null);

MYSQL工资管理系统

4、#创建员工工资(wage)表create table wage(id bigint primary key not null,name varchar(20) not null,base_pay float(5) not null,merit_pay float(5) not null,add_pay float(5) not null,sj_salary float(5) not null,date datetime not null,card char(19) not null);

MYSQL工资管理系统

6、#创建员工考勤(attendance)表create table attendance(department varchar(15) primary key not null,id bigint not null,name varchar(20) not null,overtime float(5) not null,vacate float(5) not null,work_time float(5) not null);

MYSQL工资管理系统

8、#创建员工部门(dept)表create table dept(id bigint(20) primary key not null,name char(20) not null,remark char(20),manager char(20),number bigint(20),tel varchar(20) default '0871-');

MYSQL工资管理系统

10、#创建员工保险(insurance)表create table insurance(id bigint(20) primary key default '5',old bigint(20) default '501',unemployment bigint(20) default '502',injury bigint(20) default '503',bear bigint(20) default '504',medical bigint(20) default '505',house bigint(20) default '506');

MYSQL工资管理系统

12、添加约束(1)员工档案表:添加主键约束、非空约束、外键约束

MYSQL工资管理系统

14、(2)员工工资表:添加主键约束、非空约束和外键约束

MYSQL工资管理系统

16、(3)员工考勤表:添加主键约束和非空约束

MYSQL工资管理系统

18、(5)员工保险表:添加主键约束、非空约束和默认约束

MYSQL工资管理系统

19、(1)创建索引index,便于信息的查询,创建语句如下:create table temp(id bigint primary key not null,name varchar(20) not null,card char(19) not null,t1 datetime);create index index1 on wage(id);explain select * from wage where id='1';

© 一点知道