![課程設(shè)計(jì)---學(xué)生成績管理系統(tǒng)_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/24/8897db43-b18e-44f3-b244-07066336a380/8897db43-b18e-44f3-b244-07066336a3801.gif)
![課程設(shè)計(jì)---學(xué)生成績管理系統(tǒng)_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/24/8897db43-b18e-44f3-b244-07066336a380/8897db43-b18e-44f3-b244-07066336a3802.gif)
![課程設(shè)計(jì)---學(xué)生成績管理系統(tǒng)_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/24/8897db43-b18e-44f3-b244-07066336a380/8897db43-b18e-44f3-b244-07066336a3803.gif)
![課程設(shè)計(jì)---學(xué)生成績管理系統(tǒng)_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/24/8897db43-b18e-44f3-b244-07066336a380/8897db43-b18e-44f3-b244-07066336a3804.gif)
![課程設(shè)計(jì)---學(xué)生成績管理系統(tǒng)_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/24/8897db43-b18e-44f3-b244-07066336a380/8897db43-b18e-44f3-b244-07066336a3805.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、 數(shù)據(jù)庫課程設(shè)計(jì)課 題 學(xué)生成績管理系統(tǒng) 班 級 姓 名 指導(dǎo)教師 目錄一、需求分析2二、數(shù)據(jù)庫設(shè)計(jì)3.概念數(shù)據(jù)庫設(shè)計(jì)321確定聯(lián)系集及圖32.1.2學(xué)生成績管理系統(tǒng)的總圖4邏輯數(shù)據(jù)庫設(shè)計(jì)5.班級信息表t_class5.課程表t_course5.學(xué)生信息表t_student5.教師表t_teacher5.成績表t_grade5三、創(chuàng)建表空間6四、在表空間中創(chuàng)建表和序列及數(shù)據(jù)插入64.1、班級表64.2 、課程表64.3、學(xué)生表74.4、教師表84.5、成績表8五、索引和完整性9六、 查詢和視圖96.1 查詢96.2 視圖10七、存儲過程的使用10八、用戶和權(quán)限11九、 部分實(shí)現(xiàn)過程13一、需求
2、分析功能簡介:要求實(shí)現(xiàn)學(xué)生信息管理、 教師信息管理、 班級信息管理、 選課信息管理等功能,包括學(xué)生信息的添加、修改、刪除及查詢;課程信息的添加、修改、刪除及查詢; 選課信息的查詢等。要求完成以下工作:1、數(shù)據(jù)庫設(shè)計(jì)1)概念結(jié)構(gòu)設(shè)計(jì):在需求分析和總體功能設(shè)計(jì)的基礎(chǔ)上,設(shè)計(jì)E-R模型,詳細(xì)描述實(shí)體的屬性和實(shí)體之間的聯(lián)系。2)邏輯結(jié)構(gòu)設(shè)計(jì):實(shí)現(xiàn) E-R圖向關(guān)系模型的轉(zhuǎn)換,詳細(xì)列表顯示完整的數(shù)據(jù)庫表結(jié)構(gòu)。2、創(chuàng)建表空間3、 在表空間中創(chuàng)建表在 SQL*PLUS環(huán)境中輸入 PL/SQL代碼,創(chuàng)建數(shù)據(jù)庫中的各個表,至少包括學(xué)生信息表、班級信息表、選課表、教師表等5張表(自行設(shè)計(jì)用到的表,注意表中字段的設(shè)置
3、及類型);向表中插入數(shù)據(jù),每張表至少插入10條數(shù)據(jù),數(shù)據(jù)要合理。4、索引和完整性在表上建立相應(yīng)索引。實(shí)現(xiàn)列、行及參照完整性(必須建立主鍵、外鍵、檢查約束等)。5、 數(shù)據(jù)查詢和視圖使用 SELECT語句實(shí)現(xiàn)學(xué)生信息、班級信息和成績信息的查詢(要求查詢要和系統(tǒng)的功能聯(lián)系起來,做單條件的查詢、組合條件的查詢、多表查詢等,至少完成10個查詢)。創(chuàng)建視圖查詢某學(xué)期某班級學(xué)生的成績信息。6、存儲過程的使用創(chuàng)建存儲過程實(shí)現(xiàn)表中數(shù)據(jù)的修改和刪除。創(chuàng)建存儲過程給學(xué)生提分,提分的學(xué)生號和課程號由調(diào)用該過程的實(shí)參給定, 把提分后的學(xué)生成績更新到數(shù)據(jù)庫。7、用戶、角色創(chuàng)建用戶并授權(quán), 將其賦予某個角色成為其成員。不同
4、的用戶授予不同的權(quán)限, 管理員的權(quán)限最高, 可以對各種信息進(jìn)行修改刪除等操作。 普通學(xué)生用戶只能進(jìn)行查詢操作。8、系統(tǒng)數(shù)據(jù)維護(hù)導(dǎo)出系統(tǒng)數(shù)據(jù)導(dǎo)入14二、數(shù)據(jù)庫設(shè)計(jì).概念數(shù)據(jù)庫設(shè)計(jì)21確定聯(lián)系集及圖根據(jù)前面對系統(tǒng)進(jìn)行的分析,已經(jīng)初步了解了學(xué)生成績管理系統(tǒng)的數(shù)據(jù)處理流程,找出與系統(tǒng)有關(guān)的各個實(shí)體及其相互聯(lián)系如下:1.實(shí)體集:學(xué)生,老師,班級,課程,成績。2.聯(lián)系集:學(xué)生和班級:一個班由多個學(xué)生組成,一個學(xué)生只能歸屬于某個班; 存在“歸屬”的關(guān)系:N:1學(xué)生和課程:一個學(xué)生可以選修多門課程,一門課程提供給多個學(xué)生選修; 存在“選修”的關(guān)系:N:M教師和班級:一個班只有一個老師擔(dān)任班主任,一個老師只能擔(dān)
5、任一個班的班主任; 存在“歸屬”的關(guān)系:1:1教師和課程:一個老師只能教一門課,一門課程可以有多個老師來教; 存在“授課”的關(guān)系:N:13.屬性集:班級(班級編號,班主任,班級人數(shù))課程(課程編號,課程名稱,任課教師,學(xué)分)學(xué)生(學(xué)生編號,學(xué)生姓名,學(xué)生所在班級,學(xué)生性別,學(xué)生所在院系)老師(老師編號,老師名稱,老師性別)成績(學(xué)生編號,課程編號,分?jǐn)?shù))2.1.2學(xué)生成績管理系統(tǒng)的總圖老師編號老師姓名學(xué)分課程號1N性別課程名授課老師課程N(yùn) 學(xué)號 1課程號管理選修成績分?jǐn)?shù)1MN班級編號系別歸屬1班級學(xué)生班級人數(shù)學(xué)號性別姓名圖2-2-學(xué)生成績管理系統(tǒng)總E-R圖邏輯數(shù)據(jù)庫設(shè)計(jì).班級信息表t_clas
6、s序號字段名稱類型(范圍)約束主外鍵備注1班級編號classnochar(5)Pk2班主任tnochar(5)FkT_teacher.tno3班級人數(shù)classnumintNot null.課程表t_course序號字段名稱類型(范圍)約束主外鍵備注1課程編號coursenochar(5)Pk2課程名稱coursenameVarchar(20)Not null3任課教師tnochar(5)FkT_teacher.tno4學(xué)分creditintNot null.學(xué)生信息表t_student序號字段名稱類型(范圍)約束主外鍵備注1學(xué)生編號snochar(5)Pk2學(xué)生姓名snameVarchar(
7、8)Not null3學(xué)生所在班級classnochar(5)FkT_class.classno4學(xué)生性別ssexchar(2)Not null5學(xué)生所在院系deptVarchar(20)Not null.教師表t_teacher序號字段名稱類型(范圍)約束主外鍵備注1教師編號tnochar(5)Pk2教師名稱tnameVarchar(8)Not null3教師性別tsexchar(2)Not null.成績表t_grade序號字段名稱類型(范圍)約束主外鍵備注1學(xué)生編號snochar(5)Pk/fkT_student.sno2課程編號coursenochar(5)Pk/fkT_course.
8、courseno3分?jǐn)?shù)markintNot null三、創(chuàng)建表空間create tablespace student datafile 'E:student.dbf'size 10Mautoextend on next 10Mmaxsize 1000M四、在表空間中創(chuàng)建表和序列及數(shù)據(jù)插入4.1、班級表create table t_class( classno char(5) primary key, tno char(5) constraint FK_teacher_tno references t_teacher(tno), classnum int not null) ta
9、blespace studentcreate sequence seq_class_classno increment by 1 start with 1000 maxvalue 99999; -創(chuàng)建序列insert into t_class values(seq_class_classno.nextval,1000,43);insert into t_class values(seq_class_classno.nextval,1001,40);insert into t_class values(seq_class_classno.nextval,1002,41);insert into
10、t_class values(seq_class_classno.nextval,1003,39);insert into t_class values(seq_class_classno.nextval,1004,45);insert into t_class values(seq_class_classno.nextval,1005,43);insert into t_class values(seq_class_classno.nextval,1006,48);insert into t_class values(seq_class_classno.nextval,1006,45);in
11、sert into t_class values(seq_class_classno.nextval,1007,41);insert into t_class values(seq_class_classno.nextval,1008,40);4.2 、課程表create table t_course( -創(chuàng)建表 courseno char(5) primary key, coursname varchar(20) not null, tno char(5) constraint FK_class_tno references t_teacher(tno), credit int not nu
12、ll) tablespace studentcreate sequence seq_course_courseno increment by 1 start with 1000 maxvalue 99999 -創(chuàng)建序列insert into t_course values(seq_course_courseno.nextval,'計(jì)算機(jī)英語',1000,3); -插入數(shù)據(jù)insert into t_course values(seq_course_courseno.nextval,'數(shù)據(jù)庫',1001,3);insert into t_course values
13、(seq_course_courseno.nextval,'高數(shù)',1002,2);insert into t_course values(seq_course_courseno.nextval,'大學(xué)物理',1003,4);insert into t_course values(seq_course_courseno.nextval,'線性代數(shù)',1004,1);insert into t_course values(seq_course_courseno.nextval,'軟件工程',1005,5);insert into t
14、_course values(seq_course_courseno.nextval,'操作系統(tǒng)',1006,2);insert into t_course values(seq_course_courseno.nextval,'計(jì)算機(jī)組成原理',1007,3);insert into t_course values(seq_course_courseno.nextval,'微機(jī)',1008,5);insert into t_course values(seq_course_courseno.nextval,'體育',1009,2
15、);4.3、學(xué)生表create table t_student( sno char(5) primary key, sname varchar(8) not null, classno char(5) constraint FK_class_classno references t_class(classno), ssex char(2) not null constraint ck_student_ssex check (ssex in('男','女'), dept varchar(20) not null ) tablespace studentcreate
16、 sequence seq_student_sno increment by 1 start with 1000 maxvalue 99999insert into t_student values(seq_student_sno.nextval,'張飛',1000,'男','計(jì)算機(jī)系');insert into t_student values(seq_student_sno.nextval,'張宇',1001,'男','機(jī)械系');insert into t_student values(seq
17、_student_sno.nextval,'張飛宇',1002,'男','計(jì)算機(jī)系');insert into t_student values(seq_student_sno.nextval,'孫燕姿',1003,'女','人文科學(xué)學(xué)院');insert into t_student values(seq_student_sno.nextval,'張杰',1004,'男','計(jì)算機(jī)系');insert into t_student values(se
18、q_student_sno.nextval,'林青霞',1005,'女','外語系');insert into t_student values(seq_student_sno.nextval,'李靜',1006,'女','計(jì)算機(jī)系');insert into t_student values(seq_student_sno.nextval,'寧靜',1007,'女','經(jīng)管系');insert into t_student values(seq_st
19、udent_sno.nextval,'舒淇',1008,'女','計(jì)算機(jī)系');insert into t_student values(seq_student_sno.nextval,'劉曉慶',1009,'女','計(jì)算機(jī)系');4.4、教師表create table t_teacher( -創(chuàng)建表 tno char(5) primary key, tname varchar(8) not null, tsex char(2) not null constraint ck_teacher_tsex
20、 check (tsex in('男','女')create sequence seq_teacher_tno increment by 1 start with 1000 maxvalue 9999 -創(chuàng)建序列insert into t_teacher values(seq_teacher_tno.nextval,'君','男'); insert into t_teacher values(seq_teacher_tno.nextval,'辰','男');insert into t_teacher
21、 values(seq_teacher_tno.nextval,'仟','女');insert into t_teacher values(seq_teacher_tno.nextval,'王和君','男');insert into t_teacher values(seq_teacher_tno.nextval,'張飛宇','男');insert into t_teacher values(seq_teacher_tno.nextval,'何炅','男');inse
22、rt into t_teacher values(seq_teacher_tno.nextval,'謝娜','女');insert into t_teacher values(seq_teacher_tno.nextval,'汪涵','男');insert into t_teacher values(seq_teacher_tno.nextval,'張韶涵','女');insert into t_teacher values(seq_teacher_tno.nextval,'李詠',
23、'男')insert into t_teacher values(seq_teacher_tno.nextval,'李詠','男')4.5、成績表create table t_grade( -創(chuàng)建 sno char(5) constraint FK_student_sno references t_student(sno), courseno char(5) constraint FK_course_courseno references t_course(courseno), mark int not null) tablespace stud
24、entinsert into t_grade values(1000,1001,66);insert into t_grade values(1001,1001,69);insert into t_grade values(1002,1003,55);insert into t_grade values(1002,1004,99);insert into t_grade values(1009,1001,100);insert into t_grade values(1004,1004,76);insert into t_grade values(1008,1008,00);insert in
25、to t_grade values(1003,1005,93);insert into t_grade values(1001,1007,87);insert into t_grade values(1005,1002,81);insert into t_grade values(1007,1001,44);五、索引和完整性在表上建立相應(yīng)索引。create index iclass on t_class(tno) create index icourseno on t_course(coursname)create index istudent on t_student(sname)creat
26、e index iteacher on t_teacher(tname)create index igrade on t_grade(mark)6、 查詢和視圖6.1 查詢-1查詢1001班的班級的學(xué)生信息 select * from t_student where classno=1001 -2查詢院系是計(jì)算機(jī)系的并且是男生的學(xué)生信息 select * from t_student where dept='計(jì)算機(jī)系' and ssex='男'-3查詢學(xué)生姓名為張飛宇的所選課程及分?jǐn)?shù)select s.sno,sname,ssex,courseno,mark fr
27、om t_student s,t_grade g where s.sno=g.sno and s.sname='張飛宇'-4查詢平均成績大于60分的學(xué)生的信息select s.* from t_student s where sno in(select sno from t_grade group by sno having avg(mark)>60) -5查詢學(xué)生編號為1002的所選課程的老師的信息select t.* from t_teacher t,t_course c,t_grade g where c.courseno=g.courseno and c.tno=
28、t.tno and g.sno=1002-6查詢課程數(shù)據(jù)庫的最高分的學(xué)生成績的信息select s.* from t_student s,t_grade g where s.sno=g.sno and mark=(select max(mark) from t_grade where courseno in(select courseno from t_course where coursname='數(shù)據(jù)庫') group by courseno)-7查詢課程高數(shù)的平均成績select courseno,avg(mark) from t_grade where courseno
29、 in(select courseno from t_course where coursname='高數(shù)') group by courseno-8查詢高數(shù)分?jǐn)?shù)大于60的同學(xué)的總?cè)藬?shù)(select count(distinct sno) 總?cè)藬?shù) from t_grade where courseno in(select courseno from t_course where coursname='高數(shù)') and mark>60)-9查詢1001班班主任所教課程的學(xué)分select coursname,credit from t_course c,t_class a where c.tno=a.tno and a.classno=1001-10查詢選修了課程高數(shù)的學(xué)生信息select c.coursname,s.* from t_student s,t_course c,t_grade g where s.sno=g
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度北京平面設(shè)計(jì)專員崗位勞動合同規(guī)范
- 二零二五年度智能辦公文件消毒與消毒劑供應(yīng)合同
- 2025年度辦公室移動空調(diào)租賃及智能化節(jié)能服務(wù)合同樣本
- 行業(yè)領(lǐng)先物流配送方案
- 企業(yè)借給個人借款合同
- 建設(shè)工程施工合同專用條款
- 委托平面設(shè)計(jì)合同
- 農(nóng)業(yè)生產(chǎn)資源循環(huán)利用方案
- 招投標(biāo)與合同管理試卷A
- 產(chǎn)品研發(fā)合同協(xié)議書
- 2025年上半年重慶三峽融資擔(dān)保集團(tuán)股份限公司招聘6人高頻重點(diǎn)提升(共500題)附帶答案詳解
- 安全閥拆除與回裝方案
- 文獻(xiàn)檢索教案
- 八年級上冊英語閱讀還原50題-含答案
- 網(wǎng)優(yōu)案例匯總
- 倉庫每日檢查記錄表倉庫每日檢查內(nèi)容及每日巡查事項(xiàng)
- 早產(chǎn)兒視網(wǎng)膜病變
- 矮小癥診治指南
- GB 10665-1997碳化鈣(電石)
- 《克雷洛夫寓言》專項(xiàng)測試題附答案
- 《中小學(xué)教育懲戒規(guī)則》重點(diǎn)內(nèi)容學(xué)習(xí)PPT課件(帶內(nèi)容)
評論
0/150
提交評論