资源描述:
《数据库课程设计源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、usekjq111007307/*创建一个部门信息表包含“部门号,部门名,部门经理,人数”属性列*/createtabledepartment(depart_nochar(2)primarykey,depart_namechar(30)notnull,depart_managechar(6)notnull,depart_peopleintnotnull)/*创建一个职位信息表包含“职位,基本薪资,福利,失业保险,住房公积金”属性列*/createtableposition(poschar(30)primarykey,basesalaryfloatnotn
2、ull,benefitsfloatnotnull,insurancesfloatnotnull,housing_fundsfloatnotnull)/*创建一个职工信息表包含"职工号,职工名,性别,年龄,学历,部门号,职位"属性列*/createtablestaff_message(staff_nochar(4)primarykey,staff_namechar(10)notnull,staff_sexchar(2)check(staff_sexin('男','女')),staff_ageintnotnull,staff_educhar(10)notnu
3、ll,staff_depchar(2)notnull,staff_jobchar(30)notnull,foreignkey(staff_dep)referencesdepartment(depart_no),foreignkey(staff_job)referencesposition(pos))/*创建一个员工考勤表包含“职工号,年月,迟到,缺勤,加班”属性列*/createtablestaff_days(staff_nochar(4),month_datechar(6),staff_lateintnotnull,staff_absentintnot
4、null,workoverdaysintnotnull,primarykey(staff_no,month_date))/*创建一个薪资表包含“职工号,年月,奖金,罚金,真实薪资”属性列*/createtablesalary(staff_nochar(4),month_datechar(6),addsalaryfloatnotnull,subsalaryfloatnotnull,relsalaryfloatnotnull,primarykey(staff_no,month_date))createindexsalary_indexonsalary(mon
5、th_dateasc,staff_noasc);/*部门表信息的录入*//*经理室*/insertintodepartmentvalues('01','manage_department','王栋','1');/*财务科*/insertintodepartmentvalues('02','financial_department','张鹏','3');/*技术科*/insertintodepartmentvalues('03','plan_department','代淑英','5');/*销售科*/insertintodepartmentvalues('
6、04','market_department','金加容','6');/*职位表信息的录入*//*经理*/insertintopositionvalues('manager','4500','1125','-45','-36');/*副经理*/insertintopositionvalues('assistant_manager','4000','1000','-40','-32');/*办事*/insertintopositionvalues('clerk','3500','875','-35','-28');/*助理*/insertintoposit
7、ionvalues('assistant','2000','500','-20','-16');/*职工信息表信息的录入*/insertintostaff_messagevalues('0101','王栋','男','38','硕士','01','manager');insertintostaff_messagevalues('0201','张鹏','男','35','硕士','02','manager');insertintostaff_messagevalues('0202','程雷','男','30','本科','02','clerk');inse
8、rtintostaff_messagevalues('0203','王晶晶','