Student Database Management

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 23

Contents

Page No.
1. Introduction 1
2. Software Requirements Specification 2
3. System Design 5
Data Flow Diagram 5
ER Diagram 7
4. Detailed Design 9
5. Normalization 10
6. Relational Schema 11
7. Front End Design 13
8. The Interface (screen shots) 14
9. Reports 18
10. Data Validation 23
11. Conclusion 24
12. Bibliography 25
INRODUCTION
This Student Database has been designed taking into account the practical needs to
manage a Students’ data. Moreover, it provides security at product level as well as user
level. Its design concentrates on 2 types of users:
1. Administrator
2. Students

This Database follows a typical event flow seen in such a system. The database
mainly is from the student point of view. Since the student is the center of the system, all
the various records in the database revolve around the student activities. Some of the
other independent categories of data include the library facility, fest, sports, cultural
activities & alumni association.
All such information helps one and all to know about the progress achieved by the
institution. Every student can be given special attention by knowing his performance in
the database. And if the organization is capable to put it on a LAN then it still adds more
flexibility for the organization staff.

DATA STORAGE:
 Student Profile: Student Details, Address, Admission Details, Dependent Details.
 Attendance Details: Total no of classes, No of classes attended by student for each
subject.
 Internal & Examination Information: Takes Data for each of the 3 internals &
Exam Details.
 Supports Data Management for finding:
 Student in each Department by URN.
 Internal Average Marks Scored.
 Attendance Shortage.
 Exam Result.

MANIPULATION OF DATABASE:
 Addition of Student Profile.
 Addition of Department Details & its Corresponding Subjects.
 Modify or Delete Student Profile.
 Modify Attendance and Examination Results.

REPORT GENERATION:
 List of Students’ in each Department.
 List of Attendance for each Student Department-wise.
 List of Examination Status for each Student Department-wise.

So with respect to this we have taken up a small work here, wherein we have
developed a database for Students’ Attendance & Examination Database that can hold the
Institute in good stead.
Software Requirement Specification

Purpose:

Our Database is a store house of information regarding the various Student & the
various attributes encapsulated in it. To maintain such a huge list of diverse data, the
Institution cannot afford to maintain paper-work, as it is time consuming and has more
chances to data loss and integrity loss. The huge amount of data can be made easily
maintainable and accessible, by the use of computers. Commercial RDBMS like Oracle
can ease the process of such an automation.

Our Database Management project aims to provide computerized interface to all the
data to be manipulated and stored, using Oracle and Visual Basic. The application
provides for,

1. Retrieval of any data based on particular criteria


2. Storage of data, and its maintenance in a consistent manner
3. Generation of customized reports based on particular criteria
4. Easy to use, interface with menus and forms, for clearer navigability

The application also does the necessary data validation, so that redundant or, unnecessary duplicate
data are prevented from creeping into the database. It also traps most of the common data entry errors.

The Application differentiates between 2 types of users. One category is of Students who just want to
get information about their individual details for attendance & Examination information. The
administrative user is another category, who is authorized to add, delete and modify the database content.
He can add New Department, corresponding Subjects. He can also enter Student info, simultaneously.

Software products used:

The following are the software that will be used in completing the project:
 ORACLE 8 (personal edition): As a back end to store the data. Oracle is
chosen since it is robust and simple to use.
 Visual Basic 6.0: As the front end to create user friendly window
interface. Visual basic provides comprehensive features that help in
designing in detail.
The Overall High level Description:

Product Functions:

The following is a summary of the functions that the system is expected to


perform:

 Provide separate access to individual Student and administrator such that only the
administrator has the right to add, delete and modify the various services offered by
the system.
 Provide the administrator with options to add as many Students, Departments,
corresponding Subjects as required.
 The administrator must be provided with rights to modify the Student data store..
 Provision to generate reports and make queries in any desired manner.

User Characteristics:
Any person with basic computer skills can make use of the product. The user
should have only been briefed about the functionality of the system before he can start
using the system.

Assumptions and Dependencies:

Apportioning of requirements:
The designers intend to upgrade the system to a LAN enabled multi user system
besides providing connectivity to the internet for regular automatic updation of the data
stored in the system.

Specific Requirements:
Functions:

 The basic services that the Student Database System include


 Entry of New Students’ to the Department
 Entry of Attendance Information
 Entry of Examination Marks
 Provide individual and Department-wise reports.
 Update the student profile depending on Attendance & Exam
Status.

 The system shall provide for password protected administrator access to


add, delete & modify the basic services offered by the system.
 The system shall provide for storing of Student personal details along
with his Attendance & Examination marks.
 Reports:
 Individual Student report : Includes personal details of members.
 Department-wise report: Lists all the employees currently active
 User Interface & Security:
 Menu based Interface
 Floating Pop-up menu
 Customized Background Picture
 File based Encrypted Password Handling

