加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

快速建立Mysql学习环境

发布时间:2020-12-11 23:19:37 所属栏目:MySql教程 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 DROP TABLE EMP;DROP TABLE DEPT;DROP TABLE BONUS;DROP TABLE SALGRADE;DROP TABLE DUMMY;CREATE TABLE EMP (EMPNO INT NOT NULL,ENAME VARCHAR(10),

以下代码由PHP站长网 52php.cn收集自互联网

现在PHP站长网小编把它分享给大家,仅供参考

DROP TABLE EMP;
DROP TABLE DEPT;
DROP TABLE BONUS;
DROP TABLE SALGRADE;
DROP TABLE DUMMY;

CREATE TABLE EMP
       (EMPNO INT NOT NULL,ENAME VARCHAR(10),JOB VARCHAR(9),MGR INT,HIREDATE DATE,SAL DOUBLE(13,2),COMM INT,DEPTNO INT);

INSERT INTO EMP VALUES
        (7369,'SMITH','CLERK',7902,'1980-12-17',800,NULL,20);
INSERT INTO EMP VALUES
        (7499,'ALLEN','SALESMAN',7698,'1981-02-20',1600,300,30);
INSERT INTO EMP VALUES
        (7521,'WARD','1981-02-22',1250,500,30);
INSERT INTO EMP VALUES
        (7566,'JONES','MANAGER',7839,'1981-04-02',2975,20);
INSERT INTO EMP VALUES
        (7654,'MARTIN','1981-09-28',1400,30);
INSERT INTO EMP VALUES
        (7698,'BLAKE','1981-03-12',2850,30);
INSERT INTO EMP VALUES
        (7782,'CLARK','1981-06-09',2450,10);
INSERT INTO EMP VALUES
        (7788,'SCOTT','ANALYST',7566,'1982-12-09',3000,20);
INSERT INTO EMP VALUES
        (7839,'KING','PRESIDENT','1981-11-17',5000,10);
INSERT INTO EMP VALUES
        (7844,'TURNER','1981-09-08',1500,30);
INSERT INTO EMP VALUES
        (7876,'ADAMS',7788,'1983-01-12',1100,20);
INSERT INTO EMP VALUES
        (7900,'JAMES','1981-12-03',950,30);
INSERT INTO EMP VALUES
        (7902,'FORD',20);
INSERT INTO EMP VALUES
        (7934,'MILLER',7782,'1982-01-23',1300,10);

CREATE TABLE DEPT
       (DEPTNO INT,DNAME VARCHAR(14),LOC VARCHAR(13) );

INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK');
INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
INSERT INTO DEPT VALUES (30,'SALES','CHICAGO');
INSERT INTO DEPT VALUES (40,'OPERATIONS','BOSTON');

CREATE TABLE BONUS
        (ENAME VARCHAR(10),JOB   VARCHAR(9),SAL   DOUBLE(13,COMM  INT);

CREATE TABLE SALGRADE
        (GRADE INT,LOSAL INT,HISAL INT);

INSERT INTO SALGRADE VALUES (1,700,1200);
INSERT INTO SALGRADE VALUES (2,1201,1400);
INSERT INTO SALGRADE VALUES (3,1401,2000);
INSERT INTO SALGRADE VALUES (4,2001,3000);
INSERT INTO SALGRADE VALUES (5,3001,9999);

CREATE TABLE DUMMY
        (DUMMY INT);

INSERT INTO DUMMY VALUES (0);

COMMIT;

以上内容由PHP站长网【52php.cn】收集整理供大家参考研究

如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读