0% found this document useful (0 votes)
17 views18 pages

Computer Science Pratical COMPLETED

computer science project work class 12th cbse

Uploaded by

vandan narkhede
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)
17 views18 pages

Computer Science Pratical COMPLETED

computer science project work class 12th cbse

Uploaded by

vandan narkhede
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
You are on page 1/ 18

STUDENT

MANAGEMENT
SYSTEM WITH
PYTHON AND SQLITE
INTEGRATION
1 COMPUTER SCIENCE PROJECT WORK

CAMBRIDGE INTERNATIONAL SCHOOL

NAME OF THE STUDENT: - Vandan Subhash Narkhede


CLASS/SEC: - 12th, A
SUBJECT: - Computer Science
TITLE OF THE PROJECT: - Student Management System with Python and SQLite
Integration

1
2 COMPUTER SCIENCE PROJECT WORK

Certificate

This is to certify that the project titled “Student Management System with
Python and SQLite Integration” is the original work of Vandan Subhash
Narkhede, a student of Class 12th, A Cambridge International School. This
project was undertaken in partial fulfilment of the computer science curriculum
under the guidance of our computer teacher.

Signature of Student Signature of Teacher

2
3 COMPUTER SCIENCE PROJECT WORK

Acknowledgment
I would like to express my sincere gratitude to my computer teacher for their
constant support and guidance throughout this project. I would also like to thank
my school for providing the resources required for this study on this project.

3
4 COMPUTER SCIENCE PROJECT WORK

Hardware and Software Requirements

HARDWARE

 PC

SOFTWARE

 Python 3.x
 SQLite
 SQLite3 Connector for Python

4
5 COMPUTER SCIENCE PROJECT WORK

Introduction

This project is a Student Management System with Python and SQLite


Integration System that allows administrators to manage a list of students,
including adding new students, viewing all student records, updating student
information, and deleting records. This project demonstrates the integration of
Python and SQL, using Python to handle application logic and SQLite for data
storage.

5
6 COMPUTER SCIENCE PROJECT WORK

Objective

The objective of this project is to apply knowledge of Python and SQL to create
a system that performs basic database operations. This project provides practical
experience in using SQL queries within Python to perform CRUD operations
(Create, Read, Update, and Delete) on a database.

6
7 COMPUTER SCIENCE PROJECT WORK

Project Code

import sqlite3

# Connect to SQLite database (or create it if it doesn't exist)

conn = sqlite3.connect('students.db')

cursor = conn.cursor()

# Create the students table if it doesn't exist

cursor.execute('''CREATE TABLE IF NOT EXISTS students (

id INTEGER PRIMARY KEY AUTOINCREMENT,

name TEXT NOT NULL,

age INTEGER,

grade TEXT)''')

conn.commit()

# Function to add a new student

def add_student():

name = input("Enter student's name: ")

age = int(input("Enter student's age: "))

grade = input("Enter student's grade: ")

cursor.execute("INSERT INTO students (name, age, grade) VALUES (?, ?, ?)", (name, age, grade))

conn.commit()

print("Student added successfully!")

# Function to view all students

def view_students():

cursor.execute("SELECT * FROM students")

students = cursor.fetchall()

7
8 COMPUTER SCIENCE PROJECT WORK

if students:

for student in students:

print(f"ID: {student[0]}, Name: {student[1]}, Age: {student[2]}, Grade: {student[3]}")

else:

print("No student records found.")

# Function to update a student's information

def update_student():

student_id = int(input("Enter the student's ID to update: "))

name = input("Enter the new name: ")

age = int(input("Enter the new age: "))

grade = input("Enter the new grade: ")

cursor.execute("UPDATE students SET name = ?, age = ?, grade = ? WHERE id = ?", (name, age, grade,
student_id))

if cursor.rowcount:

conn.commit()

print("Student updated successfully!")

else:

print("Student ID not found.")

# Function to delete a student record

def delete_student():

student_id = int(input("Enter the student's ID to delete: "))

cursor.execute("DELETE FROM students WHERE id = ?", (student_id,))

if cursor.rowcount:

conn.commit()

print("Student deleted successfully!")

else:

print("Student ID not found.")

8
9 COMPUTER SCIENCE PROJECT WORK

# Main function to navigate options

def main():

while True:

print("\nStudent Management System")

print("1. Add Student")

print("2. View All Students")

print("3. Update Student")

print("4. Delete Student")

print("5. Exit")

choice = input("Enter your choice: ")

if choice == '1':

add_student()

elif choice == '2':

view_students()

elif choice == '3':

update_student()

elif choice == '4':

delete_student()

elif choice == '5':

print("Exiting the system.")

break

else:

print("Invalid choice. Please select a valid option.")

# Run the main function

main()

9
10 COMPUTER SCIENCE PROJECT WORK

# Close the connection when done

conn.close()

10
11 COMPUTER SCIENCE PROJECT WORK

Observations and Results

The Student Management System allows an administrator to manage student


records efficiently. Below are sample outputs demonstrating each function:

1. Adding a Student
o Added student: Alice (ID: 1, Age: 15, Grade: 10th)

11
12 COMPUTER SCIENCE PROJECT WORK

12
13 COMPUTER SCIENCE PROJECT WORK

2. Viewing Student Records

o Displayed records:
 (1, 'Alice', 15, '10th')

13
14 COMPUTER SCIENCE PROJECT WORK

3. Updating a Student's Information


o Updated record to: (1, 'Alice Johnson', 16, '11th')

14
15 COMPUTER SCIENCE PROJECT WORK

4. Deleting a Student Record


o Deleted student record with ID 1.

These outputs confirm that the project functions as intended and provides the
basic CRUD operations required for managing student

15
16 COMPUTER SCIENCE PROJECT WORK

Conclusion

The Student Management System project allowed me to integrate Python with


SQL and manage data through a relational database. This project was an
opportunity to understand how databases interact with applications, specifically
using CRUD operations. Through this project, I gained practical experience in
Python-SQL integration, which is valuable for future software development
projects.

16
17 COMPUTER SCIENCE PROJECT WORK

Bibliography

 Class 12 Computer Science Textbook


 Online resources on SQLite and Python integration

 Documentation from Python.org and SQLite.org

17

You might also like