Performance Specification:
The system is designed to be a stand alone, single user system. It is proposed to
make the system multi user and network enabled in the future. The system is hence fast
and efficient in terms of data retrieval. 95% of the transactions are completed within 2
seconds while the others may take approximately 5 seconds.
(Above values vary from system to system.)
SYSTEM DESIGN

Data Flow Diagram

The data flow diagram shows the flow of data between different processes
in the system.

A DFD provides a simple and intuitive method for describing processes


without focusing on the details of computer systems. With the DFD in hand it becomes
easier to identify the entities in the system and allows us to get a clear picture of how the
system is supposed to work. DFD also helps in avoiding man pitfalls which might have
not been recognized otherwise. Thus a DFD is a necessary part of the system design
process.

The various notations used in the DFD and their corresponding meanings
are given below.

Notation Meaning

Entity

Process

Data Flow

Data Store
Data Flow Diagram

View Info of all


individual aspects

Student

View Report of all


individual aspects

Add
Dept., Corresponding
Subjects details

Member DBase
Administrator

Modify

Member DBase

Delete

Member DBase

Perform Updation
for various Statistics
Entity Relationship Diagram
E-R diagram identifies the different entities in the process and also the inter
relationship between them. It is an intuitive way of knowing the system and its
dependencies in a better way.

The E-R diagram is a high level conceptual data model. It describes the basic
framework of the system .It helps in discarding entities which are not related at all and
also helps in reducing coupling and in building a robust model.

The notations used and their meanings are given below

Notations Meaning

Entity

Weak Entity

Relationship

Identifying Relationship

Attribute

Key Attribute

Multi valued


