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

INTRODUCTION

Python
Python is a computer programming language often used to build websites
and software, automate tasks, and conduct data analysis. Python is a
general-purpose language, meaning it can be used to create a variety of
different programs and isn’t specialized for any specific problems. This
versatility, along with its beginner-friendliness, has made it one of the
most-used programming languages today.
Python is commonly used for developing websites and software, task
automation, data analysis, and data visualization. Since it’s relatively easy
to learn, Python has been adopted by many non-programmers such as
accountants and scientists, for a variety of everyday tasks, like organizing
finances.
What can you do with python? Some things include:
• Data analysis and machine learning
• Web development
• Automation or scripting
• Software testing and prototyping
• Everyday tasks

Python is popular for a number of reasons. Here’s a deeper look at what


makes it so versatile and easy to use for coders.
• It has a simple syntax that mimics natural language, so it’s easier to
read and understand. This makes it quicker to build projects, and
faster to improve on them.

1
• It’s versatile. Python can be used for many different tasks, from web
development to machine learning.
• It’s beginner friendly, making it popular for entry-level coders.
• It’s open source, which means it’s free to use and distribute, even for
commercial purposes.
• Python’s archive of modules and libraries—bundles of code that
third-party users have created to expand Python’s capabilities—is
vast and growing.
SQL
SQL is Structured Query Language, which is a computer language for
storing, manipulating and retrieving data stored in a relational database.
SQL is the standard language for Relational Database System. All the
Relational Database Management Systems (RDMS) like MySQL, MS
Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as
their standard database language.
SQL is widely popular because it offers the following advantages −
• Allows users to access data in the relational database management
systems.
• Allows users to describe the data.
• Allows users to define the data in a database and manipulate that
data.
• Allows to embed within other languages using SQL modules,
libraries & pre-compilers.
• Allows users to create and drop databases and tables.
• Allows users to create view, stored procedure, functions in a

2
database.
• Allows users to set permissions on tables, procedures and views.

MYSQL connector

• MySQL Connector/Python includes support for almost all features


provided by MySQL Server up to and including MySQL Server
version 8.0. Converting parameter values back and forth between
Python and MySQL data types, for example Python datetime and
MySQL DATETIME. You can turn automatic conversion on for
convenience, or off for optimal performance.

• All MySQL extensions to standard SQL syntax. Protocol


compression, which enables compressing the data stream between
the client and server. Connections using TCP/IP sockets and on
Unix using Unix sockets. Secure TCP/IP connections using SSL.
Self-contained driver. Connector/Python does not require the
MySQL client library or any Python modules outside the standard

3
library.

• MySQL Connector/Python enables Python programs to access


MySQL databases, using an API that is compliant with the Python
Database API Specification v2. 0 (PEP 249). It is written in pure
Python and does not have any dependencies except for the Python
Standard Library. It has a built in function at python
(mysql.connector.connect()) that use the connector which you
installed in step 2 at section 1. This function makes the link between
python and the database.

The function accept 4 inputs as follows:


1. The host: here it is local host as your database on your pc not at the
server.
2. The user’s name: which you set when you create your database after
downloading the MySQL. Usually it is” root”.
3. The password: which you set when creating the database.
4. The database: the name of the database you created. Now you
created a database and link it to python and the result of the connection
is at the variable connection.
Steps for connecting MySQL with Python
STEP 1: Start Python
STEP 2: Import the packages required for database programming
STEP3: Open a connection to database
STEP 4: Create a cursor instance
STEP 5: Execute a Query
STEP 6: Extract data from result set
4
STEP 7: Clean up the environment use it
Code for Establishing MySQL Connectivity with Python
import mysql.connector
conn=mysql.connector.connect(host='localhost',
username='root',password='python', database='airlines_booking')
my_cursor = conn.cursor()
my_cursor.execute()
con.commit()

5
OBJECTIVE AND SCOPE OF THE PROJECT
The objective of the software project is to a computerized Data
Management System to automate the admission and retrieval
formalities of a school. It also aims to improve the current database
management system of the school which will help the authorities to
retrieve the up-to-date in the right time.
This software enables us to retrieve, update and delete from a
centralized database designed with the of MySQL. The software only
takes a limited time of the users.
During the development of this Database Management System Project,
python IDLE acted as an important open-source event driven
development system which can be further used in the expandability of
the system in the future.
Despite being the best efforts of our team, there are certain
limitations and boundaries for the project, which do limit the
further scope of this project.
This software can only store records and produce reports in pre-
designed format in soft copy as developed by our team.

6
THEORETICAL KNOWLEDGE
My SQL

