我是靠谱客的博主 内向山水,最近开发中收集的这篇文章主要介绍数据库练习经典表‘dept’+‘emp’的sql语句,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

数据库练习经典表‘dept’+‘emp’的sql语句

 1 create table emp (
 2     empno numeric(4) not null,
 3     ename varchar(10),
 4     job varchar(9),
 5     mgr numeric(4),
 6     hiredate datetime,
 7     sal numeric(7, 2),
 8     comm numeric(7, 2),
 9     deptno numeric(2)
10 );
11 
12 insert into emp values (7369, 'SMITH', 'CLERK', 7902, '1980-12-17', 800, null, 20);
13 insert into emp values (7499, 'ALLEN', 'SALESMAN', 7698, '1981-02-20', 1600, 300, 30);
14 insert into emp values (7521, 'WARD', 'SALESMAN', 7698, '1981-02-22', 1250, 500, 30);
15 insert into emp values (7566, 'JONES', 'MANAGER', 7839, '1981-04-02', 2975, null, 20);
16 insert into emp values (7654, 'MARTIN', 'SALESMAN', 7698, '1981-09-28', 1250, 1400, 30);
17 insert into emp values (7698, 'BLAKE', 'MANAGER', 7839, '1981-05-01', 2850, null, 30);
18 insert into emp values (7782, 'CLARK', 'MANAGER', 7839, '1981-06-09', 2450, null, 10);
19 insert into emp values (7788, 'SCOTT', 'ANALYST', 7566, '1982-12-09', 3000, null, 20);
20 insert into emp values (7839, 'KING', 'PRESIDENT', null, '1981-11-17', 5000, null, 10);
21 insert into emp values (7844, 'TURNER', 'SALESMAN', 7698, '1981-09-08', 1500, 0, 30);
22 insert into emp values (7876, 'ADAMS', 'CLERK', 7788, '1983-01-12', 1100, null, 20);
23 insert into emp values (7900, 'JAMES', 'CLERK', 7698, '1981-12-03', 950, null, 30);
24 insert into emp values (7902, 'FORD', 'ANALYST', 7566, '1981-12-03', 3000, null, 20);
25 insert into emp values (7934, 'MILLER', 'CLERK', 7782, '1982-01-23', 1300, null, 10);
26 
27 create table dept (
28     deptno numeric(2),
29     dname varchar(14),
30     loc varchar(13)
31 );
32 
33 insert into dept values (10, 'ACCOUNTING', 'NEW YORK');
34 insert into dept values (20, 'RESEARCH', 'DALLAS');
35 insert into dept values (30, 'SALES', 'CHICAGO');
36 insert into dept values (40, 'OPERATIONS', 'BOSTON');
37 
38 create table bonus (
39     empno numeric(4),
40     job varchar(9),
41     sal numeric,
42     comm numeric
43 );
44 
45 create table salgrade (
46     grade numeric,
47     losal numeric,
48     hisal numeric
49 );
50 
51 insert into salgrade values (1, 700, 1200);
52 insert into salgrade values (2, 1201, 1400);
53 insert into salgrade values (3, 1401, 2000);
54 insert into salgrade values (4, 2001, 3000);
55 insert into salgrade values (5, 3001, 9999);

 

转载于:https://www.cnblogs.com/stitchZsx/p/10143937.html

最后

以上就是内向山水为你收集整理的数据库练习经典表‘dept’+‘emp’的sql语句的全部内容,希望文章能够帮你解决数据库练习经典表‘dept’+‘emp’的sql语句所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(38)

评论列表共有 0 条评论

立即
投稿
返回
顶部