0% found this document useful (0 votes)
5 views2 pages

Class12 School Management Python SQL Project

The document outlines a project for a School Management System developed using Python and SQL, enabling the management of student data including admission number, name, class, section, and marks. It includes objectives such as understanding Python-SQL connectivity, managing student records, and performing database operations. The project features a Python program that allows users to add, show, search, and delete student records from a SQL database.

Uploaded by

biswajit9182
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Class12 School Management Python SQL Project

The document outlines a project for a School Management System developed using Python and SQL, enabling the management of student data including admission number, name, class, section, and marks. It includes objectives such as understanding Python-SQL connectivity, managing student records, and performing database operations. The project features a Python program that allows users to add, show, search, and delete student records from a SQL database.

Uploaded by

biswajit9182
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Class XII Computer Science Project: School

Management System (Python + SQL)

This project demonstrates a simple School Management System using Python and SQL. It allows storing
and managing student data such as admission number, name, class, section and marks using a database.
Python is used to connect with the SQL database and perform operations like insert, search, update and
delete.

Objectives

Objectives of the Project:


1. To understand how Python connects with SQL databases.
2. To create and manage student records.
3. To perform database operations such as INSERT, SELECT, UPDATE and DELETE.
4. To build a basic management system used in schools.

SQL Table Creation

SQL Database Creation:

CREATE DATABASE school;

USE school;

CREATE TABLE students(


adm_no INT PRIMARY KEY,
name VARCHAR(50),
class VARCHAR(10),
section VARCHAR(5),
marks INT
);

Python Program

Python Program (Using MySQL Connectivity)

import [Link]

db = [Link](
host="localhost",
user="root",
password="1234",
database="school"
)

cursor = [Link]()

def add_student():
adm = int(input("Enter Admission No: "))
name = input("Enter Name: ")
cls = input("Enter Class: ")
sec = input("Enter Section: ")
marks = int(input("Enter Marks: "))

q = "INSERT INTO students VALUES(%s,%s,%s,%s,%s)"


[Link](q,(adm,name,cls,sec,marks))
[Link]()
print("Student Added Successfully")

def show_students():
[Link]("SELECT * FROM students")
data = [Link]()
for i in data:
print(i)

def search_student():
adm = int(input("Enter Admission No: "))
q = "SELECT * FROM students WHERE adm_no=%s"
[Link](q,(adm,))
data = [Link]()
print(data)

def delete_student():
adm = int(input("Enter Admission No: "))
q = "DELETE FROM students WHERE adm_no=%s"
[Link](q,(adm,))
[Link]()
print("Record Deleted")

while True:
print("[Link] Student")
print("[Link] Students")
print("[Link] Student")
print("[Link] Student")
print("[Link]")

ch = int(input("Enter Choice: "))

if ch==1:
add_student()
elif ch==2:
show_students()
elif ch==3:
search_student()
elif ch==4:
delete_student()
elif ch==5:
break
else:
print("Invalid Choice")

Conclusion

Conclusion: This project shows how Python can be used with SQL to manage school records. Such
systems help schools maintain student information digitally and make data retrieval faster and easier.

You might also like