While working with an application, it is required to save data


permanently on some secondary storage device, which is usually the
hard disc, to retrieve the data for future reference, modification,
deletion, etc. An application usually stores a lot of data in the form of
a database that is not directly accessible to the user. This database is
used by the application to give suitable responses to the user. This
database is called Back-end Database. In Class XI, we have learnt how
to create databases, tables and to perform query processing on these
tables using SQL commands like CREATE, UPDATE, ALTER,
INSERT, DELETE, SELECT and so on in various forms according to
their specific syntax structures.

MySQL, the most popular Open-Source SQL database


management system, is developed, distributed, and supported by
Oracle.

The Main Features of MySQL:


• Written in C and C++.

• Works on many different platforms.

• Uses multi-layered server design with. Independent modules.

• Provides transactional and non-transactional storage engines.

• Designed to make it relatively easy to add other storage engines.

• This is useful if you want to provide an SQL interface for an in-


7
house database.

• Uses a very fast thread-based memory allocation system.

• Executes very fast joins using an optimized nested-loop join.

• Implements SQL functions using a highly optimized class hotel


that should be as fast as possible. Usually, there is no memory
allocation at all after query initialization.

Why Python?
Python is a flexible, portable, easy to learn and modifiable
language. So, we are integrating MySQL with Python Interface for
executing any database applications. The various reasons to use
Python for programming database applications are:
• Programming in Python is arguably more efficient and
faster compared to other languages.
• Python is famous for its portability.

• It is platform-independent. Python support SQL cursors.

• In many programming languages, the application developer


needs to take care of the open and closed connection of the
database, to avoid further exceptions and errors. In Python, these
connections are taken care of.
• Python supports relational database systems.

• Python database APIs are compatible with various databases, so


it is very easy to migrate and port database application
interfaces.

8
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS

Processor: Intel Pentium 1.5ghz

RAM:1GB

Disk Space:1GB

SOFTWARE REQUIREMENTS

Operating System: WINDOWS 7


PYTHON 3.10.2.
MySQL SERVER 6.0
MySQL CONNECTOR 5.1

9
SYSTEM DESIGN AND DEVELOPMENT
DATABASE DESIGN
An important aspect of system design is the design of data storage
structure. To begin with, a logical model of data structure is developed as
a container object which contains tables, queries, reports data validation
policies enforcement rules or constraints etc. Logical data often
represented as records are kept in different tables after reducing
anomalies and redundancy. The goodness of database design lies in the
table structure and its relationship. This software project maintains a
database named project which contains the following tables.
MENU DESIGN:

The menu system is divided into menu bars, each having a pull-down
menu containing options for a specific task.
S.No Menu Bar Purpose
1 View student profile To view or access student profile
2 Add new profile To add a new student profile
3 Update student profile To update the student profile
4 Delete profile To delete a student profile
To display the facilities
5 Facilities provided
provided by the school
6 Display mark list To display the mark list of a student

7 Insert mark list To insert the mark list of a student


8 Fee’s structure To display the fees’ structure
9 Noticeboard To display the events held in the school
10
The database of banana2 contains the following tables.

TABLE: FEES

Field Type
Sno Int(11)
Classes Varchar(90)

First term int(11)


Second term int(11)
Third term int(11)

TABLE: MARKLIST

Field Type
Snom int(11)
Admno int(11)
Name Varchar(56)
Classes Varchar(31)
Maths int(11)
Computer int(11)
English int(11)
Physics int(11)
Chemistry int(11)
Biology int(11)

11
TABLE: YELLOW2

Sno Data type


Name varchar(90)
Dob varchar(30)
Classes Varchar(30)
Fathers_name Varchar(90)
Mothers_name Varchar(90)
Phone no Int(11)
Occupation _of Varchar(90)
_guardian
Address Varchar(90)
Religion Varchar(90)
Caste Varchar(90)
Sibiling Varchar(90)
Height Int(11)
Weight Int(11)
Blood group Varchar(90)
TABLE: NOTICEBOARD

Field Type
Sno Int(11)
Events Varchar(1000)

12
SOURCE CODE

