CREATE DATABASE COMPANY CHARACTER SET gbk; SHOW DATABASES; ALTER DATABASE COMPANY CHARACTER SET utf8; USE COMPANY; CREATE TABLE DEPA ( DNO DECIMAL(2)COMMENT '部门编号', DNAME VARCHAR(16)COMMENT '部门名称', ADDR VARCHAR(20)COMMENT '部门地址' )COMMENT'部门表'; CREATE TABLE EMPL ( ENO DECIMAL(4)COMMENT '员工编号', ENAME CHAR(8)COMMENT '员工姓名', BIRTHDATE DATETIME COMMENT '出生日期', SALARY DECIMAL(7,2) COMMENT '工资', DNO DECIMAL(2) COMMENT '所在部门编号' )COMMENT='雇员表'; CREATE TABLE PROJ ( PNO DECIMAL(3)COMMENT '项目编号', PNAME VARCHAR(24)COMMENT '项目名称' )COMMENT='项目表'; CREATE TABLE JOB ( ENO DECIMAL(4)COMMENT '员工编号', PNO DECIMAL(3)COMMENT '项目编号', DAYS INT COMMENT '工作天数' )COMMENT='工作表'; INSERT INTO DEPA (DNO, DNAME, ADDR) VALUES (14, '客户中心', '开发区紫光路2号'); INSERT INTO DEPA (DNO, DNAME, ADDR) VALUES (15, '技术支持部', '沈阳东郊区120号'); INSERT INTO DEPA (DNO, DNAME, ADDR) VALUES (13, '财务部', '大连甘井子区红岭路'); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1401, '张山', '1977-09-01', 4050, 14); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1402, '何宜', '1989-03-14', 3500, 15); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1403, '李强', '1999-05-06', 2000, 15); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1404, '王珊', '1988-07-16', 3800, 14); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1405, '刘志伟', '1994-08-26', 2800, 14); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1406, '张三三', '1984-07-16', 3500, 14); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1407, '李四三', '1985-07-30', 3700, 14); INSERT INTO EMPL (ENO, ENAME, BIRTHDATE, SALARY, DNO) VALUES (1408, '赵乾坤', '1990-05-16', 3850, 13); INSERT INTO PROJ (PNO, PNAME) VALUES (101, '学生信息管理系统'); INSERT INTO PROJ (PNO, PNAME) VALUES (102, '图书馆管理系统'); INSERT INTO PROJ (PNO, PNAME) VALUES (103, '历史学院档案库管理系统'); INSERT INTO PROJ (PNO, PNAME) VALUES (104, 'ATM机管理系统'); INSERT INTO JOB (ENO, PNO, DAYS) VALUES (1401, 104, 35); INSERT INTO JOB (ENO, PNO, DAYS) VALUES (1402, 103, 20); .创建包含外码约束字段的表;创建部门收支表CHARGE,一共有2个字段: 部门号(Dno)数据类型为4位长定长字符串 收支(CHARGE)数据类型为DECIMAL(7,2) 要求部门号是外键