1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| #楼盘表 create table building ( build_id int primary key, build_name VARCHAR(50)); #业务员表 create table salesman ( salesman_id int primary key, salesman_name VARCHAR(50)); #销售业绩表 create table sales_performance( month_id int, salesman_id int, build_id int, sale int); #工资表 create table salary( month_id int, salesman_id int, salary int); #成本核算表 create table cost_accounting( month_id int, build_id int, salary_cost int); #插入测试数据 插入5个楼盘的数据 Insert into building values(1,"build1"); Insert into building values(2,"build2"); Insert into building values(3,"build3"); Insert into building values(4,"build4"); Insert into building values(5,"build5"); #插入业务人员数据 insert into salesman values(1,'zhangsan'); insert into salesman values(2,'lisi'); #插入业务员的工资 insert into salary values(202007,1,5000); insert into salary values(20200,2,5000); #楼盘销售 insert into sales_performance values(202007,1,1,0); insert into sales_performance values(202007,1,2,0); insert into sales_performance values(202007,1,3,0); insert into sales_performance values(202007,1,4,0); insert into sales_performance values(202007,1,5,0); insert into sales_performance values(202007,2,1,2); insert into sales_performance values(202007,2,2,3); insert into sales_performance values(202007,2,3,0); insert into sales_performance values(202007,2,4,0); insert into sales_performance values(202007,2,5,0);
|