Top Banner
ATTENDANCE MANAGEMENT SYSTEM 1| Page ATTENDANCE MANAGEMENT SYSTEM The mini project report submitted in partial fulfillment Of the requirements for the award of B.Tech Degree IN COMPUTER SCIENCE AND ENGINEERING By S.M.N.PRANATHI 690752090 SHAIK ABDUL SHAJAHAN BASHA 690752093 P.JANAKI RAMI REDDY 690752082 T.SANKAR 690752102 Under the esteemed guidance of Ms.A.Kavitha Asst.Professor Department of C.S.E DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ANIL NEERUKONDA INSTITUTE OF TECHNOLOGY & SCIENCES SANGIVASALA, VISAKHAPATNAM – 530003 2010-2011
55
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

1 | P a g e

ATTENDANCE MANAGEMENT SYSTEMThe mini project report submitted in partial fulfillment Of the requirements for the award of B.Tech Degree

IN COMPUTER SCIENCE AND ENGINEERING

By

S.M.N.PRANATHI 690752090SHAIK ABDUL SHAJAHAN BASHA 690752093 P.JANAKI RAMI REDDY 690752082T.SANKAR 690752102

Under the esteemed guidance of Ms.A.KavithaAsst.Professor

Department of C.S.E

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERINGANIL NEERUKONDA INSTITUTE OF TECHNOLOGY & SCIENCES

SANGIVASALA, VISAKHAPATNAM – 5300032010-2011

Page 2: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

2 | P a g e

CERTIFICATE

This is to certify that it is a bona-fide record of work entitled “Attendance Management

Systems” done by S.A.SHAJAHAN BASHA(690752093) in the partial fulfillment of the requirements

for the award of degree of MINI PROJECT IN COMPUTER SCIENCE AND TECHNOLOGY in

Anil Neerukonda Institute of Technology & Sciences , Visakhapatnam for the year 2010 - 2011.

PROJECT GUIDE HEAD OF DEPARTMENT

(Ms.A.Kavitha) (Dr. S. C. Satapathy)

Page 3: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

3 | P a g e

ACKNOWLEDGEMENT

Apart from the efforts made by us, the success of our project depends largely on the encouragement and

guidelines of many others. I take this opportunity to express my gratitude to the people who have been

instrumental in the successful completion of this project.

We thank Ms.A.Kavitha, Asst. Professor, Department of CSE, ANITS who is our internal guide and

whose constant support and supervision made our project successful.

We would also like to thank Mr.Y.V.Srinivasa Murthy, Asst Professor, Department of CSE,ANITS for

extending his support.

We also take the privilege to thank the Head of our Department, Mr. Suresh Chandra Satapathy, for

permitting us in laying the first stone for success. We would also like to thank the other staff in our

department and lab assistants who directly or indirectly helped us in successful completion of the project.

We also thank our friends and college staff who extended their part of support in the successful

completion of the project.

S.M.N.PRANATHI 690752090 SHAIK ABDUL SHAJAHAN BASHA 690752093 P.JANAKI RAMI REDDY 690752082T.SANKAR 690752102

Page 4: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

4 | P a g e

INDEX

1. ABSTRACT 5

2. SYSTEM REQUIREMENT SPECIFICATION 6

2.1 INTRODUCTION 72.2 FUNCTIONAL REQUIREMENTS 72.3 NON FUNCTIONAL REQUIREMENTS 82.4 HARDWARE REQUIREMENT SPECIFICATION 82.5 SOFTWARE REQUIREMENT SPECIFICATION 8

3. CONCEPTUAL SCHEMA DESIGN 9

3.1 ENTITY RELATIONSHIP MODEL 103.2 IDENTIFICATION OF ENTITIES 143.3 IDENTIFICATION OF RELATIONS 173.4 COMPLETE E-R DIAGRAM 20

4. LOGICAL SCHEMA GENERATION 21

4.1 REPRESENTATION OF ENTITIES INTO TABLES 22

5. RELATIONAL SCHEMA DESIGN 24

5.1 ORACLE 255.2 CODE GENERATED FOR THE PROPOSED PROJECT USING SQL 265.3 TABLES CREATED 29

6. SCHEMA REFINEMENT 30

6.1 NORMALIZATION 35

7. SNAPSHOTS OF TABLES WITH VALID DATA ENTRIES 45

8. QUERIES 49

9. CONCLUSION 54

10. BIBILOGRAPHY 55

Page 5: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

5 | P a g e

ABSTRACT

Attendance Management System is software developed for daily student attendance in schools, colleges

and institutes. If facilitates to access the attendance information of a particular student in a particular

class. The information is sorted by the operators, which will be provided by the teacher for a particular

class. This system will also help in evaluating attendance eligibility criteria of a student.

In the present system all work is done on paper. The whole session attendance is stored in register and at

the end of the session the reports are generated and the students who don’t have 75% attendance get a

notice.

The existing system is not user friendly because the retrieval of data is very slow and data is not

maintained efficiently. We require more calculations to generate the report so it is generated at the end of

the session. And the students not get a single chance to improve their attendance. All calculations to

generate report are done manually so there is greater chance of errors. Existing system requires lot of

paper work. Loss of even a single register/record led to difficult situation because all the papers are

needed to generate the reports. Every work is done manually so we cannot generate report in the middle

of the session or as per the requirement because it is very time consuming.

The proposed system is user friendly because the retrieval and storing of data is fast and data is

maintained efficiently. Moreover the graphical user interface is provided in the proposed system, which

provides user to deal with the system very easily. Reports can be easily generated in the proposed system

