2012-04-15 64 views
0

我写我的网上学生成绩项目,该项目将计算成绩,要求平均成绩点和累积性等级point.the输出为:设计的网上学生成绩结果

Name: Shakira Abdullahi 
Adm.No: 096784657  
Department: Information Technology 
Semester: 1st semester 
Level: 200 

Course title      Course code Course unit score  Grade 
Computer programming II   Csc 201  3    45  D 
Introduction to file procesing  Csc 204  2    57  C 
Introduction to the internet  Int 201  3    34  F 
Linear algebra II     Mth 205  2    60  B 
Real Analysis I     Mth 207  3    76  A 
Numeric Analysis     Mth 209  2    42  E 
Nigerian people and culture  Gst 201  2    80  A 

Units this session:17 
Units to date:35 
G.P this session:47 
G.P.A last session:3.43 
G.P.A to date:2.87 
Remarks: To repeat Int 201 

Examination grading 
Score(%) grade Grade points  
70-100  A  5 
60-69   B  4 
50-59   C  3 
45-49   D  2 
40-44   E  1 
0-39   F  0 

说明:

  • Units this session:总课程单位此会话
  • Units to date:累积每个会话单元的向上到这个会话
  • G.P this session:总和(各场(等级点x单位))
  • G.P to date:累积每个会话G.P的向上此会话
  • G.P.A last session:平均G.P最后会话
  • G.P.A to date:平均G.P最新。
  • level:我们有多达4级:100,200,300和400

而且什么是用户有权访问结果之前需要有: 名称,Adm.No,部门,学期和会议。 会议以2010-2011年为形式。

那么请你好,我该怎么做这个项目?我的问题是:

  • 我可以为此保留一个表吗?
  • 我该如何处理查询?
+4

你的问题[s]对于我们的QA格式来说太广泛了。你应该限制你的帖子每个帖子一个问题。另外,请知道人们不会为你写你的项目......你必须证明你已经尝试过了...... – Lix 2012-04-15 14:31:10

+4

为什么不启动该项目,何时/如果遇到问题,请在此处发布所有详细信息,其中包括您尝试过的内容的代码示例。 – Lix 2012-04-15 14:31:49

回答

4

我会建议创建一个数据库与不同的表链接到学生的主表。

这是表的结构我想创建:

  • 学生
  • 课程
  • 分数
  • 分级

在每个这些我将创建所需的列。

学生表

在学生表中创建一个列如下:

  • ID(初级,INT,11,自动增量)
  • 名称(VARCHAR,256)
  • AdmNo(INT,11)
  • Department(Varchar,256)
  • 学期(可能是与对应的值的ID或一个VARCHAR具有256个字符的最大值)
  • 电平(INT,11)
  • SessionUnits(INT,11)
  • DateUnits(INT,11)
  • ThisGP (INT,11)
  • LastGPA(浮点型)
  • TDGPA(浮点型)
  • 备注(VARCHAR,256)

门课程

  • ID(主,INT,11,自动增量)
  • 名称(VARCHAR,256)
  • CourseCode(VARCHAR,256)

比分

  • ID(Primary,INT,11,autoincrement)
  • StudentID(ID,11)
  • CourseID(ID,11)
  • 分数(ID,11)
  • CourseUnit(ID,11)
  • 级(VARCHAR,256)

分级

  • ScoreMinPercent(INT,11)
  • ScoreMaxPercent(INT 11)
  • 级(VARCHAR,256)
  • GradePoints(INT 11)

与包括将和值的SQL如下:

CREATE TABLE IF NOT EXISTS `student` (
    `ID` int(11) NOT NULL AUTO_INCREMENT, 
    `Name` varchar(256) NOT NULL, 
    `AdmNo` int(11) NOT NULL, 
    `Department` varchar(256) NOT NULL, 
    `Semester` varchar(256) NOT NULL, 
    `Level` int(11) NOT NULL, 
    `SessionUnits` int(11) NOT NULL, 
    `DateUnits` int(11) NOT NULL, 
    `ThisGP` int(11) NOT NULL, 
    `LastGPA` float NOT NULL, 
    `TDGPA` float NOT NULL, 
    `Remarks` varchar(256) NOT NULL, 
    PRIMARY KEY (`ID`) 
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; 

INSERT INTO `student` (`ID`, `Name`, `AdmNo`, `Department`, `Semester`, `Level`, `SessionUnits`, `DateUnits`, `ThisGP`, `LastGPA`, `TDGPA`, `Remarks`) VALUES 
(1, 'Shakira Abdullahi', 96784657, 'Information Technology', '1st semester', 200, 17, 35, 47, 3.43, 2.87, 'To repeat Int 201'); 

CREATE TABLE IF NOT EXISTS `courses` (
    `ID` int(11) NOT NULL DEFAULT '0', 
    `Name` varchar(256) NOT NULL, 
    `CourseCode` varchar(256) NOT NULL, 
    PRIMARY KEY (`ID`) 
) ENGINE=InnoDB DEFAULT CHARSET=latin1; 

INSERT INTO `courses` (`ID`, `Name`, `CourseCode`) VALUES 
(1, 'Computer programming II', 'Csc 201'), 
(2, 'Introduction to file procesing', 'Csc 204'), 
(3, 'Introduction to the internet', 'Int 201'), 
(4, 'Linear algebra II', 'Mth 205'), 
(5, 'Real Analysis I', 'Mth 207'), 
(6, 'Numeric Analysis', 'Mth 209'), 
(7, 'Nigerian people and culture', 'Gst 201'); 

CREATE TABLE IF NOT EXISTS `scores` (
    `ID` int(11) NOT NULL AUTO_INCREMENT, 
    `StudentID` int(11) NOT NULL, 
    `CourseID` int(11) NOT NULL, 
    `Score` int(11) NOT NULL, 
    `CourseUnit` int(11) NOT NULL, 
    `Grade` varchar(256) NOT NULL, 
    PRIMARY KEY (`ID`) 
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; 

INSERT INTO `scores` (`ID`, `StudentID`, `CourseID`, `Score`, `CourseUnit`, `Grade`) VALUES 
(1, 1, 1, 45, 3, 'D'), 
(2, 1, 2, 57, 2, 'C'), 
(3, 1, 3, 34, 3, 'F'), 
(4, 1, 4, 60, 2, 'B'), 
(5, 1, 5, 76, 3, 'A'), 
(6, 1, 6, 42, 2, 'E'), 
(7, 1, 7, 80, 2, 'A'); 

CREATE TABLE IF NOT EXISTS `grading` (
    `ScoreMinPercent` int(11) NOT NULL AUTO_INCREMENT, 
    `ScoreMaxPercent` int(11) NOT NULL, 
    `Grade` varchar(256) NOT NULL, 
    `GradePoints` int(11) NOT NULL, 
    PRIMARY KEY (`ScoreMinPercent`) 
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=77 ; 

INSERT INTO `grading` (`ScoreMinPercent`, `ScoreMaxPercent`, `Grade`, `GradePoints`) VALUES 
(40, 44, 'E', 1), 
(45, 49, 'D', 2), 
(50, 59, 'C', 3), 
(60, 69, 'B', 4), 
(70, 100, 'A', 5), 
(71, 39, 'F', 0); 
+0

谢谢你给了我一个见解。 – 2012-04-15 15:27:33

+0

如果这可以帮助你投票并接受它,谢谢 – James 2012-04-15 15:31:09

+0

对我来说这个工作+1 ...只是一个问题:你是甘地吗? – worenga 2012-04-15 17:04:54