Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

COLLEGE NAME

(Affiliated to Tribhuvan University)

College Logo

Report Title

Submitted by: Submitted to:

Submitted Date
Report Title

Submitted as pre-requirement for the partial fulfillment of Bachelor of


Business Administration ______ Semester ____________.

Submitted by

Submitted to

Date
Acknowledgment
Table of Contents
1. Introduction .................................................................................................................. 1
1.1 Background ................................................................................................................ 1
1.2 Objectives .............................................................................................................. 1
2. Database Design and Development .............................................................................. 1
2.1 Database Design ......................................................................................................... 1
2.1.1 ER Diagram of Student Result Management System .............................................. 2
2.1.1.1 Cardinality Mapping ........................................................................................ 3
2.1.1.2 Individual Entity Relationship ......................................................................... 4
2.1.2 Schema Design ............................................................................................... 5
2.2 Database Development .......................................................................................... 6
2.2.1 Entity and Attribute Creation (DDL) .................................................................. 6
2.2.2 Anomalies and Normalization ........................................................................... 11
2.2.3 Integrity Constraint Management ...................................................................... 11
3. Data Testing ............................................................................................................... 12
3.1 Entry record in each table......................................................................................... 12
3.2 Updating, Deletion and Selection ........................................................................ 16
3.2.1 Updating Query ............................................................................................ 16
3.2.2 Deletion ........................................................................................................ 17
4. SQL ............................................................................................................................ 19
4.1 Simple Queries ......................................................................................................... 19
4.2 Subqueries ........................................................................................................... 20
4.3 Join ...................................................................................................................... 21
5. Conclusion and Knowledge Gained ........................................................................... 22
1. Introduction

1.1 Background
In our education system, the success rate of teaching and learning phenomenon is based on
the progress report of the student. The educational institution should keep the record of its
student. For preparing the progress report of students and to keep their records, large
amount of data is required. These data should be stored in effective way so that they are
easily accessible and easy to manipulate. Therefore, student result management system has
been introduced to manage the information about the student, subjects offered by
educational institution in every level, marks obtained by student in every subject, records
of the exams and finally prepare the progress report of the student. Student result
management system is an effective way to automate the manual result system.

1.2 Objectives
o To manage the details of student, course, exam, progress and result.
o To reduce the manual work of managing the result information.
o To provide the information searching facilities based on various factors.
o Like: result, progress, exam, etc.
o To improve editing, adding and updating of records with proper
management of data.
o To integrate the record of all exam.

2. Database Design and Development


2.1 Database Design
Student result management system deals with design that manages the information about
the records of students, subjects offered by educational institution in every level, marks
obtained by student in every subject, records of the exams and finally prepare the progress
report of the student. ER diagram is used to design this system.

1 of 22
2.1.1 ER Diagram of Student Result Management System
dept_id
dept_member Department
dept_name

offers
conduct
enrolls
c_code
c_name

course exam_id
reg_no credits
name

std_id exam name exam


dob
student
gender
Divided
address into
contact
Held_in

Assign has
ed to

semester

GPA result
sem_num

grade
year
sub_id
sem_name
c_code

marks std_id

2 of 22
2.1.1.1 Cardinality Mapping

In our ER-Diagram, following types of mapping cardinalities are shown:

a) One-to-One
An entity in A is associated with at most one entity in B and vice-versa. This is
called one to one relationship. In our ER diagram, we have following one to one
relationship:
• One student is assigned to one semester.
• One course is divided into one semester.

b) One-to-many
An entity in A is associated with any number of B and an entity in B is associated
with at most one entity from set A. This is one-to-many relationship. In our ER
diagram we have following one-to-many relationships.
• One department enrolls many students.
• One department offers many course.
• One department conduct many exams.
• One exam have many results.

3 of 22
2.1.1.2 Individual Entity Relationship

enrolls
Department student

student assign-to semester

Department offers course

course Divided_
semester
into

Department conduct exam

semester held exam

exam has result

4 of 22
2.1.2 Schema Design

department offers course