so user can generate there port as per the requirement (monthly) or in the middle of the session. User can

give the notice to the students so he/she become regular.

Page 6: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

6 | P a g e

SYSTEM

REQUIREMENT

SPECIFICATION

Page 7: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

7 | P a g e

2.1 INTRODUCTION:

2.1.1 PURPOSE:

Attendance Management System is softwaredeveloped for daily student attendance in schools,

collegesand institutes. If facilitates to access the attendanceinformation of a particular student in a

particular class. Theinformation is sorted by the operators, which will be providedby the teacher for a

particular class. This system will alsohelp in evaluating attendance eligibility criteria of a student.The

purpose of developing attendancemanagement system is to computerized the tradition way oftaking

attendance. Another purpose for developing thissoftware is to generate the report automatically at the end

ofthe session or in the between of the session.

2.1.2 SCOPE:

The scope of the project is the system on whichthe software is installed, i.e. the project is developed as a

database design from which we can retrieve information about attendance, and it will work for a

particular institute.But later on the project can be modified to operate it online.

2.1.3 LIFE TIME:

This product works until the software used is in existence.

2.1.4 SUCCESS CRITERIA:

As we are using current trends of software, the product runs successfully.

2.2 FUNCTIONAL REQUIREMENTS:

Attendance management system requires the following information to maintain attendance of

each student.

1. First the respective students from each class of particular department are identified.

2. Each faculty member is assigned a single subject for particular batch.

3. Each student is enrolled for a particular course and the subjects of that course are identified.

4. Whenever student attends class of particular subject, the corresponding faculty member

should allot him attendance and update his status in attendance table.

Page 8: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

8 | P a g e

5. The attendance of each student is calculated as ratio of number of classes attended to total

number of classes.

2.3 NON-FUNCTIONAL REQUIREMENTS:

2.3.1 USABILITY:

The product could be used by two categories of people: faculty members and students. Apart from them administrator also could use it.

2.3.2 RELIABILITY:

Users can perform the operations without any constraints regarding the outcome of operation. The product as a whole is highly reliable.

2.3.3 PERFORMANCE:

It provides users with access to information based on the type of users i.e. , student, faculty and to which department they belong. It provides fast access to all the data and transactions requested thereby providing a high degree of performance and throughput.

2.3.4 SUPPORTABILITY:

All kinds of information which can be supported in the database are supported by the system and the application supports the utilities of the system over which it is deployed.

2.4 HARDWARE REQUIREMENT SPECIFICATION:

Processor: Intel Pentium III or aboveHard Disk: 30GB or aboveRAM: 256MB or above

2.5 SOFTWARE REQUIREMENT SPECIFICATION:

Database support (for back end): oracle 8i or 9i or 10g

Page 9: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

9 | P a g e

CONCEPTUAL

SCHEMA DESIGN

Page 10: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

10 | P a g e

3.1 ENTITY RELATIONSHIP MODEL:

An entity-relationship model (ERM) is an abstract and conceptual representation of data. Entity-

relationship modeling is a database modeling method, used to produce a type of conceptual

schema or semantic data model of a system, often a relational database, and its requirements in a down

fashion. Diagrams created by this process are called entity-relationship diagrams, ER diagrams,

or ERDs.

COMPONENTS:

ENTITY:

An entity may be defined as a thing which is recognized as being capable of an independent

existence and which can be uniquely identified. An entity is an abstraction from the complexities of some

domain. When we speak of an entity we normally speak of some aspect of the real world which can be

distinguished from other aspects of the real world.

An entity may be a physical object such as a house or a car, an event such as a house sale or

a car service, or a concept such as a customer transaction or order. Although the term entity is the one

most commonly used, following Chen we should really distinguish between an entity and an entity-type.

An entity-type is a category. An entity, strictly speaking, is an instance of a given entity-type. There are

usually many instances of an entity-type. Because the term entity-type is somewhat cumbersome, most

people tend to use the term entity as a synonym for this term.

Entities can be thought of as nouns. Examples: a computer, an employee, a song, a

mathematical theorem.

REPRESENTATION:

Entities are drawn as rectangles

EXAMPLE:

Or

ATTRIBUTES:

An entity is described using a set of attributes. All entities in a given entity set have the same attributes; this is known as similar type. Our choice of attributes reflects the level of detail at which we wish to represent information about entities. For example, company entity set could use company_id, company_name for each company.

JOB COMPANY

Page 11: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

11 | P a g e

For each attribute associated with an entity set, we must identify a domain of possible values. For example domain associated with attribute company_name of company might be a set of 20-character strings similarly company_id might be integer.

Further, for each entity set , we choose a key. A key is a minimal set of attributes whose values uniquely identify an entity in the set, generally called as candidate key, there could be more than one candidate key, if so we designate one of them as primary key. A primary key is key with which we can identify a tuple uniquely.

TYPES:

Simple Attribute:

A normal attribute defining a entity

Representation:

Multivalued attribute:

Attribute consisting of multiple values.

Example:

Derived attribute:

An attribute which is derived from other attribute.

RELATIONS:

A relationship captures how two or more entities are related to one another. Relationships can be thought of as verbs, linking two or more nouns. Examples: an owns relationship between a company and a computer, a supervises relationship between an employee and a department, a performs relationship between an artist and a song, a proved relationship between a mathematician and a theorem.

Entity-relationship diagrams don't show single entities or single instances of relations. Rather, they show entity sets and relationship sets. Example: a particular song is an entity. The collection of all songs in a database is an entity set. The eaten relationship between a child and her lunch is a single relationship. The set of all such child-lunch relationships in a database is a relationship set. In other words, a relationship set corresponds to a relation in mathematics, while a relationship corresponds to a member of the relation.

