11-DML数据库的sql语句

 

 

create table dept( deptno int primary key auto_increment,dname varchar(14) , loc varchar(13)  ) ; 
create table emp(
 empno int primary key auto_increment,
 ename varchar(10),
job varchar(9), 
 mgr int,
  hiredate date,
  sal int,
  comm int,
  deptno int not null,
  foreign key (deptno) references dept(deptno) );


insert into dept values(10,'财务部','北京'); insert into dept values(20,'研发部','上海'); insert into dept values(30,'销售部','广州'); insert into dept values(40,'行政部','深圳'); insert into emp values(7369,'刘一','职员',7902,'1980-12-17',800,null,20); insert into emp values(7499,'陈二','推销员',7698,'1981-02-20',1600,300,30); insert into emp values(7521,'张三','推销员',7698,'1981-02-22',1250,500,30); insert into emp values(7566,'李四','经理',7839,'1981-04-02',2975,null,20); insert into emp values(7654,'王五','推销员',7698,'1981-09-28',1250,1400,30); insert into emp values(7698,'赵六','经理',7839,'1981-05-01',2850,null,30); insert into emp values(7782,'孙七','经理',7839,'1981-06-09',2450,null,10); insert into emp values(7788,'周八','分析师',7566,'1987-06-13',3000,null,20); insert into emp values(7839,'吴九','总裁',null,'1981-11-17',5000,null,10); insert into emp values(7844,'郑十','推销员',7698,'1981-09-08',1500,0,30); insert into emp values(7876,'郭十一','职员',7788,'1987-06-13',1100,null,20); insert into emp values(7900,'钱多多','职员',7698,'1981-12-03',950,null,30); insert into emp values(7902,'大锦鲤','分析师',7566,'1981-12-03',3000,null,20); insert into emp values(7934,'木有钱','职员',7782,'1983-01-23',1300,null,10);

 

 

 

 

posted @ 2019-05-08 10:48  lilixia  阅读(289)  评论(0编辑  收藏  举报