Вы находитесь на странице: 1из 55

ATTENDANCE MANAGEMENT SYSTEM

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 SHAIK ABDUL SHAJAHAN BASHA P.JANAKI RAMI REDDY T.SANKAR


Under the esteemed guidance of Ms.A.Kavitha Asst.Professor Department of C.S.E

690752090 690752093 690752082 690752102

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ANIL NEERUKONDA INSTITUTE OF TECHNOLOGY & SCIENCES SANGIVASALA, VISAKHAPATNAM 530003 2010-2011

1|Page

ATTENDANCE MANAGEMENT SYSTEM

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)

2|Page

ATTENDANCE MANAGEMENT SYSTEM

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 SHAIK ABDUL SHAJAHAN BASHA P.JANAKI RAMI REDDY T.SANKAR

690752090 690752093 690752082 690752102

3|Page

ATTENDANCE MANAGEMENT SYSTEM

INDEX
1. ABSTRACT 2. SYSTEM REQUIREMENT SPECIFICATION 2.1 INTRODUCTION 2.2 FUNCTIONAL REQUIREMENTS 2.3 NON FUNCTIONAL REQUIREMENTS 2.4 HARDWARE REQUIREMENT SPECIFICATION 2.5 SOFTWARE REQUIREMENT SPECIFICATION 5 6 7 7 8 8 8 9 10 14 17 20 21 22 24 25 26 29 30 35 45 49 54 55

3. CONCEPTUAL SCHEMA DESIGN


3.1 3.2 3.3 3.4 ENTITY RELATIONSHIP MODEL IDENTIFICATION OF ENTITIES IDENTIFICATION OF RELATIONS COMPLETE E-R DIAGRAM

4. LOGICAL SCHEMA GENERATION


4.1 REPRESENTATION OF ENTITIES INTO TABLES

5. RELATIONAL SCHEMA DESIGN


5.1 ORACLE 5.2 CODE GENERATED FOR THE PROPOSED PROJECT USING SQL 5.3 TABLES CREATED

6. SCHEMA REFINEMENT
6.1 NORMALIZATION 7. SNAPSHOTS OF TABLES WITH VALID DATA ENTRIES 8. QUERIES 9. CONCLUSION 10. BIBILOGRAPHY

4|Page

ATTENDANCE MANAGEMENT SYSTEM

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 dont 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.

5|Page

ATTENDANCE MANAGEMENT SYSTEM

SYSTEM REQUIREMENT SPECIFICATION

6|Page

ATTENDANCE MANAGEMENT SYSTEM

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. 7|Page

ATTENDANCE MANAGEMENT SYSTEM 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 above Hard Disk: 30GB or above RAM: 256MB or above

2.5 SOFTWARE REQUIREMENT SPECIFICATION:


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

8|Page

ATTENDANCE MANAGEMENT SYSTEM

CONCEPTUAL SCHEMA DESIGN

9|Page

ATTENDANCE MANAGEMENT SYSTEM

3.1 ENTITY RELATIONSHIP MODEL:


An entity-relationship model (ERM) is an abstract and conceptual representation of data. Entityrelationship 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:
COMPANY JOB

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. 10 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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:
Name

Multivalued attribute:
Attribute consisting of multiple values.

Example:
Address

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.

11 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

EXAMPLE:

COMPANY

OFFERS

JOB

CARDINALITY:
In the relational model, tables can be related as any of: many-to-many, many-to to-one (rev. one-tomany), or one-to-one. 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 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 ny 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 s split 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 doctor's personal or administrative information.

EXAMPLE:

12 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

DIAGRAMATIC REPRESENTATION OF VARIOUS COMPONENTS AND THEIR TYPES IN ER_MODEL:

13 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

3.2 IDENTIFICATION OF ENTITIES:


STUDENT ENTITY:

semid sid

secid sname

Student

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 students section in a particular semester,sname represents student name. sid is the primary key.

SUBJECT ENTITY:
subid subnm semid

Subjects
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.

14 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

TEACHER ENTITY:
subid secid

Tname Tid

Teacher
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:
semid semnm

Semester
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:
secid secnm

Section

15 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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

MONTHS ENTITY:

No_of_days Month Subid

sid Tot_days

Months

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:
secid to1 subid Tot no. of classes No. of classes

semid from1 Sid

