Computer project
Computer project
SSCE – 2024-25
Roll No :
Name : SHAKURAH O
Title : STUDENT MANAGEMENT SOURCE CODE
2024-2025
NARAYANA EDUCATIONAL SOCIETY
NARAYANA E TECHNO SCHOOL
2b,Indhrakumari Street, Perumal Nagar Extn, Medavakkam, Chennai, Tamil Nadu 600100.
E mail: [email protected] Ph.No : 7337335474
Affiliation No. 56471
CERTIFICATE
The project report entitled.
This is to certify that this is the bonafide record of project work done
2024-2025.
Date:
_______________
First of all we thank our beloved parents for providing us the opportunity to study in
NARAYANA E TECHNO SCHOOL
We thank our beloved founder sri.DR. PONGURU NARAYANA for being our
motivational force for the completion of this project.
We thank our dean Sri. Madhusudhan & principal Sri. Madala Srinivasa Rao for
their exceptional support.
We thank our Computer Science teachers Smt .Sudharani and Smt. Gayathri T for
Last but not the least I thank all my friends who helped me in the completion of this
project.
CONTENTS
1. INTRODUCTION TO PYTHON
SOURCE CODE
REQUIREMENTS
WORKING DESCRIPTION
5. CODING
7. BIBLIOGRAPHY
5
INTRODUCTION TO PYTHON
History of Python
Python was developed by Guido van Rossum in the late eighties and early nineties at
the National Research Institute for Mathematics and Computer Science in the
Netherlands. Python is derived from many other languages, including ABC, Modula-3,
C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages. Python is
copyrighted. Like Perl, Python source code is now available under the GNU General
Public License (GPL). Python is now maintained by a core development team at the
institute, although Guido van Rossum still holds a vital role in directing its progress.
Python Features
• Easy-to-read − Python code is more clearly defined and visible to the eyes.
• A broad standard library − Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.
6
• Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
• Portable − Python can run on a wide variety of hardware platforms and has the
same interface on all platforms.
• Extendable − You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more
efficient.
• GUI Programming − Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows
MFC, Macintosh, and the X Window system of Unix.
• Scalable − Python provides a better structure and support for large programs
than shell scripting.
Apart from the above-mentioned features, Python has a big list of good features,
• It provides very high-level dynamic data types and supports dynamic type
checking.
• It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
The following operations can be performed on a file. In Python, File Handling consists of
following three steps:
TYPES OF FILE
Text Files- A file whose contents can be viewed using a text editor is called a text file. A
text file is simply a sequence of ASCII or Unicode characters. Python programs, contents
written in text editors are some of the example of text files.
Binary Files-A binary file stores the data in the same way as stored in the memory. The
.exe files, mp3 file, image files, word documents are some of the examples of binary files.
We can’t read a binary file using a text editor.
CSV Files: A Comma Separated Values (CSV) file is a plain text file that contains a list of
data. These files are often used for exchanging data between different applications. For
example, databases and contact managers often support CSV files.These files may sometimes
be called Character Separated Values or Comma Delimited files. They mostly use the comma
character to separate (or delimit) data, but sometimes use other characters, like semicolons.
8
SQL (Structured Query Language) :
Create Table: This DDL command is used to create a new table into any existing
database. The syntax of this command is as follows:
Syntax:
9
To see the structure of the above defined table is as follows
Sql> desc student ;
ALTER TABLE: This DDL command is used to add / modify a column in any
existing table of a database.
The syntax of this command is as follows:
Syntax:
Alter table <tablename> ADD/MODIFY/DROP ( column_name datatype size
constraints , column_name datatype size constraints , column_name datatype size
constraints , );
Example:
Task : To add a new column “ Phone “ having datatype char and size 12 in a table
student
Sql > alter table student ADD ( phone char (12)) ;
Task : To change the datatype of admno into char and increase the size as 5
Sql > alter table student MODIFY ( admno char(5));
Task : Delete a column DOB from the table student
Sql > alter table student drop DOB;
Drop Table ; This DDL command is used to remove a table from any existing
database.
This syntax of this command is as follows
Syntax
Drop table < table name>
Example
Sql> drop table student ;
10
Syntax :
insert into < table name > values ( value1, value2, value 3,. value N );
Example :
Task : Add a new row in a table student ( which we have created earlier)
Sql > Insert into student values ( ‘1234A’,12, ‘joshin gulati’,’’abcd’, ‘9-apr-2008’,
SELECT COMMAND : This DML command is used to retrieve information from any
table (s) to display/ list/ report on the screen, but this command cannot any how update/
Syntax : Select [ * / column list ] from < table name> [ where < condition > ]
Examples:
Where clause : it is used to restrict the no no of rows from being displayed on the screen
Task : display all the employees whose salary is greater than 1500
Update : This DML command is used to change/modify the record(s) of any table.
Syntax
Example
11
1. Update emp
2. update emp
DELETE : This DML command is used to delete a row/ tuple(s) from a table.
Syntax
Example
1. Delete from emp ; ( delete all the records leaving it’s structure intact)
Create View: This Command is used to create a new View in any existing database.
Syntax:
Select command
Example:
Drop View : This command is used to drop any existing view from the database.
Syntax
Example
12
Drop view abc;
They are essentially collection of tables and are connected with each other through
columns.
These database systems support SQL, which is used to create,access and manipulate data.
The python programming language has powerful features for database programming.
Python support various database servers like MySQL, Oracle, Sybase, mySQL,
For database programming the python DB-API is a widely used module that provides a
Usually the data inputted by the user along with the generated output is displayed but
not stored because all execution takes place in RAM which is a temporary memory and
Thus, when the application is executed the second time, it requires a new set of inputs
This can be overcome by sending the output generated and saving the input fetched from
The input is fetched from the user using python interface.This is known as FRONT END
An application usually stores a lot of data in the form of a database which is not directly
This database is used by the application to give suitable response to the user, This
13
Some important points are as follows:
connector.
code of connectivity.
Step 1. Start Python: start Python’s editor where you can create your python scripts,
i.e; IDLE.
database using connect(). This requires 4 parameters, the syntax for this is as follows:
Example:
import mysql.connector as m
Here we have to create an instance of cursor by using cursor(), the syntax for the following
is as follows:
<cursorobject> =<connectionobject>.cursor()
mycursor = mydb.cursor()
14
Step 5: Execute a query. Here we use be execute() with following syntax.
Step 6: Extract data from result set. Here you can fetch the data from the result set by using
fetch( ) functions.
• A Database Cursor is a special control structure that facilitates the row by row processing
of records in the resultset, i.e., the set of records retrieved as per query.
• The resultset refers to a logical set of records that are fetched from the database by
• You can use connect() method for establishing database connection. cursor() to create a
• For INSERT, UPDATE and DELETE queries, you must run commit() with the
15
SOURCE CODE
#Project on Student Management System
import mysql.connector
import os
exit='n'
while exit=='n':
os.system('cls')
print('-' * 90)
print('|'+' '*31+'STUDENT MANAGEMENT SYSTEM'+' ' * 32+
'|')
print('-' * 90)
print('| [I]nsert Record |', end='')
print(' [V]iew Record |', end='')
print(' [U]pdate Record |',end='')
print(' [D]elete Record |',end='')
print(' [E]XIT |')
print('-' * 90)
ch=input('YOUR Choice (I/V/U/D/E):')
ch = ch.upper()
if ch == 'I':
connection=mysql.connector.connect(host="localhost",
user="root", passwd="admin", db="school")
mycursor=connection.cursor()
choice='y'
while choice=='y':
count=0
for(rno,name)in mycursor:
count+=1
print('===========')
print('Student Roll No ',rno)
print('Student Name ',name)
print('===========')
if count%2==0:
print('press any key to continue')
system('cls')
print('total records',count,'found')
connection.commit()
connection.close()
elif ch == 'U':
connection=mysql.connector.connect(host="localhost",
user="root", passwd="admin", db="school")
mycursor=connection.cursor()
#mycursor.execute("""create table class12 (rno int, name
varchar(20))""")
choice='y'
while(choice=='y'):