资源描述:
《数据库课程设计源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.usekjq111007307/*创建一个部门信息表包含“部门号,部门名,部门经理,人数”属性列*/createtabledepartment(depart_nochar(2)primarykey,depart_namechar(30)notnull,depart_managechar(6)notnull,depart_peopleintnotnull)/*创建一个职位信息表包含“职位,基本薪资,福利,失业保险,住房公积金”属性列*/createtableposition(poschar(30)primarykey,basesalaryfloatnotnull,benefits
2、floatnotnull,insurancesfloatnotnull,housing_fundsfloatnotnull)/*创建一个职工信息表包含"职工号,职工名,性别,年龄,学历,部门号,职位"属性列*/createtablestaff_message(staff_nochar(4)primarykey,staff_namechar(10)notnull,staff_sexchar(2)check(staff_sexin('男','女')),staff_ageintnotnull,staff_educhar(10)notnull,staff_depchar(2)notnul
3、l,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_absentintnotnull,workoverdaysintnotnull,primarykey
4、(staff_no,month_date))/*创建一个薪资表包含“职工号,年月,奖金,罚金,真实薪资”属性列*/createtablesalary(staff_nochar(4),month_datechar(6),addsalaryfloatnotnull,subsalaryfloatnotnull,relsalaryfloatnotnull,primarykey(staff_no,month_date))createindexsalary_indexonsalary(month_dateasc,staff_noasc);/*部门表信息的录入*//*经理室*/..insert
5、intodepartmentvalues('01','manage_department','王栋','1');/*财务科*/insertintodepartmentvalues('02','financial_department','张鹏','3');/*技术科*/insertintodepartmentvalues('03','plan_department','代淑英','5');/*销售科*/insertintodepartmentvalues('04','market_department','金加容','6');/*职位表信息的录入*//*经理*/insertint
6、opositionvalues('manager','4500','1125','-45','-36');/*副经理*/insertintopositionvalues('assistant_manager','4000','1000','-40','-32');/*办事*/insertintopositionvalues('clerk','3500','875','-35','-28');/*助理*/insertintopositionvalues('assistant','2000','500','-20','-16');/*职工信息表信息的录入*/insertintosta
7、ff_messagevalues('0101','王栋','男','38','硕士','01','manager');insertintostaff_messagevalues('0201','张鹏','男','35','硕士','02','manager');insertintostaff_messagevalues('0202','程雷','男','30','本科','02','clerk');insertintostaff_messagevalues('0203','王晶晶