Name

Address

Page 12: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

12 | P a g e

EXAMPLE:

CARDINALITY:

In the relational model, tables can be related as any of:many), or one-to-one. This is said to be the

For example, considering a database designed to keep track of hospital records. Such a database could have many tables like:

a Doctor table full of doctor information

a Patient table with patient information

And a Department table with an entry for each department of the hospital.

In that model:

There is a many-to-many relationship between the records in the doctor table and records in the patient table (Doctors have many patients, and a patient could have several doctors);

A one-to-many relation between the department table and the doctor table (each doctor works for one department, but one department could have many doctors).

One-to-one relationship is mostly used to svisibility of some information. In the hospital example, such a relationship could be used to keep apart doctor's personal or administrative information.

EXAMPLE:

COMPANY

ATTENDANCE MANAGEMENT SYSTEM

In the relational model, tables can be related as any of: many-to-many, many-to. This is said to be the cardinality of a given table in relation to another.

For example, considering a database designed to keep track of hospital records. Such a database could

table full of doctor information

table with patient information

table with an entry for each department of the hospital.

relationship between the records in the doctor table and records in the ny patients, and a patient could have several doctors);

relation between the department table and the doctor table (each doctor works for one department, but one department could have many doctors).

relationship is mostly used to split a table in two in order to optimize access or limit the visibility of some information. In the hospital example, such a relationship could be used to keep apart doctor's personal or administrative information.

OFFERS JOB

to-one (rev. one-to-of a given table in relation to another.

For example, considering a database designed to keep track of hospital records. Such a database could

relationship between the records in the doctor table and records in the ny patients, and a patient could have several doctors);

