Sukin - CS Project
Sukin - CS Project
MAMBAKKAM
SENIOR SECONDARY
CERTIFICATE EXAMINATION
1
BONAFIDE CERTIFICATE
This is to certify that this COMPUTER SCIENCE Investigatory Project on the topic
Senior Secondary Certificate Examination-SSCE, CBSE, New Delhi for the academic
year 2024-2025.
Date: ...................
Ms.VENNILA
on.....................
Examiner
2
ACKNOWLEDGEMENT
The success of any project depends largely on people associated with it. I
these personalities.
I am also thankful to all our Teaching Staff and Non-Teaching Staff for
encouragement and support. Last but not the least I am thankful to the
Almighty.
SUKIN VICKRAM A V
XII - E
3
INDEX
S.N PAGE
CONTENTS
O NO
1 5
ABSTRACT
2 SYSTEM CONFIGURATION 6
INTRODUCTION
3 7
6 DATABASE CONNECTIVITY 14
7 SOURCE CODE 15
8 OUTPUT (SCREENSHOTS) 23
9 BIBLIOGRAPHY 27
4
ABSTRACT:
5
SYSTEM CONFIGURATION:
HARDWARE CONFIGURATION
SOFTWARE REQUIREMENTS
Shader Level 2)
recommended)
6
1024x768 or higher-resolution monitor
INTRODUCTION:
PYTHON:
7
PYTHON IS POPULAR:
Python has been growing in popularity over the last few years. The 2018
Stack Overflow Developer Survey ranked Python as the 7th most popular
and the number one most wanted technology of the year. World-class
software development countries around the globe use Python every single
day. According to research by Dice Python is also one of the hottest skills to
have and the most popular programming language in the world based on the
Popularity of programming Language Index.
Python is interpreted:
Many languages are compiled, meaning the source code you create needs to
be translated into machine code, the language of your computer's processor,
before it can be run. Programs written in an interpreted language are passed
straight to an interpreter that runs them directly. This makes for a quicker
development cycle because you just type in your code and run it without the
intermediate compilation step. Python is simple to use and handle.
MYSQL:
Types of DBMS:
8
There are mainly 4 types of DBMS, which are Hierarchical, Relational,
Network, and Object-Oriented DBMS,
Hierarchical DBMS: As the name suggests, this type of DBMS has a style
of predecessor successor type of relationship. So, it has a structure similar to
that of a tree. Where in the nodes represent records and the branches of the
tree represent fields.
SQL is the core of a relational database which is used for accessing and
managing the database. By using SQL you can add, update or delete row s of
data, retrieve subset of information, modify databases and perform many
actions. The different subsets of SQL are as follows,
10
High Availability - MYSQL can run high-speed master slave
replication configurations and it offers cluster servers.
Scalability & Flexibility - With MYSQL you can run deeply
embedded applications and create data warehouses holding a
humongous amount of data.
11
RELATION BETWEEN
While working with Python we need to work with databases, they may be
MySQL Connector/Python.
databases with the Python programs, it does that using the Python
Database API Specification v2.0 (PEP 249). It uses the Python standard
12
MYSQL QUERIES USED IN
THIS PROJECT:
Create Database
Create Table
Insert Query
Select Query
Delete Query
Update Query
13
DATABASE CONNECTIVITY:
Arguments required to connect MySQL from Python:
You need to know the following detail of the MySQL server to perform
the connection from Python.
Username -i.e., the username that you use to work with MYSQL
Server. The default username for the MySQL database is a root.
Password - Password is given by the user at the time of installing
the MYSQL database. If you are using root then you won't need the
password.
Host Name - is the server name or IP address on which MySQL is
running. If you are running on local host, then you can use local
host, or it's IP, i.e. 127.0.0.0
Database Name - Database name to which you want to connect.
14
SOURCE CODE:
import mysql.connector
mydb=mysql.connector.connect(host='localhost',user='root')
mycursor=mydb.cursor()
mycursor.execute("USE LIBRARY")
mycursor.execute(rec)
mydb.close()
mycon=mysql.connector.connect(host='localhost',user='root',database='LIB
RARY')
mycur=mycon.cursor()
15
def insertbook():
data=(bno,bname,bauth,bprice,bqty)
mycur.execute(qry,data)
mycon.commit()
def displaybook():
mycur.execute(qry)
data=mycur.fetchall()
count=mycur.rowcount
16
for (bno,bname,bauth,bprice,bqty) in data:
print("Book Quantity:\t",bqty)
print(".................................")
def searchbook():
rec=(bno,)
mycur.execute(qry,rec)
data=mycur.fetchall()
count=mycur.rowcount
if count!=0:
print("Book Code:\t",bno)
17
print("Book Name:\t",bname)
print("Book Author:\t",bauth)
print("Book Price:\t",bprice)
print("Book Quantity:\t",bqty)
print(".................................")
else:
def deletebook():
rec=(bno,)
mycur.execute(qry,rec)
data=mycur.fetchall()
count=mycur.rowcount
if count!=0:
print("Book Code:\t",bno)
18
print("Book Name:\t",bname)
print("Book Author:\t",bauth)
print("Book Price:\t",bprice)
print("Book Quantity:\t",bqty)
print(".................................")
if opt=="Y" or opt=="y" :
rec=(bno,)
mycur.execute(qry,rec)
mycon.commit()
else:
def updatebook():
mycur.execute(qry,rec)
data=mycur.fetchall()
count=mycur.rowcount
if count!=0:
print("Book Code:\t",bno)
print("Book Name:\t",bname)
print("Book Author:\t",bauth)
print("Book Price:\t",bprice)
print("Book Quantity:\t",bqty)
print(".................................")
if opt=="Y" or opt=="y" :
%s WHERE bno=%s")
rec=(bname,bauth,bprice,bqty,bno)
mycur.execute(qry,rec)
mycon.commit()
else:
while True :
print("==================================")
21
print("\t\t 6. EXIT")
print("==================================")
if choice==1:
elif choice==2:
elif choice==3:
elif choice==4:
elif choice==5:
elif choice==6:
mycon.close()
break
else :
22
OUTPUT:
23
24
25
26
27
BIBLIOGRAPHY:
www.youtube.com
www.wikipedia.com
www.google.com
https://www.geeksforgeeks.org/connect-mysql-
database-using-mysql-connector-python/
28