Dept_id c_code c_code


Dept_name dept_id c_name
Dept_member credits

enrolls assign_to divided_into

dept_id std_id c_code


std_id sem_number sem_number

conducts held_in has

dept_id sub_id exam_id


exam_id c_code std_id

student exam

reg_no exam name


std_id exam_id

semester
result
5 of 22
sub_id
c_code
year
std_id
2.2 Database Development
We have design our system by using ER diagram. Now the development of the student
result management system is done by using SQL.

2.2.1 Entity and Attribute Creation (DDL)


Data Definition Language (DDL) is a SQL statement that can be used either interactively
or within the programming language source code to define database and their
components. Create, alter, rename, truncate and drop are the DDL command. We have
following DDL command to create the database and tables for our system:

--Department
create table Department
(
dept_id integer,
dept_name varchar(30),
dept_member integer,
constraint PK_Department primary key(dept_id)
);

--student
create table student
(
reg_no integer,
std_id integer,
name varchar(30),
DOB date,
Gender char(6),
contact bigint,
add_code int,
constraint student_fk foreign key (add_code) references address(add_code),
constraint PK_student primary key(std_id)
);

6 of 22
--address
create table address(
add_code int,
zone varchar(10),
district varchar(10),
city varchar(10),
street_name varchar(10),
ward int,
constraint address_pk primary key (add_code)
);

--course
create table course
(
c_code integer,
c_name varchar(20),
credits integer,
constraint PK_course primary key(c_code)
);

--exam
create table exam
(
exam_id integer,
exam_name varchar(30),
constraint PK_exam primary key(exam_id)
);

7 of 22
--semester
create table semester
(
c_code int,
sem_number integer,
cyear bigint,
sem_name varchar(30),
constraint PK_semester primary key(sem_number),
constraint semester_FK foreign key(c_code) references course (c_code)
);

--result
create table result
(
std_id int,
c_code int,
GPA numeric,
Letter_grade char(2),
marks integer,
constraint PK_result primary key(std_id),
constraint result_FK foreign key(std_id) references student(std_id),
);
alter table result add foreign key(c_code) references course(c_code) on delete cascade;

--Relation table
--offer
create table offer
(
c_code int,
dept_id int,
constraint offer_FK foreign key(c_code) references course(c_code)
);
alter table offer add foreign key(dept_id) references Department(dept_id)
on delete cascade;

8 of 22
--Relation table
--enrolls
create table enrolls
(
dept_id int,
std_id int,
constraint enrolls_FK foreign key(dept_id) references department(dept_id),
);
alter table enrolls add foreign key(std_id) references student(std_id)
on delete cascade;

--Relation table
--assign_to
create table assign_to
(
std_id int,
sem_number int,
constraint assign_to_FK foreign key(std_id) references student(std_id)
);
alter table assign_to add foreign key(sem_number) references semester(sem_number)
on delete cascade;

--Relation table
--conducts
create table conducts
(
dept_id int,
exam_id int,
constraint conducts_FK foreign key(dept_id) references department(dept_id),
);
alter table conducts add foreign key(exam_id) references exam(exam_id)
on delete cascade;

9 of 22
--Relation table
--held_in
create table held_in
(
sub_id int,
c_code int,
constraint held_in_FK foreign key(sub_id) references course(c_code),
);
alter table held_in add foreign key(c_code) references course(c_code)
on delete cascade;

--Relation table
--has
create table has
(
exam_id int,
std_id int,
constraint has_FK foreign key(exam_id) references exam(exam_id)
);
alter table has add foreign key(std_id) references student(std_id)
on delete cascade;

--Relation table
--divided_into
create table divided_into
(
c_code int,
sem_number int,
constraint divided_into_FK foreign key(c_code) references course(C_code)
);
alter table divided_into add foreign key(sem_number) references semester(sem_number)
on delete cascade;

10 of 22
2.2.2 Anomalies and Normalization
Anomalies are problems that can occurred in poorly planned, un-normalized database
where all the data stored in one table. There are especially three types of anomaly.

