COMPUTER SCIENCE PROJECT FILE
Class: XI
Subject: Python & MySQL
Academic Year: 2025–26
Student Name: ____________________
Roll No: ____________________
School Name: ____________________
CERTIFICATE
This is to certify that the student has successfully completed the Computer
Science project based on Python and MySQL as per CBSE curriculum for
Class XI.
ACKNOWLEDGEMENT
I sincerely thank my Computer Science teacher and school for guidance and
support in completing this project.
SECTION A: PYTHON PROGRAMS
Program 1: Print Numbers 1 to 10
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
for i in range(1,11):
print(i)
Output: As per logic.
Program 2: Sum of Two Numbers
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
a=int(input())
b=int(input())
print(a+b)
Output: As per logic.
Program 3: Even or Odd
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
n=int(input())
if n%2==0:
print('Even')
else:
print('Odd')
Output: As per logic.
Program 4: Largest of Two Numbers
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
a=int(input())
b=int(input())
print(max(a,b))
Output: As per logic.
Program 5: Factorial
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
n=int(input())
f=1
for i in range(1,n+1): f*=i
print(f)
Output: As per logic.
Program 6: Prime Check
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
n=int(input())
flag=True
for i in range(2,n):
if n%i==0: flag=False
print('Prime' if flag else 'Not Prime')
Output: As per logic.
Program 7: Fibonacci
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
a,b=0,1
for i in range(10):
print(a)
a,b=b,a+b
Output: As per logic.
Program 8: Reverse Number
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
n=input()
print(n[::-1])
Output: As per logic.
Program 9: Palindrome
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
s=input()
print('Palindrome' if s==s[::-1] else 'Not')
Output: As per logic.
Program 10: Count Vowels
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
s=input()
v='aeiou'
c=0
for i in s:
if i in v: c+=1
print(c)
Output: As per logic.
Program 11: Sum of List
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
l=[1,2,3,4]
print(sum(l))
Output: As per logic.
Program 12: Average of Numbers
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
l=[2,4,6,8]
print(sum(l)/len(l))
Output: As per logic.
Program 13: Linear Search
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
l=[1,3,5]
x=3
print(x in l)
Output: As per logic.
Program 14: Bubble Sort
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
l=[4,2,1]
for i in range(len(l)):
for j in range(len(l)-1):
if l[j]>l[j+1]: l[j],l[j+1]=l[j+1],l[j]
print(l)
Output: As per logic.
Program 15: String Length
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
s=input()
print(len(s))
Output: As per logic.
Program 16: Uppercase String
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
s=input()
print([Link]())
Output: As per logic.
Program 17: Lowercase String
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
s=input()
print([Link]())
Output: As per logic.
Program 18: File Write
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
f=open('[Link]','w')
[Link]('Hello')
[Link]()
Output: As per logic.
Program 19: File Read
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
f=open('[Link]','r')
print([Link]())
[Link]()
Output: As per logic.
Program 20: Dictionary Example
Aim: To write a Python program.
Algorithm: Logic based steps.
Program Code:
d={'a':1,'b':2}
print(d)
Output: As per logic.
SECTION B: MySQL PROGRAMS
Program 1: Create Database
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
CREATE DATABASE school;
Output: Command executed successfully.
Program 2: Use Database
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
USE school;
Output: Command executed successfully.
Program 3: Create Table
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
CREATE TABLE student(roll INT, name VARCHAR(20));
Output: Command executed successfully.
Program 4: Insert Record
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
INSERT INTO student VALUES(1,'Aman');
Output: Command executed successfully.
Program 5: Insert Multiple
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
INSERT INTO student VALUES(2,'Ravi');
Output: Command executed successfully.
Program 6: Select All
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT * FROM student;
Output: Command executed successfully.
Program 7: Where Clause
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT * FROM student WHERE roll=1;
Output: Command executed successfully.
Program 8: Update Record
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
UPDATE student SET name='Ram' WHERE roll=1;
Output: Command executed successfully.
Program 9: Delete Record
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
DELETE FROM student WHERE roll=2;
Output: Command executed successfully.
Program 10: Order By
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT * FROM student ORDER BY name;
Output: Command executed successfully.
Program 11: Distinct
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT DISTINCT name FROM student;
Output: Command executed successfully.
Program 12: Like
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT * FROM student WHERE name LIKE 'A%';
Output: Command executed successfully.
Program 13: Between
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT * FROM student WHERE roll BETWEEN 1 AND 5;
Output: Command executed successfully.
Program 14: Count
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT COUNT(*) FROM student;
Output: Command executed successfully.
Program 15: Sum
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT SUM(roll) FROM student;
Output: Command executed successfully.
Program 16: Avg
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT AVG(roll) FROM student;
Output: Command executed successfully.
Program 17: Min
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT MIN(roll) FROM student;
Output: Command executed successfully.
Program 18: Max
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
SELECT MAX(roll) FROM student;
Output: Command executed successfully.
Program 19: Drop Table
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
DROP TABLE student;
Output: Command executed successfully.
Program 20: Drop Database
Aim: To write MySQL query.
Algorithm: Execute SQL command.
SQL Query:
DROP DATABASE school;
Output: Command executed successfully.