Attendance

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.

16 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

3.3 IDENTIFICATION OF RELATIONSHIPS:

SEMESTER-SUBJECT RELATIONSHIP:

Semester

consists

Subject
STUDENT-SEMESTER RELATIONSHIP:

Student DEP

belongs to

Semester
STUDENT-SECTION RELATIONSHIP:

Student DEP

belongs to

Section

17 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

STUDENT-ATTENDANCE RELATIONSHIP:

Student DEP

has

Attendance
TEACHER-SUBJECT RELATIONSHIP:

Teacher

teaches

Subject
TEACHER-ATTENDANCE RELATIONSHIP:

Teacher

gives

Attendance
TEACHER-SECTION RELATIONSHIP:

Teacher

handles

Section
18 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

SUBJECT-ATTENDANCE RELATIONSHIP:

Subject

has

Attendance
SUBJECT-MONTH RELATIONSHIP:

Subject

has

Month
MONTH-ATTENDANCE RELATIONSHIP:

Month

based on

Attendance

19 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

3.4 COMPLETE ER DIAGRAM:

semid

semnm

Semester

consists Belongs to Belongs to semid Student Si secid secnm secid


Section

Subid

From1 sid

Attendance secid Tot no. of classes Subid No. of classes to1

semid

Sname has

has

subnm Subject

semid

Teacher

gives teaches

tid secid secid handles sid month tname

Month

has

Tot_days No_of_day

subid

Based on

20 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

LOGICAL SCHEMA DESIGN

21 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

4.1 REPRESENTATION OF ENTITIES INTO TABLES:


The different entities identified in our project are as follows: fields. STUDENT SUBJECT TEACHER SEMESTER SECTION ATTENDANCE MONTHS

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

STUDENT TABLE:
S.NO 1 2 3 4 FIELD NAME SID SNAME SEMID SECID FIELD TYPE NUMBER VARCHAR NUMBER NUMBER FIELD RANGE 10 20 10 10

SUBJECT TABLE:
S.NO 1 2 3 FIELD NAME SUBID SUBNM SEMID FIELD TYPE NUMBER VARCHAR NUMBER FIELD RANGE 10 20 10

TEACHER TABLE:
S.NO 1 2 3 4 FIELD NAME TID TNAME SUBID SECID FIELD TYPE NUMBER VARCHAR NUMBER NUMBER FIELD RANGE 10 20 10 10

22 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

SEMESTER TABLE:

S.NO 1 2

FIELD NAME SEMID SEMNM

FIELD TYPE NUMBER VARCHAR

FIELD RANGE 10 10

SECTION TABLE:

S.NO 1 2

FIELD NAME SECID SECNM

FIELD TYPE NUMBER VARCHAR

FIELD RANGE 10 10

ATTENDANCE TABLE: S.NO


1 2 3 4 5 6 7 8

FIELD NAME
SID SECID SEMID FROM1 TO1 SUBID TOT NO. OF CLASSES NO. OF CLASSES ATTENDED

FIELD TYPE
NUMBER NUMBER NUMBER DATE DATE NUMBER NUMBER NUMBER

FIELD RANGE
10 10 10 10 10 10

MONTHS TABLE: S.NO


1 2 3 4 5

FIELD NAME
SID MONTH SUBID NO_OF_DAYS TOTAL_DAYS

FIELD TYPE
NUMBER VARCHAR NUMBER NUMBER NUMBER

FIELD RANGE
10 20 10 10 10

23 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

RELATIONAL SCHEMA DESIGN

24 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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 coworkers 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 codename 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.

25 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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 ( 26 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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 , 27 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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); 28 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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 STUDENT SUBJECTS TEACHER SEMESTER SECTION ATTENDANCE MONTH 6 rows selected.

TABTYPE CLUSTERID TABLE TABLE TABLE TABLE TABLE TABLE TABLE

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

29 | P a g e