• Insertion anomaly: It is the inability to add the data in the database.


• Deletion anomaly: Some information is loss due to the deletion of other values.
• Update anomaly: It can be occurred during the time of recording the data in one
table causes partial update or redundant.

Normalization is a process of organizing the data in database to avoid data redundancy,


insertion anomaly, update anomaly and deletion anomaly. It maintains consistency in the
database. It is used in a database management system specifically with relational database
to decrease redundant information and to minimize the data anomalies.

2.2.3 Integrity Constraint Management


Integrity constraint ensures the changes made to the database by the authorized user
due to the loss of database. It guard against the accidental damage to the database. It
includes the domain, referential, assertion integrity. They can be not null, unique, primary
key, foreign key (referential constraint). Example:

--semester
create table semester
(
c_code int,
sem_number integer,
cyear bigint,
sem_name varchar(30),
constraint PK_semester primary key(sem_number),
constraint semester_FK foreign key(c_code) references course (c_code)
);

11 of 22
3. Data Testing
Data testing is necessary step in database system development. Here the ACID property
validation, data mapping and data integrity are tested. But first we insert the data in every
tables in database system using insert command which is DML statement. After that we
use update, delete and select command in those data and analyze the result or the output.

3.1 Entry record in each table.


--Inserting values in department table
insert into department values(1,'adminstration dept',2);
insert into department values(2,'staff dept',50);
insert into department values(3,'IT dept',1);
insert into department values(4,'account dept',10);
insert into department values(5,'result dept',10);

--inserting values into address table


insert into address values(901,'seti','kailali','tikapur','ektatool',10);
insert into address values(902,'seti','kailali','Dhangadhi','kalikatool',1);
insert into address values(903,'bagmati','kathmandu','tinkune','sahyogtool',7);
insert into address values(904,'bagmati','bhaktapur','lokantali','gandhitool',9);
insert into address values(905,'seti','kailali','lamki','gairegau',4);

--inserting values into student table


insert into student values(173501,100,'ramesh pandey','2054-7-
12','male',9800124563,901);
insert into student values(173502,101,'omprakash uphadhayay','2054-5-
12','male',9812124563,902);
insert into student values(173503,102,'rosy dahal','2055-7-22','female',9840124563,903);
insert into student values(173504,103,'sanjay pahadi','2054-11-
10','male',9811124563,904);
insert into student values(173505,104,'samir joshi','2055-1-2','male',9844124563,905);

12 of 22
--inserting values into course table
insert into course values(301,'dbms',48);
insert into course values(201,'microeconomics',48);
insert into course values(218,'dsa',48);
insert into course values(219,'web-ii',48);
insert into course values(202,'cost accounting',48);
insert into course values(101,'dLd',48);
insert into course values(102,'cis',48);
insert into course values(103,'co',48);
insert into course values(104,'dccn',48);

--inserting values into exam table


insert into exam values(1000,'theory');
insert into exam values(1001,'theory');
insert into exam values(1002,'practical');
insert into exam values(1003,'theory');
insert into exam values(1004,'practical');

--inserting values into result table


insert into result values(100,301,3.5,'A',350);
insert into result values(101,219,3.4,'B',330);
insert into result values(102,218,3.2,'B',310);
insert into result values(103,201,2.9,'B',250);
insert into result values(104,202,3.6,'A',360);

--inserting values into semester table


insert into semester values(301,1,2,'fourth');
insert into semester values(201,2,1,'second');
insert into semester values(202,3,2,'fifth');
insert into semester values(218,5,2,'eight');
insert into semester values(101,6,2,'sixth');
insert into semester values(102,7,2,'first');
insert into semester values(103,8,2,'third');

13 of 22
--inserting values into enrolls table
insert into enrolls values(1,100);
insert into enrolls values(1,101);
insert into enrolls values(1,102);
insert into enrolls values(2,103);
insert into enrolls values(2,104);

--inserting values into assign_to table


insert into assign_to values(100,2);
insert into assign_to values(101,3);
insert into assign_to values(102,7);
insert into assign_to values(103,5);
insert into assign_to values(104,6);

--inserting into offer table


insert into offer values(101,1);
insert into offer values(102,1);
insert into offer values(103,1);
insert into offer values(104,2);
insert into offer values(101,2);

--inserting values into conducts table


insert into conducts values(1,1000);
insert into conducts values(1,1001);
insert into conducts values(1,1002);
insert into conducts values(2,1003);
insert into conducts values(2,1004);

--inserting values into held_in table


insert into held_in values(101,101);
insert into held_in values(101,201);
insert into held_in values(101,218);
insert into held_in values(301,101);
insert into held_in values(301,219);

14 of 22
--inserting values into has table
insert into has values(1000,100);
insert into has values(1001,101);
insert into has values(1002,102);
insert into has values(1003,103);
insert into has values(1004,104);

--inserting values into divided_into table


insert into divided_into values(201,2);
insert into divided_into values(218,3);
insert into divided_into values(219,5);
insert into divided_into values(102,6);
insert into divided_into values(101,7);
insert into divided_into values(103,8);

15 of 22
3.2 Updating, Deletion and Selection
3.2.1 Updating Query

a) Change the name of staff department to Human Resource Department

Ans: update department set dept_name='Human Resource Department' where


dept_id=2;

Before Updating

After Updating

16 of 22
3.2.2 Deletion

a) Delete the record of the course whose c_code=201 from divided_into


table.
Ans: delete from divided_into where c_code=201

Before Deletion

After Deletion

17 of 22
3.2.3 Selection Table
Selecting all the records from the tables of our database system.
a) Select * from department