import mysql.connector as mc
cb=mc.connect(host='localhost',user='root',passwd='1234',database='bana
na2')
cr=cb.cursor(buffered=True)
def insert():
sno=int(input("enter the serial number:"))
admno=int(input("enter the admission number:"))
name=input("enter the name:")
dob=input("enter the date of birth:")
classes=input("enter the class:")
fathers_name=input("enter name of father:")
mothers_name=input("enter name of mother:")
phno=int(input("enter the phone number:"))
occupation_of_guardian=input("enter occupation of the guardian:")
address=input("enter your address:")
religion=input("enter your religion:")
caste=input("enter your caste:")
siblings=input("enter the number of siblings:")
height=int(input("enter your height:"))
weight=int(input("enter your weight:"))
blood_group=input("enter your blood group:")
cr.execute("insert into yellow2
values(%s,%s,'%s',%s,'%s','%s','%s',%s,'%s','%s','%s','%s','%s',%s,%s,'%s'
)"%(sno,admno,name,dob,classes,fathers_name,mothers_name,phno,occu
13
pation_of_guardian,address,religion,caste,siblings,height,weight,blood_gr
oup))
cr.execute('select * from yellow2 where admno=%s'%(admno))
print(cr.fetchone())
cb.commit()
print()
def delete():
admn=int(input("enter the admission number:"))
cr.execute("delete from yellow2 where admno=%s"%(admn))
cb.commit()
print()
def update():
print('select your choice')
print('1.class')
print('2.phonenumber')
print('3.occupation of guardian')
print('4.address')
print('5.siblings')
print('6.height')
print('7.weight')
bc=int(input('enter your choice which you want to update:'))
bh=int(input("enter the new value:"))
eh=int(input("enter your admission number"))
if bc==1:
cr.execute("update yellow2 set classes=%s where admno=%s"
%(bh,eh))
14
cr.execute('select * from yellow2 where admno=%s' %(eh,))
cb.commit()
print(cr.fetchone())
elif bc==2:
cr.execute("update yellow2 set phno=%s where admno=%s"
%(bh,eh))
cr.execute("select * from yellow2 where admno=%s" %(eh))
cb.commit()
print(cr.fetchone())
elif bc==3:
cr.execute("update yellow2 set occupation_of_guardian='%s' where
admno=%s"%(bh,eh))
cr.execute('select * from yellow2 where admno=%s' %(eh))
cb.commit()
print(cr.fetchone())
elif bc==4:
cr.execute('update yellow2 set address="%s" where
admno=%s'%(bh,eh))
cr.execute('select * from yellow2 where admno=%s'%(eh))
cb.commit()
print(cr.fetchone())
elif bc==5:
cr.execute('update yellow2 set siblings=%s where admno=%s'
%(bh,eh))
cr.execute("select * from yellow2 where admno=%s"%(eh))
cb.commit()
15
print(cr.fetchone())
elif bc==6:
cr.execute('update yellow2 set height=%s where admno=%s'
%(bh,eh))
cr.execute('select * from yellow2 where admno=%s'%(eh))
cb.commit()
print(cr.fetchone())
else:
cr.execute('update yellow2 set weight=%s where admno=%s'
%(bh,eh))
cr.execute('select * from yellow2 where admno=%s'%(eh))
cb.commit()
print(cr.fetchone())
print()
def display():
cv=int(input('enter your admission number:'))
cr.execute('select * from yellow2 where admno=%s'%(cv))
print(cr.fetchone())
print()
def marklistdisplay():
hh=int(input("enter your admission number:"))
a=cr.execute('select * from marklist where admno=%s'%(hh))
print(a)
print()
def marklistinsert():
snom=int(input("enter the serial number:"))
16
admno=int(input("enter the admission number:"))
name=input("enter the name:")
classes=input("enter the class:")
maths=int(input("enter the maths score:"))
computer=int(input('enter the computer score:'))
english=int(input("enter the english score:"))
physics=int(input("enter the physics score:"))
chemistry=int(input("enter the chemistry score:"))
biology=int(input("enter the biology score:"))
cr.execute('insert into marklist
values(%s,%s,"%s","%s",%s,%s,%s,%s,%s,%s)'%(snom,admno,name,cla
sses,maths,computer,english,physics,chemistry,biology))
cr.execute('select * from marklist where admno=%s'%(admno))
print(cr.fetchone())
cb.commit()
print()
def fees():
cr.execute("select * from fees")
print(cr.fetchall())
cb.commit()
print()
def noticeboard():
cr.execute("select * from noticeboard")
print(cr.fetchall())
cb.commit()
print()
17
print(' OXFORD INTERNATIONAL SCHOOL')
print()
print('-'*80)
print()
print()
print(' LET YOUR CHILD ENJOY THE WORLD OF
KNOWLEDGE')
print()
while True:
print('1.VIEW STUDENT PROFILE')
print('2.ADD NEW PROFILE')
print('3.UPDATE STUDENT PROFILE')
print('4.DELETE PROFILE')
print('5.FACILITIES PROVIDED')
print('6.DISPLAY MARKLIST')
print('7.INSERT MARKLIST')
print('8.FEES STRUCTURE')
print('9.NOTICEBOARD')
print('10.EXIT')
ss=int(input('enter your choice:'))
if ss==1:
display()
elif ss==2:
insert()
elif ss==3:
update()
18
elif ss==4:
delete()
elif ss==5:
print(' OUR KEY FEATURES')
print()
print('*.Highly experienced and skilled faculties')
print('*.Air conditioned classrooms with smart board facilities')
print('*.High tech labs')
print('*.Relishing environment with eco garden')
print('*.Open playground with football turf,children_s
park,basketball and badminton courts')
print('*.Provides extra curricular activities')
print('*.Advanced restrooms')
print('*.Canteen with all delicacies')
print()
elif ss==6:
marklistdisplay()
elif ss==7:
marklistinsert()
elif ss==8:
fees()
elif ss==9:
noticeboard()
else:
print("THANK YOU")
break
19
OUTPUT

20
VIEW STUDENT PROFILE

1.VIEW STUDENT PROFILE

2.ADD NEW PROFILE

3.UPDATE STUDENT PROFILE

4.DELETE PROFILE

5.FACILITIES PROVIDED

6.DISPLAY MARKLIST

7.INSERT MARKLIST

8.FEES STRUCTURE

9.NOTICEBOARD

10.EXIT

enter your choice:1

enter your admission number:1000

(1, 1000, 'Fiza', '2005-01-01', '12', 'dash', 'haritha', 837292220,


'professor', 'IIT madras', 'Islam', 'Mappila', '1', 164, 50, 'o+ve')

ADD NEW PROFILE

1.VIEW STUDENT PROFILE

2.ADD NEW PROFILE

3.UPDATE STUDENT PROFILE

4.DELETE PROFILE

5.FACILITIES PROVIDED

6.DISPLAY MARKLIST

21
7.INSERT MARKLIST

8.FEES STRUCTURE

9.NOTICEBOARD

10.EXIT

enter your choice:2

enter the serial number:6

enter the admission number:1006

enter the name:ponn

enter the date of birth:2005-01-10

enter the class:12

enter name of father:alaghan

enter name of mother:sheela

enter the phone number:988985059

enter occupation of the guardian:doctor

enter your address:pallikaranai

enter your religion:hindu

enter your caste:general

enter the number of siblings:1

enter your height:180

enter your weight:79

enter your blood group:b-ve

(6, 1006, 'ponn', '1994', '12', 'alaghan', 'sheela', 988985059, 'doctor',

22
'pallikaranai', 'hindu', 'general', '1', 180, 79, 'b-ve')

UPDATE STUDENT PROFILE

1.VIEW STUDENT PROFILE

2.ADD NEW PROFILE

3.UPDATE STUDENT PROFILE

4.DELETE PROFILE

5.FACILITIES PROVIDED

6.DISPLAY MARKLIST

7.INSERT MARKLIST

8.FEES STRUCTURE

9.NOTICEBOARD

10.EXIT

enter your choice:3

select your choice

1.class

2.phonenumber

3.occupation of guardian

4.address

5.siblings

6.height

7.weight

enter your choice which you want to update:1

23
enter the new value:11

enter your admission number1006

(6, 1006, 'ponn', '1994', '11', 'alaghan', 'sheela', 988985059, 'doctor',


'pallikaranai', 'hindu', 'general', '1', 180, 79, 'b-ve')
DELETE PROFILE
1.VIEW STUDENT PROFILE
2.ADD NEW PROFILE
3.UPDATE STUDENT PROFILE
4.DELETE PROFILE
5.FACILITIES PROVIDED
6.DISPLAY MARKLIST
7.INSERT MARKLIST
8.FEES STRUCTURE
9.NOTICEBOARD
10.EXIT
enter your choice:4
enter the admission number:1006

FACILITIES PROVIDED

1.VIEW STUDENT PROFILE

2.ADD NEW PROFILE

3.UPDATE STUDENT PROFILE

4.DELETE PROFILE

5.FACILITIES PROVIDED
24
6.DISPLAY MARKLIST

7.INSERT MARKLIST

8.FEES STRUCTURE

9.NOTICEBOARD

10.EXIT

enter your choice:5

OUR KEY FEATURES

*.Highly experienced and skilled faculties

*.Air conditioned classrooms with smart board facilities

*.High tech labs

*.Relishing environment with eco garden

*.Open playground with football turf,children_s park,basketball and


badminton courts

*.Provides extra curricular activities

*.Advanced restrooms

*.Canteen with all delicacies


DISPLAY MARKLIST
1.VIEW STUDENT PROFILE
2.ADD NEW PROFILE
3.UPDATE STUDENT PROFILE
4.DELETE PROFILE
5.FACILITIES PROVIDED
6.DISPLAY MARKLIST
25
7.INSERT MARKLIST
8.FEES STRUCTURE
9.NOTICEBOARD
10.EXIT
enter your choice:6
enter your admission number:1000
(1, 1000, 'Fiza', '12', 99, 98, 99, 100, 99, 100)
INSERT MARKLIST
1.VIEW STUDENT PROFILE
2.ADD NEW PROFILE
3.UPDATE STUDENT PROFILE
4.DELETE PROFILE
5.FACILITIES PROVIDED
6.DISPLAY MARKLIST
7.INSERT MARKLIST
8.FEES STRUCTURE
9.NOTICEBOARD
10.EXIT
enter your choice:7
enter the serial number:3
enter the admission number:1003
enter the name:Abdullah
enter the class:11
enter the maths score:76
enter the computer score:67
26
enter the english score:78
enter the physics score:98
enter the chemistry score:78
enter the biology score:56
(3, 1003, 'Abdullah', '11', 76, 67, 78, 98, 78, 56)
FEES STRUCTURE
1.VIEW STUDENT PROFILE
2.ADD NEW PROFILE
3.UPDATE STUDENT PROFILE
4.DELETE PROFILE
5.FACILITIES PROVIDED
6.DISPLAY MARKLIST
7.INSERT MARKLIST
8.FEES STRUCTURE
9.NOTICEBOARD
10.EXIT
enter your choice:8
[(1, '1', 65550, 4550, 4550), (2, '2', 6600, 4600, 4500), (3, '3', 6650, 4650,
4650), (4, '4', 6700, 4700, 4700), (5, '5', 6750, 4750, 4750), (6, '6', 6800,
4800, 4800), (7, '7', 6850, 4850, 4850), (8, '8', 6900, 4900, 5900), (9, '9',
6950, 4950, 4950), (10, '10', 7000, 5000, 5000), (11, '11', 7050, 5050,
5050), (11, '11', 7100, 5100, 5100), (12, '12', 7150, 5150, 5150)]
NOTICEBOARD
1.VIEW STUDENT PROFILE
2.ADD NEW PROFILE
3.UPDATE STUDENT PROFILE
27
4.DELETE PROFILE
5.FACILITIES PROVIDED
6.DISPLAY MARKLIST
7.INSERT MARKLIST
8.FEES STRUCTURE
9.NOTICEBOARD
10.EXIT
enter your choice:9
[(1, 'The academic year starts at June1'), (2, 'The school science
exhibition is to be conducted on august 5'), (3, 'All the students are
requested to wear uniform socks and shoes from october 1'), (4, 'The
school sports meet is to be held on september 25'), (5, 'All the students
are requested to strictly follow the rules and regulations of the school'),
(6, 'All the students are asked to bring the school diary everyday')]
OXFORD INTERNATIONAL SCHOOL
--------------------------------------------------------------------------------
LET YOUR CHILD ENJOY THE WORLD OF KNOWLEDGE
EXIT
1.VIEW STUDENT PROFILE
2.ADD NEW PROFILE
3.UPDATE STUDENT PROFILE
4.DELETE PROFILE
5.FACILITIES PROVIDED
6.DISPLAY MARKLIST
7.INSERT MARKLIST
28
8.FEES STRUCTURE
9.NOTICEBOARD
10.EXIT
enter your choice:10
THANK YOU

29
CONCLUSION & FUTURE ENHANCEMENTS
The solutions are given as a proposal. The suggestion is revised on user
request and optimal changes are made. This loop terminates as soon as the
user is gratified with the proposal. So, on the whole, system analysis is
done to improve the system performance by monitoring it and obtaining
the best throughput possible from it. Therefore, system analysis plays a
crucial role in designing any system. This is basically an interface of
global distribute system to carry out school admission process, check the
fee structure, mark of students and access or change the biodata of
students.
The project is a console application where you can navigate via entering
certain numeric keys. The system can make users work faster and reliable
when it comes to inputting data. Using this system, you can efficiently
check the data of students, add a new student’s data into the database,
check the fee structure of each student and class, check the marks of the
students, check the noticeboard announcements and add modifications to
all the aspects of data. It is an access and storage portal for the school
regarding the students and activities in school.

30
BIBLIOGRAPHY
1. http://www.google.com/

2. http://en.wikipedia.org

Text Books

1. Computer Science with Sumita Arora Class XI

2. Computer Science with Sumita Arora Class XII

31

You might also like