relation between the department table and the doctor table (each doctor works for one

plit a table in two in order to optimize access or limit the visibility of some information. In the hospital example, such a relationship could be used to keep apart

Page 13: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

13 | P a g e

DIAGRAMATIC REPRESENTATION OF VARIOUS COMPONENTS AND THEIR TYPES IN ER_MODEL:

Page 14: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

14 | P a g e

3.2 IDENTIFICATION OF ENTITIES:

STUDENT ENTITY:

Student entity has total 4 attributes sid,semid,secid,sname sid represents student id,semid represents to which semester the student is currently belonging

to,secid represents the student’s section in a particular semester,sname represents student name. sid is the primary key.

SUBJECT ENTITY:

subjects entity consists of attributes subid,subnm,semid subid represents subject id,subnm represents subject name,semid represents semester id(subjects

for a particular semester). Subid is the primary key.

sid

semidsecid

sname

Student

subid subnm semid

Subjects

Page 15: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

15 | P a g e

TEACHER ENTITY:

Teacher is an entity which consists of attributes tid,tname,subnm,secid,semid. Where tid represents teachers id,tname represents teachers name,subid represents subject

id,sec id represents section id. Tid is used as a primary key.

SEMESTER ENTITY:

Semester is an entity which consists of attributes semid,semnm. Semid represents semester id and semnm represents semester name. Semid is used as a primary key.

SECTION ENTITY:

Tid

subidTname

Teacher

Semester

semid semnm

Section

secid secnm

secid

Page 16: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

16 | P a g e

Section entity consists of attributes secid and secnm. Sec id represents section id,secnm represents section name. Secid is the primary key.

MONTHS ENTITY:

Month is an entity which consists of attributes subid,month,sid,no_of_days,tot_days. Where subid represents subject identity,month represents particular month,sid represents student

id.

ATTENDANCE ENTITY:

Attendance is an entity consisting of sid,secid,subid,semid,from1,to1,tot no. of classes and no. of classes attended as attributes.

(Sid,subid) is the primary key.

Subid

No_of_days

Tot_days

Monthsid

Months

Sid

secid

subidfrom1

Attendance

Tot no. of classes

No. of classes

to1

semid

Page 17: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

17 | P a g e

3.3 IDENTIFICATION OF RELATIONSHIPS:

SEMESTER-SUBJECT RELATIONSHIP:

STUDENT-SEMESTER RELATIONSHIP:

STUDENT-SECTION RELATIONSHIP:

Subject

consists

Student

DEPbelongs to

Section

Semester

Semester

belongs to Student

DEP

Page 18: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

18 | P a g e

STUDENT-ATTENDANCE RELATIONSHIP:

TEACHER-SUBJECT RELATIONSHIP:

TEACHER-ATTENDANCE RELATIONSHIP:

TEACHER-SECTION RELATIONSHIP:

Attendance

has

Teacher teaches

Teacher gives

Section

handles

Student

DEP

Subject

Attendance

Teacher

Page 19: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

19 | P a g e

SUBJECT-ATTENDANCE RELATIONSHIP:

SUBJECT-MONTH RELATIONSHIP:

MONTH-ATTENDANCE RELATIONSHIP:

Month

based on

Attendance

has Subject

Attendance

Subject has

Month

Page 20: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

20 | P a g e

3.4 COMPLETE ER DIAGRAM:

Semester

semidsemnm

Student

Si

secid semidSname

Belongs to

Subject

Subidsubnm

consists

Teacher

tid

secid

tname

gives

Attendance

Subid

sid

secid

From1

to1

has

teaches

has

Month

No_of_day

subidTot_days

monthsid

Based on

has

secnm secid

Belongs to

handles

semid

secid

Tot no. of classes

No. of classes

semid

Section

Page 21: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

21 | P a g e

LOGICAL

SCHEMA DESIGN

Page 22: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

22 | P a g e

4.1 REPRESENTATION OF ENTITIES INTO TABLES:

The different entities identified in our project are as follows:

STUDENT

SUBJECT

TEACHER

SEMESTER

SECTION

ATTENDANCE

MONTHS

Above listed entities can be converted into tables as shown below with their corresponding attributes as

fields.

STUDENT TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 SID NUMBER 102 SNAME VARCHAR 203 SEMID NUMBER 104 SECID NUMBER 10

SUBJECT TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 SUBID NUMBER 102 SUBNM VARCHAR 203 SEMID NUMBER 10

TEACHER TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 TID NUMBER 102 TNAME VARCHAR 203 SUBID NUMBER 104 SECID NUMBER 10

Page 23: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

23 | P a g e

SEMESTER TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 SEMID NUMBER 102 SEMNM VARCHAR 10

SECTION TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 SECID NUMBER 102 SECNM VARCHAR 10

ATTENDANCE TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 SID NUMBER 102 SECID NUMBER 103 SEMID NUMBER 104 FROM1 DATE -5 TO1 DATE -6 SUBID NUMBER 107 TOT NO. OF

CLASSESNUMBER 10

8 NO. OF CLASSES ATTENDED

NUMBER 10

MONTHS TABLE:

S.NO FIELD NAME FIELD TYPE FIELD RANGE

1 SID NUMBER 102 MONTH VARCHAR 203 SUBID NUMBER 104 NO_OF_DAYS NUMBER 105 TOTAL_DAYS NUMBER 10

Page 24: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

24 | P a g e

RELATIONAL

SCHEMA DESIGN

Page 25: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

25 | P a g e

5.1 ORACLE :

The Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is a relational

database management system(RDBMS) produced and marketed by Oracle Corporation. As of 2009,

Oracle remains a major presence in database computing.Larry Ellison and his friends and former co-

workers Bob Miner and Ed Oates started the consultancy Software Development Laboratories (SDL) in

1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-

name of a CIA-funded project Ellison had worked on while previously employed by Ampex.

DATABASE SCHEMA:

Oracle database conventions refer to defined groups of object ownership (generally associated

with a "username") as schemas.

After the Oracle database installation process has set up the sample tables, the user can log into

the database with the username scott and the password tiger. The name of the SCOTT schema originated

with Bruce Scott, one of the first employees at Oracle (then Software Development Laboratories), who

had a cat named Tiger.

Oracle Corporation has de-emphasized the use of the SCOTT schema, as it uses few of the

features of the more recent releases of Oracle. Most recent examples supplied by Oracle Corporation

reference the default HR or OE schemas.

Page 26: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

26 | P a g e

5.2 CODE GENERATED FOR THE PROPOSED PROJECT USING SQL:

CREATE TABLE Student

(

sid NUMBER(10) NOT NULL ,

sname VARCHAR2(20) NULL ,

semid NUMBER(10) NOT NULL ,

secid NUMBER(10) NOT NULL ,

primary key(sid),

foreign key(semid) references semester(semid),

foreign key(secid) references section(secid)

);

CREATE TABLE Subject

(

subid NUMBER(10) NOT NULL ,

subnm VARCHAR2(20) NULL ,

semid NUMBER(10) NOT NULL ,

primary key(subid),

foreign key(semid) references semester(semid);

);

CREATE TABLE Teacher

(

tid NUMBER(10) NOT NULL ,

tname VARCHAR2(20) NULL ,

subid NUMBER(10) NOT NULL,

secid NUMBER(10) NOT NULL,

primary key(tid),

foreign key(subid) references subject(subid),

foreign key(secid) references section(secid)

);

CREATE TABLE Semester

(

Page 27: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

27 | P a g e

semid NUMBER(10) NOT NULL ,

semnm VARCHAR2(20) NOT NULL ,

primary key(semid)

);

CREATE TABLE Section

(

secid NUMBER(10) NOT NULL ,

secnm VARCHAR2(20) NOT NULL ,

primary key(secid)

);

CREATE TABLE Attendance

(

sid NUMBER(10) NOT NULL ,

secid NUMBER(10) NOT NULL ,

subid NUMBER(10) NOT NULL ,

semid NUMBER(10) NOT NULL ,

from1 DATE NULL ,

to1 DATE NULL ,

tot no. of classes NUMBER(10) NOT NULL,

No. of classes attended NUMBER(10) NULL,

primary key(sid,subid),

foreign key(sid) references student(sid),

foreign key(subid) references subject(subid),

foreign key(semid) references semester(semid),

foreign key(secid) references section(secid)

);

CREATE TABLE Months

(

MONTH VARCHAR2(20) NULL,

no_of_days NUMBER(10) NULL ,

total_days NUMBER(10) NULL ,

sid NUMBER(10) NOT NULL ,

Page 28: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

28 | P a g e

subid NUMBER(10) NOT NULL ,

foreign key(subid) references subject(subid),

foreign key(sid) references student(sid)

);

INSERT INTO Student values(71,’sowmya’,5,1);

INSERT INTO Student values(72,’pranathi’,5,1);

INSERT INTO Student values(73,’madhu’,7,2);

INSERT INTO Student values(74,’sruthi’,3,2);

INSERT INTO Student values(75,’sowmya’,7,3)

INSERT INTO Student values(75,’ramya’,3,3);

INSERT INTO Subject values(1,’ca’,5);

INSERT INTO Subject values(2,’daa’,5);

INSERT INTO Subject values(3,’dc’,5);

INSERT INTO Subject values(4,’dbms’,5);

INSERT INTO Subject values(5,’edc’,2);

INSERT INTO Subject values(6,’et’,2);

INSERT INTO Subject values(7,’dms-1’,2);

INSERT INTO Subject values(8,’ds’,4);

INSERT INTO Teacher values(1,’kavitha’,4,1);

INSERT INTO Teacher values(2,’gayathri’,1,2);

INSERT INTO Teacher values(3,’jaya’,4,3);

INSERT INTO Teacher values(4,’ujwala’,8,2);

INSERT INTO Teacher values(5,’kavitha’,7,3);

INSERT INTO Semester values(1,’1’);

INSERT INTO Semester values(2,’2-1’);

INSERT INTO Semester values(3,’2-2’);

INSERT INTO Semester values(4,’3-1’);

INSERT INTO Semester values(5,’3-2’);

INSERT INTO Semester values(6,’4-1’);

INSERT INTO Semester values(7,’4-2’);

Page 29: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

29 | P a g e

INSERT INTO Section values(1,’A’);

INSERT INTO Section values(1,’B’);

INSERT INTO Section values(1,’C’);

INSERT INTO Attendance values(71,1,4,5,’25-JAN-11’,’25-FEB-11’,80,60);

INSERT INTO Attendance values(72,1,3,5,’25-JAN-11’,’25-FEB-11’,65,60);

INSERT INTO Attendance values(73,2,6,7,’25-SEP-11’,’26-NOV-11’,78,78);

INSERT INTO Attendance values(74,2,7,3,’20-APR-10’,’25-MAY-10’,75,72);

INSERT INTO Attendance values(75,3,4,7,’25-SEP-11’,’26-OCT-11’,60,55);

INSERT INTO Attendance values(76,3,8,3,’20-APR-10’,’24-MAY-10’,80,70);

INSERT INTO Months values(‘APR’,27,30,71,1);

INSERT INTO Months values(‘JAN’,25,31,76,1);

INSERT INTO Months values(‘SEP’,28,30,72,2);

INSERT INTO Months values(‘JUL’,26,31,73,4);

INSERT INTO Months values(‘NOV’,27,30,75,5);

INSERT INTO Months values(‘APR’,29,30,72,8);

5.3 TABLES CREATED:

TNAME TABTYPE CLUSTERID

------------------------------ ------- ---------

STUDENT TABLE

SUBJECTS TABLE

TEACHER TABLE

SEMESTER TABLE

SECTION TABLE

ATTENDANCE TABLE

MONTH TABLE

6 rows selected.

Page 30: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

30 | P a g e

SQL> desc section;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

SECID NOT NULL NUMBER(10)

SECNM VARCHAR2(20)

SQL> desc semester;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

SEMID NOT NULL NUMBER(10)

SEMNM VARCHAR2(20)

SQL> desc month;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

MONTH NOT NULL VARCHAR2(20)

NO_OF_DAYS NUMBER(10)

TOTAL_DAYS NUMBER(10)

SID NOT NULL NUMBER(10)

SUBID NOT NULL NUMBER(10)

SQL> desc subjects;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

SUBID NOT NULL NUMBER(10)

SUBNM VARCHAR2(20)

SEMID NOT NULL NUMBER(10)

SQL> desc student;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

SID NOT NULL NUMBER(10)

SNAME VARCHAR2(20)

SEMID NOT NULL NUMBER(10)

Page 31: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

31 | P a g e

SECID NOT NULL NUMBER(10)

SQL> desc teacher;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

TID NOT NULL NUMBER(10)

TNAME VARCHAR2(20)

SUBID NOT NULL NUMBER(10)

SECID NOT NULL NUMBER(10)

SQL> desc attendance;

Name Null? Type

----------------------------------------------------- -------- ------------------------------------

SID NOT NULL NUMBER(10)

SECID NOT NULL NUMBER(10)

SEMID NOT NULL NUMBER(10)

SUBID NOT NULL NUMBER(10)

FROM1 DATE

TO1 DATE

TOT NO. OF CLASSES NOT NULL NUMBER(10)

NO. OF CLASSES ATTENDED NUMBER(10)

SQL>select * from student;

SID SNAME SEMID SECID

---------------- ------------------- ------------- --------------------

71 soumya 5 1

72 pranathi 5 1

73 madhu 7 2

74 sruthi 3 2

75 sowmya 7 3

76 ramya 3 3

SQL>select * from subject;

SUBID SUBNM SEMID

Page 32: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

32 | P a g e

------------------- ------------------------ -------------------

1 ca 5

2 daa 5

3 dc 5

4 dbms 5

5 edc 2

6 et 2

7 dms-1 2

8 ds 4

SQL>select * from teacher;

TID TNAME SUBID SECID

-------------- ---------------- -------------------- -------------------

1 kavitha 4 1 2 gayathri 1 2 3 jaya 4 3 4 ujwala 8 2 5 kavitha 7 3

SQL>select * from semster;

SEMID SEMNM

---------------- ---------------------

1 1

2 2-1

3 2-2

4 3-1

5 3-2

6 4-1

7 4-2

SQL>select * from section;

SECID SECNM

---------------- ---------------------

1 A

2 B

Page 33: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

33 | P a g e

3 C

SQL>select * from attendance;

SID SECID SUBID SEMID FROM1 TO1 TOT NO. OF CLASSES

-------------- ---------------- ----------------- ----------------- --------------- ----------------------------------

NO. OF CLASSES ATTENDED

--------------------------------------------

71 1 4 5 25-JAN-11 25-FEB-11 80

60

72 1 3 5 25-JAN-11 25-FEB-11 65

60

73 2 6 7 25-SEP-11 26-NOV-11 78

78

74 2 7 3 20-APR-10 25-MAY-10 75

72

75 3 4 7 25-SEP-11 26-OCT-11 60

55

76 3 8 3 20-APR-10 24-MAY-10 80

70

SQL>select * from month;

MONTH NO_OF_DAYS TOT_DAYS SID SUBID

-------------- ------------------------- ---------------------- ------------ -------------------

APR 27 30 71 1

JAN 25 31 76 1

SEP 28 30 72 2

JUL 26 31 73 4

NOV 27 30 75 5

APR 29 30 72 8

Page 34: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

34 | P a g e

SCHEMA

REFINEMENT

Page 35: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

35 | P a g e

6.1 NORMALIZATION:Normalization of data can be looked upon as a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the desirable properties of1. Minimizing redundancy and2. Minimizing the insertion, deletion and update anomalies.The normalization procedure provides database designers with following:

1. A formal framework for analyzing relation schemas based on their keys and on the functional dependencies among their attributes.

2. A series of normal form tests that can be carried out on individual relation schemas so that the relational database can be normalized to any desired degree.

The process of normalization through decomposition must also confirm the existence of additional properties that the relation schemas, taken together, should process. This would include two properties:

1. The lossless join or non additive join property, which guarantees that the spurious tuple generation problem does not occur with respect to the relation schemas created after decomposition.

2. The dependency preservation property, which ensures that each functional dependency is represented in some individual relation resulting after decomposition.

NORMAL FORMS:

FIRST NORMAL FORM:First normal form (1NF) is considered to be part of the formal definition of a relation in the basic relational model; historically, it was defined to disallow multi valued attributes, composite attributes and their combinations. It states that the domain of an attribute must include only atomic values and that the

value of any attribute in a tuple must be a single value from the domain of that attribute.

SECOND NORMAL FORM:Second normal form (2NF) is based on the concept of fully functional dependency. A functional dependency X→Y is a full functional dependency if removal of any attribute A from X means that the dependency does not hold any more; that is, for any attribute AєX, (X-{A}) does not functionally determine Y. Functional dependency X→Y is a partial dependency if some attribute AєX can be removed from X and the dependency still holds; that is, for some AєX, (X-{A})→Y.

THIRD NORMAL FORM:Third normal form (3NF) is based on the concept of transitive dependency. A functional dependency X→Y in a relation schema R is a transitive dependency if there is a set of attributes Z that is a candidate key nor a subset of any key of R, and both X→Z and Z→Y hold.Let us consider tables from our scenario:

Page 36: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

36 | P a g e

STUDENT:

FIRST NORMAL FORM(1NF):The student table is in first normal form because

1. Each row is identified uniquely.2. Each column is not having more than a single value.

SECOND NORMAL FORM(2NF):The student table is in second normal form because

1. It is in first normal form.2. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The student table is in third normal form because

1. It is in second normal form.2. No non key attribute is is identified by another non key attribute.

TEACHER:

Tid Tname Subid Secid

1 kavitha 4 1

2 gayathri 1 2

3 jaya 4 3

4 ujwala 8 2

5 kavitha 7 3

FIRST NORMAL FORM(1NF):The teacher table is in first normal form because

3. Each row is identified uniquely.4. Each column is not having more than a single value.

Sid Sname Semid Secid

1 sowmya 5 1

2 pranathi 5 1

3 madhu 7 2

4 sruthi 3 2

5 sowmya 7 3

6 ramya 3 3

Page 37: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

37 | P a g e

SECOND NORMAL FORM(2NF):The teacher table is in second normal form because

3. It is in first normal form.4. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The teacher table is in third normal form because

3. It is in second normal form.4. No non key attribute is is identified by another non key attribute.

SEMESTER:

Semid Semnm

1 1

2 2-1

3 2-2

4 3-1

5 3-2

6 4-1

7 4-2

FIRST NORMAL FORM(1NF):The semester table is in first normal form because

5. Each row is identified uniquely.6. Each column is not having more than a single value.

SECOND NORMAL FORM(2NF):The semester table is in second normal form because

5. It is in first normal form.6. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The semester table is in third normal form because

5. It is in second normal form.6. No non key attribute is is identified by another non key attribute.

Page 38: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

38 | P a g e

SECTION:

Secid Secnm

1 A

2 B

3 C

FIRST NORMAL FORM(1NF):The section table is in first normal form because

7. Each row is identified uniquely.8. Each column is not having more than a single value.

SECOND NORMAL FORM(2NF):The section table is in second normal form because

7. It is in first normal form.8. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The section table is in third normal form because

7. It is in second normal form.8. No non key attribute is is identified by another non key attribute.

SUBJECT:

In the subject table semid(non key attribute) can be identified by subnm(non key attribute).It is violating 3NF.So we divide it into two tables ‘SUB1’ and ‘SUB2’.

SUB1:

Subid Subnm

1 ca

2 daa

3 dc

4 dbms

5 edc

6 et

7 dms-1

8 ds

Page 39: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

39 | P a g e

SUB2:

Subid Semid

1 5

2 5

3 5

4 5

5 2

6 2

7 2

8 4

FIRST NORMAL FORM(1NF):The sub1 and sub2 tables are in first normal form because

9. Each row is identified uniquely.10. Each column is not having more than a single value.

SECOND NORMAL FORM(2NF):The sub1 and sub2 tables are in second normal form because

9. It is in first normal form.10. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The sub1 and sub2 tables are in third normal form because

9. It is in second normal form.10. No non key attribute is is identified by another non key attribute.

ATTENDANCE:In this table the primary key is (sid,subid).Here ‘secid’ can be identified from ‘sid’ alone which is a part

of primary key. Also ‘semid’, ‘tot no. of classes’ and ‘no. of classes attended’ can be identified from

‘subid’(part of primary key).These are violating 2NF.Hence we divide this into two tables ‘ATT1’ and

‘ATT2’.

Page 40: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

40 | P a g e

ATT1:

Sid Tot no. of classes

No. of classes attended

Secid Semid

71 80 60 1 5

72 65 60 1 5

73 78 78 2 7

74 75 72 2 3

75 60 55 3 7

76 80 70 3 3

ATT2:

Sid Subid From1 To1

71 4 25-JAN-11 25-FEB-11

72 3 25-JAN-11 25-FEB-11

73 6 25-SEP-11 26-NOV-11

74 7 20-APR-10 25-MAY-10

75 4 25-SEP-11 26-OCT-11

76 8 20-APR-10 24-MAY-10

FIRST NORMAL FORM(1NF):The att1 and att2 tables are in first normal form because

11. Each row is identified uniquely.12. Each column is not having more than a single value.

SECOND NORMAL FORM(2NF):The att1 and att2 tables are in second normal form because

11. It is in first normal form.12. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The att1 and att2 tables are in third normal form because

11. It is in second normal form.12. No non key attribute is is identified by another non key attribute.

Page 41: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

41 | P a g e

MONTHS:

In this table,the non key attributes ‘month’ and ‘ tot_days’ are dependent on each other violating 3NF.so

we divide this table into ‘months1’ and ‘months2’.

MONTHS1:

MONTHS2:

FIRST NORMAL FORM(1NF):The months1 and months2 tables are in first normal form because

13. Each row is identified uniquely.

Month No_of_days Sid Subid

APR 27 71 1

JAN 25 76 1

SEP 28 72 2

JUL 26 73 4

NOV 27 75 5

APR 29 72 8

Tot_days No_of_days Sid Subid

30 27 71 1

31 25 76 1

30 28 72 2

31 26 73 4

30 27 75 5

30 29 72 8

Page 42: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

42 | P a g e

14. Each column is not having more than a single value.

SECOND NORMAL FORM(2NF):The months1 and months2 tables are in second normal form because

13. It is in first normal form.14. Every non key attribute is fully functionally dependent on key attributes.

THIRD NORMAL FORM(3NF):The months1 and months2 tables are in third normal form because

13. It is in second normal form.14. No non key attribute is is identified by another non key attribute.

AFTER NORMALIZATION:

We got six new tables ‘sub1’,’sub2’,’att1’,‘att2’ and ‘months1’,’months2’ in the place of

‘subject’,’attendance’ and ‘months’ table respectively.So we delete these old tables and create the six

new tables.

Following is the code for -

deletion of old tables:

Alter table subject drop column subid;

Alter table subject drop column subnm;

Alter table subject drop column semid;

Alter table attendance drop column sid;

Alter table attendance drop column secid;

Alter table attendance drop column subid;

Alter table attendance drop column from1;

Alter table attendance drop column to1;

Alter table attendance drop column tot no. of classes;

Alter table attendance drop column no. of classes attended;

Alter table months drop column month;

Alter table months drop column tot_days;

Alter table months drop column no_of_days;

Alter table months drop column sid;

Alter table months drop column subid;

creation of new tables:

CREATE TABLE Sub1

Page 43: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

43 | P a g e

(

subid NUMBER(10) NOT NULL ,

subnm VARCHAR2(20) NULL ,

primary key(subid)

);

CREATE TABLE Sub2

(

subid NUMBER(10) NOT NULL ,

semid NUMBER(10) NOT NULL ,

primary key(subid),

foreign key(semid) references semester(semid)

);

CREATE TABLE Att1

(

sid NUMBER(10) NOT NULL ,

tot no.ofclasses NUMBER(10) NOT NULL,

No.of classes attended NUMBER(10) NULL,

secid NUMBER(10) NOT NULL ,

semid NUMBER(10) NOT NULL ,

primary key(sid),

foreign key(sid) references student(sid),

foreign key(secid) references section(secid),

foreign key(semid) references semester(semid)

);

CREATE TABLE Att2

(

sid NUMBER(10) NOT NULL ,

subid NUMBER(10) NOT NULL ,

from1 DATE NULL ,

to1 DATE NULL ,

primary key(sid,subid),

Page 44: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

44 | P a g e

foreign key(sid) references student(sid),

foreign key(subid) references subject(subid)

);

CREATE TABLE Months1

(

MONTH VARCHAR2(20) NULL,

no_of_days NUMBER(10) NULL ,

sid NUMBER(10) NOT NULL ,

subid NUMBER(10) NOT NULL ,

foreign key(subid) references subject(subid),

foreign key(sid) references student(sid)

);

CREATE TABLE Months2

(

no_of_days NUMBER(10) NULL ,

total_days NUMBER(10) NULL ,

sid NUMBER(10) NOT NULL ,

subid NUMBER(10) NOT NULL ,

foreign key(subid) references subject(subid),

foreign key(sid) references student(sid)

);

Page 45: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

45 | P a g e

SNAPSHOTS

OF TABLES

Page 46: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

46 | P a g e

SEMESTER TABLE:

Semid Semnm

1 1

2 2-1

3 2-2

4 3-1

5 3-2

6 4-1

7 4-2

SECTION TABLE:

Secid Secnm

1 A2 B3 C

STUDENT TABLE:

TEACHER TABLE:

Tid Tname Subid Secid

1 Kavitha 4 12 Gayathri 1 23 Jaya 4 34 Ujwala 8 25 kavitha 7 3

Sid Sname Semid Secid

71 Sowmya 5 172 Pranathi 5 173 Madhu 7 274 Sruthi 3 275 Sowmya 7 376 Ramya 3 3

Page 47: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

47 | P a g e

MONTHS1 TABLE:

MONTHS2 TABLE:

SUB1:

Subid Subnm

1 ca2 daa3 dc4 dbms5 edc6 et7 dms-18 ds

SUB2:

Subid Semid

1 52 53 54 55 2

Month No_of_days Sid Subid

APR 27 71 1JAN 25 76 1SEP 28 72 2JUL 26 73 4NOV 27 75 5APR 29 72 8

Tot_days No_of_days Sid Subid

30 27 71 131 25 76 130 28 72 231 26 73 430 27 75 530 29 72 8

Page 48: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

48 | P a g e

6 27 28 4

ATT1:

Sid Tot no.of classes No. of classes attended

Secid Semid

71 80 60 1 572 65 60 1 573 78 78 2 7

74 75 72 2 3

75 60 55 3 7

76 80 70 3 3

ATT2:

Sid Subnm From1 To1

71 4 25-JAN-11 25-FEB-11 72 3 25-JAN-11 25-FEB-11 73 6 25-SEP-11 26-NOV-11

74 7 20-APR-10 25-MAY-10

75 4 25-SEP-11 26-OCT-11

76 8 20-APR-10 24-MAY-10

Page 49: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

49 | P a g e

QUERIES

Page 50: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

50 | P a g e

1. Write a query to obtain the month which has (a.) maximum student attendance (b.) minimum student attendance

Solution:

Select month from months1 group by month having max(avg(no_of_days));

Output: SEP

Select month from months1 group by month having min(avg(no_of_days));

Output: APR

2. Write a query to obtain the maximum attendance semester wise.

Solution:

Select semid,max((nca/tnc)*100) as percentage from att1 group by semid;

Output:

SEMID PERCENTAGE

---------- --------------------

5 92.307962

7 100

3 96

3. Write a query to obtain student details whose attendance is less than 80%.

Solution:

Select sid from att1 where (nca/tnc)*100<80;

Output:

SID

------------

71

4. Find name of the student who has the maximum attendance in the month of april.

Page 51: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

51 | P a g e

Solution:

Select m1.sid from months1 m1,months1 m2 where m1.month=’apr’ and m2.month=’apr’ and

m1.no_of_days>m2.no_of_days;

Output:

SID

----------

72

5. Procedure to update attendance of a student.

Solution:

create or replace procedure att(p_sid in att1.sid%type,ncat in att1.nca%type)

is

begin

update att1 set nca=ncat where sid=p_sid;

end att;

SQL>procedure created

SQL>execute att(75,78);

SQL>procedure successfully completed.

6. Procedure to insert details of teacher into the teacher table.

create or replace procedure pr_teacher(p_tid in teacher.tid%type,p_tname in

teacher.tname%type,p_subid in teacher.subid%type,p_sec in teacher.secid%type)

is

begin

insert into teacher(tid,tname,subid,secid) values(p_tid,p_tname,p_subid,p_sec);

Page 52: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

52 | P a g e

commit;

end pr_teacher;

SQL>procedure created.

SQL>execute pr_teacher(6,’kavitha’,5,1);

SQL>procedure successfully completed.

7. Function to calculate the attendance of a student.

create or replace function cal_att1(tnca in att1.tnc%type,ncat in att1.nca%type)

return number

is

begin

return((ncat/tnca)*100);

end cal_att1;

SQL>function created.

SQL> select sid,cal_att1(tnc,nca)"percentage" from att1 where secid=2;

SID percentage

---- ----------

73 100

74 96

8. Trigger to restrict insertion or updation on student attendance.

create or replace trigger restrict_upd

before insert or update of no_of_days on months

for each row

begin

if not(:new.sid in(71,72,73,74,75,76))

then

raise_application_error(-20202,'student does not exist');

end if;

end;

SQL>trigger created.

SQL>Update months set no_of_days=25 where sid=77;

Error:student does not exist.

Page 53: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

53 | P a g e

9. Trigger to restrict insertion or updation on student attendance.

create or replace trigger restrict_upd

before insert or update of no_of_days on months

for each row

begin

if (:new.no_of_days>31)

then

raise_application_error(-20202,'attendance cannot be updated as number of days in a month

is>31’);

end if;

end;

SQL>trigger created.

SQL>Update months set no_of_days=32 where sid=75;

Error: attendance cannot be updated as number of days in a month is>31.

Page 54: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

54 | P a g e

CONCLUSION

The Attendance Management System is developed using ORACLE DATABASE and fully meets the

objectives of the system which it has been developed. The system has reached a steady state where all

bugs have been eliminated. The system is operated at a high level of efficiency and all the teachers and

user associated with the system understands its advantage. The system solves the problem. It was

intended to solve as requirement specification.

Page 55: php attendance management system

ATTENDANCE MANAGEMENT SYSTEM

55 | P a g e

BIBILOGRAPHY

1. Database management system by Raghu Ramakrishna, Johannes gehrke

2. Distributed database design: principles and systems by

S. Ceri and G. pelagetti

3. Introduction and usage of sql.