b) Select * from student

c) Select * from course

18 of 22
4. SQL

4.1 Simple Queries

a) Display all the records of the student having std_id=5.


Ans: select * from student where std_id=5;
Output:

b) Display the name of male student in descending order by their name.


Ans: select * from student where gender=’male’ order by name desc;
Output:

c) Display the average credit hours from the course table.


Ans: select avg(credits) as total_credit_hour from course;
Output:

d) Display the department name whose member is greater than 10.


Ans: select dept_name from department where dept_member > 10.
Output:

19 of 22
4.2 Subqueries
a) Display the detail of course where the student has secured highest marks in
their exam.
Ans: select course.* from course, result where course.c_code=result.c_code and
marks=(select max(marks) from result);
Output:

b) Display the detail of student securing lowest marks.


Ans: select student.* from student, result where student.std_id=result.std_id and
marks=(select min(marks) from result);

Output:

c) Display the name of student securing highest GPA.


Ans: select name, GPA from student,result where student.std_id=result.std_id and
GPA = (select max(GPA) from result);

Output:

20 of 22
4.3 Join

a) Inner Join
Ans: select name, zone from student inner join address on
student.add_code=address.add_code;
Output:

b) Left Join
Ans: select name, district from student left join address on
student.add_code=address.add_code;
Output:

c) Right Join
Ans: select name, city from student left join address on
student.add_code=address.add_code;
Output:

21 of 22
5. Conclusion and Knowledge Gained

We have learned that student result management system is the effective automation of
manual result publication system. It provides easy interface to record the details of student,
courses, marks, exam and the progress report. Result of all the internal exams are
integrated. For generating final reports of a student large amount of data is required. They
should be stored in such a way that they are easily accessible and easy to manipulate the
data. And this system facilitate convenient storing and defining the information and also
maintain the security of the data.

This is a computerized examinations results management system for tertiary student’s


examination records. The main aim of the project is to provide the examination result to
the student in a simple and accurate way. Student result management system not only
stores and manages the data. But it even helps to generate the accurate and flexible result
by using various function and command. We got the knowledge about the importance of
integrity and how it can be maintained in our management system with the help of
database management system.

With the help of student result management system, the publication of result, comparing
the efficiency of student, rewarding the deserving student, measure to increase the
efficiency of other students and other developmental decisions can be easily made. This
application will greatly simplify and speed up the result preparation and management
process.

22 of 22

You might also like