` Composite Attribute
Derived Attribute
Detailed Design
ER-to-Relational Mapping

ER-to-Relational Mapping focuses on designing a relational database schema


based on a conceptual schema design. The algorithm that can map an ER schema into the
corresponding relational database schema is as follows:

Step 1 : For each strong entity type E in the ER model, create a relation R, that includes
all simple attributes of E and also the simple components of a composite attribute.
Choose one of the key attributes of E as the primary key for R

Step 2 : For each weak entity type W, in the ER model with owner entity type E, create a
relation R, that includes all simple attributes and simple components of composite
attributes of W. In addition, include as a foreign key in R, the primary key attributes of
the owner entity type.

Step 3 : For each 1:1 relationship, identify relations S and T that correspond to the entity
types participating in the relationship. Choose one of the relations and include as foreign
key in that, the primary key of the other. Ideally, we should choose the entity type that
has a total participation, for this role.

Step 4 : For each 1:N relationship, identify the relation S that represents the entity type
on the N side of the relationship. Include in S, a foreign key, that represents the primary
key of the other participating entity.

Step 5 : For each M:N relationship, create a new relation that represents the relationship.
Include as foreign keys, the primary keys of the participating entities. Also include the
simple attributes of the relationship as attributes of the relation created.

Step 6 : For each multi valued attribute A, create a new relation R, which includes an
attribute corresponding to A and primary key K, as a foreign key of the parent relation,
in which the attribute A was found.

Step 7 : For each n-ary relationship, (n > 2), create a new relation T, to represent the
relationship. Include, in T, as foreign keys, the primary keys of all the n participating
entity types.
NORMALIZATION OF TABLES
Normalization is the process of refining the data model by entity relationship model. The
normalization technique, logically groups the data over a number of tables, which are independent and
contain no unnecessary data. It can be looked on as a process during which unsatisfactory schemas are
decomposed by breaking up their attributes into smaller relation schemas that possess desirable properties.

Need For Normalization:


Normalization of tables is done in order to achieve the desirable properties of
minimizing redundancy and minimizing the insertion, deletion, and update anomalies.

1st Normal Form:


A relation schema is said to be in 1 st Normal Form of tables in the domain if each
attribute of the relation are atomic. In our data model, all attributes are of atomic nature
or are indivisible.

2nd Normal Form:


A relation schema ‘R’ is said to be in 2 nd Normal Form if it is in the 1 st Normal
Form and if all non-prime attributes are fully functionally dependant on the relation
Key(s). This normal form is based on the concept or transitive dependency. A functional
dependency X->Y in a relation schema R is a transitive dependency if three is a set of
attributes Z that is not a subset of any key or R and both X->Z and Z->Y hold. Here, all
tables have primary keys and all other attributes are dependent on it.

3rd Normal Form:


A relational schema is in 3 rd Normal Form if it is in 2 nd Normal Form and no non-
prime attributes are fully functionally dependent on other non-prime attributes. Our data
model satisfies the 3rd Normal Form too, since it is already in 2 nd Normal Form and there
are no functionally dependent non-prime attributes.

Following the above mentioned steps on the ER-model, described


previously, we get the following schema for our application.
Relational Schema

Student Profile

URN fname lname DOB Sex Date of Admission

Student Address

URN Door No Street City State Country PIN Ph No

Department

Dcode Name HOD Name

Semester

URN SEM

Subject

Scode Sname Instructor No of Classes Dcode

Other tables are:


Dept_Student -> consists of student detail w.r.t Department.
Subject_Internal -> consists of marks specification for subjects w.r.t Internals.
Subject_Exam -> consists of marks specification for subjects w.r.t Main Exam.
Subject_Total -> consists of marks specification for subjects w.r.t Internals + Exam
Subject_Attendance -> consists of attendance specification for subjects per semester.
Attendance -> consists of attendance obtained for each student for every subject.
First_Internal, Second_Internal, Third_Internal -> Marks obtained for each 1st,2nd, 3rd
internals.
Exam_Marks, Total_Marks -> represents marks for Main Exam and total ie, including
internal marks for each student, for every subject.
Table Descriptions:
With respect to the schemas drawn above, the following are the descriptions of
some of the tables created in ORACLE

desc student_profile
Name Null? Type
------------------------------- -------- ----
FNAME NOT NULL VARCHAR2(20)
LNAME NOT NULL VARCHAR2(20)
URN NOT NULL VARCHAR2(10)
DOB NOT NULL DATE
SEX NOT NULL VARCHAR2(1)
YR_OF_AD NOT NULL NUMBER(4)
DEPENDENT_NAME NOT NULL VARCHAR2(30)
RELATION NOT NULL VARCHAR2(10)
desc semester
Name Null? Type
------------------------------- -------- ----
URN NOT NULL VARCHAR2(10)
SEM NOT NULL NUMBER(1)

desc subject
Name Null? Type
------------------------------- -------- ----
SNAME NOT NULL VARCHAR2(20)
SCODE NOT NULL VARCHAR2(6)
NO_OF_HR NOT NULL NUMBER(2)
INSTRUCTOR VARCHAR2(40)
COURSE_CODE NOT NULL VARCHAR2(5)

desc depart
Name Null? Type
------------------------------- -------- ----
DEPT_NAME NOT NULL VARCHAR2(40)
COURSE_CODE NOT NULL VARCHAR2(5)
HOD_NAME NOT NULL VARCHAR2(30)
FRONT END DESIGN

The application derives its front end interface from Visual Basic
Framework 6.0. Visual Basic is a Microsoft framework, originally based on the simple
MS Basic language. It has built in control features, for forms and Common controls like
buttons, text boxes, labels, etc. The framework also has MS ActiveX libraries, which
perform the needed interaction with the Oracle Database server and provides a
convenient way of communicating with the Database, and remotely executing queries and
commands, through a User Data Source Name (DSN). Microsoft ActiveX data objects
and Record set libraries are made use of, in our application. The objects have facilities to
start and rollback a transaction on Error, catch a Run-time exception thrown by the
Oracle driver.

We have adopted a menu driven interface, that provides easy navigability,


b/w various forms in the application. The privileged sections need authentication before
the user can enter and modify the database. All forms have stringent data validation, for
the data entered into the forms. Invalid data won’t be accepted and suitable messages are
displayed, for the user to know and correct his mistakes. Critical database transactions are
monitored for errors, and rolled back if an exception occurs. All updations are handled
carefully, so that no anomalies creep in, during data entry.

The results of various queries can be obtained as a hard copy, through


reports generated by the queries. Reports have been developed using MS data reports and
Data Environment forms. They allow both static reports and dynamic reports to be
generated easily. The query for a static report can be specified before execution, whereas
dynamic reports require proper parameters to be passed to the data environment
command, before the report form is loaded.
SOURCE CODE

//Learnprogramo-programming made simple


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <conio.h>
#include <iomanip>

using namespace std;


int main()
{
FILE *fp, *ft;
char another, choice;

struct student
{
char first_name[50], last_name[50];
char course[100];
int section;
};

struct student e;
char xfirst_name[50], xlast_name[50];
long int recsize;

fp=fopen("users.txt","rb+");

if (fp == NULL)
{
fp = fopen("users.txt","wb+");

if (fp==NULL)
{
puts("Cannot open file");
return 0;
}
}

recsize = sizeof(e);

while(1)
{
system("cls");

cout << "\t\t====== STUDENT DATABASE MANAGEMENT SYSTEM


======";
cout <<"\n\n ";
cout << "\n\n";
cout << "\n \t\t\t 1. Add Records";
cout << "\n \t\t\t 2. List Records";
cout << "\n \t\t\t 3. Modify Records";
cout << "\n \t\t\t 4. Delete Records";
cout << "\n \t\t\t 5. Exit Program";
cout << "\n\n";
cout << "\t\t\t Select Your Choice :=> ";
fflush(stdin);
choice = getche();
switch(choice)
{
case '1' :
fseek(fp,0,SEEK_END);
another ='Y';
while(another == 'Y' || another == 'y')
{
system("cls");
cout << "Enter the Firt Name : ";
cin >> e.first_name;
cout << "Enter the Last Name : ";
cin >> e.last_name;
cout << "Enter the Course : ";
cin >> e.course;
cout << "Enter the Section : ";
cin >> e.section;
fwrite(&e,recsize,1,fp);
cout << "\n Add Another Record (Y/N) ";
fflush(stdin);
another = getchar();
}
break;
case '2':
system("cls");
rewind(fp);
cout << "=== View the Records in the Database ===";
cout << "\n";
while (fread(&e,recsize,1,fp) == 1)
{
cout << "\n";
cout <<"\n" << e.first_name << setw(10) << e.last_name;
cout << "\n";
cout <<"\n" <<e.course << setw(8) << e.section;
}
cout << "\n\n";
system("pause");
break;

case '3' :
system("cls");
another = 'Y';
while (another == 'Y'|| another == 'y')
{
cout << "\n Enter the last name of the student : ";
cin >> xlast_name;

rewind(fp);
while (fread(&e,recsize,1,fp) == 1)
{
if (strcmp(e.last_name,xlast_name) == 0)
{
cout << "Enter new the Firt Name : ";
cin >> e.first_name;
cout << "Enter new the Last Name : ";
cin >> e.last_name;
cout << "Enter new the Course : ";
cin >> e.course;
cout << "Enter new the Section : ";
cin >> e.section;
fseek(fp, - recsize, SEEK_CUR);
fwrite(&e,recsize,1,fp);
break;
}
else
cout<<"record not found";
}
cout << "\n Modify Another Record (Y/N) ";
fflush(stdin);
another = getchar();
}
break;

case '4':
system("cls");
another = 'Y';
while (another == 'Y'|| another == 'y')
{
cout << "\n Enter the last name of the student to delete : ";
cin >> xlast_name;

ft = fopen("temp.dat", "wb");

rewind(fp);
while (fread (&e, recsize,1,fp) == 1)

if (strcmp(e.last_name,xlast_name) != 0)
{
fwrite(&e,recsize,1,ft);
}
fclose(fp);
fclose(ft);
remove("users.txt");
rename("temp.dat","users.txt");

fp=fopen("users.txt","rb+");

cout << "\n Delete Another Record (Y/N) ";


fflush(stdin);
another = getchar();
}

break;

case '5':
fclose(fp);
cout << "\n\n";
cout << "\t\t THANK YOU FOR USING THIS SOFTWARE";
cout << "\n\n";
exit(0);
}
}

system("pause");
return 0;
}
OUTPUT
DATA VALIDATION

Data validation, is a very important part in any application involving a database. We have to be
aware of the specifications of the database organization and also about the kind of data that goes into the
database. We have to provide for stringent error checking, in order to discard invalid data and prevent it
from getting it into the database.

Data validation can be done in two places. While creating the database schema,
we can specify certain integrity constraints that have to be maintained b/w various
relations in the schema. This ensures that no insertion, deletion and update anomalies
creep in during operation. Data validation can also be done at the interface itself, to
provide more robust level of data validation. For example, in the logn form only
students’ whose URN has been established by the administrator will be given login
permission. This can be trapped at the interface level itself. And in the form, to modify
the Student Profile, the administrator is allowed to modify only if that URN has been
shown in the combo box.

Some Examples of Data Validation done in this project are:

 Invalid URN cannot be entered.


 Invalid Address, such as door no, etc (advance > balance or negative) cannot be
entered.
HARDWARE REQUIREMENTS

PROCESSOR : Intel Pentium 4 or more


RAM : 1 GB or more
MONITOR : 15” COLOR
HARD DISK : 40 GB hard disk recommended
KEYBOARD : STANDARD 102 KEYS

SOFTWARE REQUIREMENTS

OPERATING SYSTEM : Windows 7 Ultimate ABOVE


FRONT-END : C++
LANGUAGE : C++
CONCLUSION
This project enables a Student Attendance & Examination Sytem to function in an
organized manner. It takes care of all the requirements and provides and aids the
administrator of the institution to effectively carry out transactions and easy access to
student details. The Administrator can easily Update and Modify the system depending
on the requirements.

The project also takes care of essential data-validation and helps in keeping the
database free from junk entries. It can be used solely by students’ to view their data and
get the report..
We feel that this project can be expanded to work over the internet or also a local
area network involving many clients and one central administrator who can effectively
communicate with every student.
BIBLIOGRAPHY

1. Elmasri and Navathe, Fundamentals of Database Systems.


2. Oracle & Visual Basic Handbook -SSI Press
3. Oracle 8i – The Complete reference
4. MSDN April 2000

You might also like