我是靠谱客的博主 感动萝莉,最近开发中收集的这篇文章主要介绍创建表emp,dept,sal;,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

创建表emp,dept,sal;

创建表
create table emp
(
empno number(4) not null primary key,
ename varchar2(10) not null,
job varchar2(9) not null,
leader number(4),
hiredate date not null,
sal number(7,2) not null,
bonus number(7,2),
deptno number(2) not null
);

drop table emp;
drop table dept;
drop table sal;

create table dept
(
deptno number(2) not null primary key,
dname varchar2(14) not null,
loc Varchar2(20) not null
);

create table sal
(
levelno number(2) not null primary key,
salmin number(6) not null,
salmax number(6) not null
);

插入
insert into emp
values('7369','smith','clerk',7902,to_date('19801217','YYYYMMDD'),800,null,20);
insert into emp
values('7499','allen','salesman',7698,to_date('19810220','YYYYMMDD'),1600,300,30);
insert into emp
values('7521','ward','salesman',7698,to_date('19810222','YYYYMMDD'),1250,500,30);
insert into emp
values('7566','jones','manager',7839,to_date('19810402','YYYYMMDD'),2975,null,20);
insert into emp
values('7654','martin','salesman',7698,to_date('19810928','YYYYMMDD'),1250,1400,30);
insert into emp
values('7698','blake','manager',7839,to_date('19810501','YYYYMMDD'),2850,null,30);
insert into emp
values('7782','clerk','manager',7839,to_date('19810609','YYYYMMDD'),2450,null,10);
insert into emp
values('7839','king','president',null,to_date('19811117','YYYYMMDD'),5000,null,10);
insert into emp
values('7844','turner','salesman',7698,to_date('19810908','YYYYMMDD'),1500,0,30);
insert into emp
values('7900','james','clerk',7698,to_date('19811203','YYYYMMDD'),950,null,30);
insert into emp
values('7902','ford','analyst',7566,to_date('19811203','YYYYMMDD'),3000,null,20);
insert into emp
values('7934','smith','clerk',7782,to_date('19810123','YYYYMMDD'),1300,null,10);


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');

insert into sal
values(1,700,1200);
insert into sal
values(2,1201,1400);
insert into sal
values(3,1401,2000);
insert into sal
values(4,2001,3000);
insert into sal
values(5,3001,9999);

查询
select *
from emp;

select *
from dept;

select *
from sal;

最后

以上就是感动萝莉为你收集整理的创建表emp,dept,sal;的全部内容,希望文章能够帮你解决创建表emp,dept,sal;所遇到的程序开发问题。

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

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

评论列表共有 0 条评论

立即
投稿
返回
顶部