ATTENDANCE MANAGEMENT SYSTEM SQL> desc section; Name SECID SECNM SQL> desc semester; Name SEMID SEMNM SQL> desc month; Name MONTH NO_OF_DAYS TOTAL_DAYS SID SUBID SQL> desc subjects; Name SUBID SUBNM SEMID SQL> desc student; Name SID SNAME SEMID 30 | P a g e Null? Type NOT NULL NUMBER(10) VARCHAR2(20) NOT NULL NUMBER(10) ----------------------------------------------------- -------- -----------------------------------Null? Type NOT NULL NUMBER(10) VARCHAR2(20) NOT NULL NUMBER(10) ----------------------------------------------------- -------- -----------------------------------Null? Type NOT NULL VARCHAR2(20) NUMBER(10) NUMBER(10) NOT NULL NUMBER(10) NOT NULL NUMBER(10) ----------------------------------------------------- -------- -----------------------------------Null? Type NOT NULL NUMBER(10) VARCHAR2(20) ----------------------------------------------------- -------- -----------------------------------Null? Type NOT NULL NUMBER(10) VARCHAR2(20) ----------------------------------------------------- -------- ------------------------------------

ATTENDANCE MANAGEMENT SYSTEM SECID SQL> desc teacher; Name TID TNAME SUBID SECID SQL> desc attendance; Name SID SECID SEMID SUBID FROM1 TO1 TOT NO. OF CLASSES NO. OF CLASSES ATTENDED SQL>select * from student; SID 71 72 73 74 75 76 SNAME soumya pranathi madhu sruthi sowmya ramya SEMID 5 5 7 3 7 3 1 1 2 2 3 3 SECID ---------------- ------------------- ------------- -------------------Null? Type NOT NULL NUMBER(10) NOT NULL NUMBER(10) NOT NULL NUMBER(10) NOT NULL NUMBER(10) DATE DATE NOT NULL NUMBER(10) NUMBER(10) ----------------------------------------------------- -------- -----------------------------------Null? Type NOT NULL NUMBER(10) VARCHAR2(20) NOT NULL NUMBER(10) NOT NULL NUMBER(10) ----------------------------------------------------- -------- -----------------------------------NOT NULL NUMBER(10)

SQL>select * from subject; SUBID 31 | P a g e SUBNM SEMID

ATTENDANCE MANAGEMENT SYSTEM ------------------- ------------------------ ------------------1 2 3 4 5 6 7 8 ca daa dc dbms edc et dms-1 ds 5 5 5 5 2 2 2 4

SQL>select * from teacher; TID 1 2 3 4 5 TNAME kavitha gayathri jaya ujwala kavitha 4 1 4 8 7 SUBID 1 2 3 2 3 SECID -------------- ---------------- -------------------- -------------------

SQL>select * from semster; SEMID 1 2 3 4 5 6 7 SEMNM 1 2-1 2-2 3-1 3-2 4-1 4-2

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

SQL>select * from section; SECID 1 2 32 | P a g e SECNM A B

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

ATTENDANCE MANAGEMENT SYSTEM 3 C

SQL>select * from attendance; SID SECID SUBID SEMID FROM1 TO1 TOT NO. OF CLASSES -------------- ---------------- ----------------- ----------------- --------------- ---------------------------------NO. OF CLASSES ATTENDED -------------------------------------------71 60 72 60 73 78 74 72 75 55 76 70 SQL>select * from month; MONTH APR JAN SEP JUL NOV APR NO_OF_DAYS 27 25 28 26 27 29 30 31 30 31 30 30 TOT_DAYS 71 76 72 73 75 72 1 1 2 4 5 8 SID SUBID -------------- ------------------------- ---------------------- ------------ ------------------3 8 3 20-APR-10 24-MAY-10 80 3 4 7 25-SEP-11 26-OCT-11 60 2 7 3 20-APR-10 25-MAY-10 75 2 6 7 25-SEP-11 26-NOV-11 78 1 3 5 25-JAN-11 25-FEB-11 65 1 4 5 25-JAN-11 25-FEB-11 80

33 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

SCHEMA REFINEMENT

34 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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 of 1. Minimizing redundancy and 2. 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 XY 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 AX, (X-{A}) does not functionally determine Y. Functional dependency XY is a partial dependency if some attribute AX can be removed from X and the dependency still holds; that is, for some AX, (X-{A})Y.

THIRD NORMAL FORM:


Third normal form (3NF) is based on the concept of transitive dependency. A functional dependency XY 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 XZ and ZY hold. Let us consider tables from our scenario:

35 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

