CS XII - Project - SANNIDH
CS XII - Project - SANNIDH
A Project Report On
Roll No :
Name : SANNIDH .B
Class : XII
1
VELAMMAL BODHI CAMPUS
CERTIFICATE
2
DECLARATION
3
ACKNOWLEDGEMENT
Last but not the least I thank all my friends who helped me in the
completion of this project.
4
CONTENTS
1. INTRODUCTION TO PYTHON
3. INTRODUCTION
4. OBJECTIVES
5. SYSTEM REQUIREMENTS
6. FRONTEND DETAILS
7. SOURCE CODE
8. BACKEND DETAILS
9. SCREENSHOTS OF EXECUTION
10. 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.
6
Python Features
● Easy-to-learn − Python has few keywords, simple structure, and a
clearly defined syntax. This allows the student to pick up the language
quickly.
● Easy-to-read − Python code is more clearly defined and visible to the eyes.
● Easy-to-maintain − Python's source code is fairly easy-to-maintain.
● A broad standard library − Python's bulk of the library is very portable
and cross-platform compatible on UNIX, Windows, and Macintosh.
● 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.
● Databases − Python provides interfaces to all major commercial databases.
● 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, few are listed below:–
7
● It provides very high-level dynamic data types and supports dynamic
type checking.
● It supports automatic garbage collection.
● It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java
8
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.
9
Foreign Key: An attribute in its present table whose values are derived from
some other table, is called foreign key in the present table.
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:
Create table <tblname> ( column_name datatype size constraints ,
column_name datatype size constraints ,
column_name datatype size constraints , );
Example:
Sql> Create table student ( admno number(4) , roll number(2),
Name char(30), fname char(30), DOB date, Address
varchar(80) );
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
10
Task : Delete a column DOB from the table
Drop Table : This DDL command is used to remove a table from any
existing database.
Syntax:
Drop table < table name>
Example:
Sql> drop table student ;
Update: This DML command is used to change/modify the record(s) of any table.
The syntax is as follows
Syntax:
Update < tablename> Set column Name = value [ where < condition> ]
Example:
1. Update emp
Set sal = sal + sal * 0.05; ( Give an increment of 5 % to each employee )
2. update emp
set sal = sal+ sal * 0.05
where job =’PRESIDENT’; (Give an increment o f 5% to president only)
DELETE: This DML command is used to delete a row/ tuple(s) from a table.
The Syntax is as follows,
Syntax:
DELETE from <tablename > [ where < condition > ]
Example
1. Delete from emp ; ( delete all the records leaving it’s structure intact)
2. Delete from emp where sal >=3000 ;
12
Create View: This Command is used to create a new View in any existing database.
The syntax is as follows:
Syntax:
Create view < viewname> As Select command
Example:
create view abc as select empno,job,sal from emp;
Drop View : This command is used to drop any existing view from the database.
The syntax is as follows,
Syntax:
Drop View < viewname>
Example:
Drop view abc;
13
PYTHON - MYSQL CONNECTIVITY:
● 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 as soon as we close the form, its contents gets erased.
● Thus, when the application is executed the second time,it requires a new
set of inputs from the user.
● This can be overcome by sending the output generated and saving the input
fetched from the user in a database created at the back end of the application.
● The input is fetched from the user using python interface. This is known
as FRONTEND interface of the application.
● An application usually stores a lot of data in the form of a database which is not
directly accessible by the user.
● This database is used by the application to give suitable response to the user,
This database is called BACK-END databases.
14
Steps to create a database connectivity Python application are:
Step 1. Start Python: start Python’s editor where you can create your python
scripts, i.e; IDLE.
Step 2. Import the package required for database programming.
Here you need to import mysql.connector package in your python scripts.
Step 3. Open a connection: Here we need to establish a connection to MYSQL
database using connect(). This requires 4 parameters, the syntax for this
is as follows:
<Connection_object> = mysql.connector.connect(host= <host_name>, user=
<username>, passwd =<password> , [database = <databasename>])
Example:
import mysql.connector as m
mydb = m.connect(host =”Iocalhost” , user = ”root", passwd = ”admin", database =”test”)
Step 4. Create a cursor instance.
Here we have to create an instance of cursor by using cursor(), the syntax for the
following is as follows:
<cursorobject> =<connectionobject>.cursor()
i. e; in the above connection we can create cursor() by
writing: mycursor = mydb.cursor()
Step 5: Execute a query. Here we use be execute() with following syntax.
< cursorobject>.execute(‹sql query
strings) i.e; mycursor.execute("select
* from data”)
Step 6: Extract data from result set. Here you can fetch the data from the result set by
using fetch( ) functions.
[fetchall(), fetchmany(<n>), fetchone()]
Step 7. Clean up the environment.
15
● A database Connection object controls the connection to the
database. It represents a unique session with a database connected
from within a script/program.
● 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 executing an SQL query and made available to the application
program.
● You can use connect() method for establishing database connection. cursor() to
create a cursor and execute() to execute an SQL query.
● For INSERT, UPDATE and DELETE queries, you must run commit() with
the connection object (Here that is mydb).
16
INTRODUCTION
Built using Python and MySQL, this system ensures a seamless integration between user-
friendly interfaces and a robust back-end database. The primary goal is to simplify library tasks
for both administrators and users, enabling the efficient handling of book-related activities.
Users can search for books, issue or return them, and librarians can manage book stocks,
member registrations, and transaction histories effortlessly.
This project not only reduces operational costs but also saves time for librarians and users,
providing a modern and accessible solution for library management. It is especially ideal for
educational institutions seeking to maintain organized and accessible libraries that support
academic excellence.
17
OBJECTIVES
The main objective of the Library Management System project is to manage the details of
students, books, issues, and members effectively. The project automates key processes to
enhance efficiency, save time, and reduce errors.
1. Efficient Management:
The system handles the details of students, books, issues, and members, providing an
organized and efficient solution for library operations.
2. Automation of Tasks:
Tasks such as adding, updating, and managing books, issuing and returning books,
and managing member information are fully automated, reducing repetitive manual
work.
3. Error Minimization:
By automating critical processes, the system minimizes the chances of human errors
in operations like book quantity updates and transaction management.
4. Time-Saving:
The system saves time for both librarians and users by providing quick access to
information about book availability and transaction history.
18
6. Basic Stock Management:
The system supports basic stock management, such as tracking book quantities and
updating inventory upon issuing or returning books.
7. User-Friendly Organization:
Books are managed systematically in the database, making it easier for librarians to
maintain and retrieve records.
8. Educational Support:
The system ensures students have quick access to book-related information,
supporting their academic requirements.
19
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
20
FRONT END
21
22
SOURCE CODE
23
24
25
26
27
28
BACK END
29
Tables in Library Management System:
Books Table:
Members Table:
30
Transactions Table:
31
SCREENSHOTS
OF
EXECUTION
32
33
34
BIBLIOGRAPHY & REFERENCES
Websites References:
https://www.tutorialspoint.com/index.htm
https://www.javatpoint.com
https://www.w3schools.com
https://html.com
Books References:
35