STUDENT:
Sid 1 2 3 4 5 6 Sname sowmya pranathi madhu sruthi sowmya ramya Semid 5 5 7 3 7 3 Secid 1 1 2 2 3 3

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 1 2 3 4 5 Tname kavitha gayathri jaya ujwala kavitha Subid 4 1 4 8 7 Secid 1 2 3 2 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.

36 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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 1 2 3 4 5 6 7 Semnm 1 2-1 2-2 3-1 3-2 4-1 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.

37 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

SECTION:
Secid 1 2 3 Secnm A B 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 1 2 3 4 5 6 7 8 38 | P a g e Subnm ca daa dc dbms edc et dms-1 ds

ATTENDANCE MANAGEMENT SYSTEM

SUB2:
Subid 1 2 3 4 5 6 7 8 Semid 5 5 5 5 2 2 2 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.

39 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

ATT1:
Sid 71 72 73 74 75 76 Tot no. of classes 80 65 78 75 60 80 No. of classes attended 60 60 78 72 55 70 Secid 1 1 2 2 3 3 Semid 5 5 7 3 7 3

ATT2:
Sid 71 72 73 74 75 76 Subid 4 3 6 7 4 8 From1 25-JAN-11 25-JAN-11 25-SEP-11 20-APR-10 25-SEP-11 20-APR-10 To1 25-FEB-11 25-FEB-11 26-NOV-11 25-MAY-10 26-OCT-11 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.

40 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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:

Month APR JAN SEP JUL NOV APR

No_of_days 27 25 28 26 27 29

Sid 71 76 72 73 75 72

Subid 1 1 2 4 5 8

MONTHS2:
Tot_days 30 31 30 31 30 30 No_of_days 27 25 28 26 27 29 Sid 71 76 72 73 75 72 Subid 1 1 2 4 5 8

FIRST NORMAL FORM(1NF):


The months1 and months2 tables are in first normal form because 13. Each row is identified uniquely. 41 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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 42 | P a g e

ATTENDANCE MANAGEMENT SYSTEM ( 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), 43 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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) );

44 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

SNAPSHOTS OF TABLES

45 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

SEMESTER TABLE:
Semid 1 2 3 4 5 6 7 Semnm 1 2-1 2-2 3-1 3-2 4-1 4-2

SECTION TABLE:
Secid 1 2 3 Secnm A B C

STUDENT TABLE:
Sid 71 72 73 74 75 76 Sname Sowmya Pranathi Madhu Sruthi Sowmya Ramya Semid 5 5 7 3 7 3 Secid 1 1 2 2 3 3

TEACHER TABLE:
Tid 1 2 3 4 5 Tname Kavitha Gayathri Jaya Ujwala kavitha Subid 4 1 4 8 7 Secid 1 2 3 2 3

46 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

MONTHS1 TABLE:
Month APR JAN SEP JUL NOV APR No_of_days 27 25 28 26 27 29 Sid 71 76 72 73 75 72 Subid 1 1 2 4 5 8

MONTHS2 TABLE:

Tot_days 30 31 30 31 30 30

No_of_days 27 25 28 26 27 29

Sid 71 76 72 73 75 72

Subid 1 1 2 4 5 8

SUB1:
Subid 1 2 3 4 5 6 7 8 Subnm ca daa dc dbms edc et dms-1 ds

SUB2:
Subid 1 2 3 4 5 47 | P a g e Semid 5 5 5 5 2

ATTENDANCE MANAGEMENT SYSTEM 6 7 8 2 2 4

ATT1:
Sid 71 72 73 74 75 76 Tot no.of classes 80 65 78 75 60 80 No. of classes attended 60 60 78 72 55 70 Secid 1 1 2 2 3 3 Semid 5 5 7 3 7 3

ATT2:
Sid 71 72 73 74 75 76 Subnm 4 3 6 7 4 8 From1 25-JAN-11 25-JAN-11 25-SEP-11 20-APR-10 25-SEP-11 20-APR-10 To1 25-FEB-11 25-FEB-11 26-NOV-11 25-MAY-10 26-OCT-11 24-MAY-10

48 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

QUERIES

49 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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 7 3 92.307962 100 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.

50 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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); 51 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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 74 100 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. 52 | P a g e

ATTENDANCE MANAGEMENT SYSTEM 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 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. month

53 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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.

54 | P a g e

ATTENDANCE MANAGEMENT SYSTEM

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.

55 | P a g e

Вам также может понравиться