0% found this document useful (0 votes)
20 views

XII CS-front page of project file

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

XII CS-front page of project file

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

AMITY INTERNATIONAL SCHOOL

COMPUTER SCIENCE (083)


PROJECT FILE
ON

IN
PYTHON & SQL
SESSION – 2024-25

NAME: ______________
ROLLNO: ________________
INDEX

SNO TOPIC PAGE NO

1 Certificate 1

2 Acknowledgement 2

3 Introduction to Python 3

4 Introduction to Python Pandas 6

5 Introduction to CSV 9

6 Hardware and Software Specification 11

7 Project Description 12

8 Source Code 14

9 Output Screens 28

10 Bibliography 48
AMITY INTERNATIONAL SCHOOL
VIRAJ KHAND, LUCKNOW

CERTIFICATE

This is to certify that ______________, a student of class XII


has successfully completed the research on the below mentioned
project under the guidance of Mrs. Cinderalla A Augustine
(Teacher) during the year 2024-25 in the partial fulfillment
of Computer Science practical examination conducted by CBSE ,
New Delhi.
Signature of Internal examiner Signature of
External Examiner

ACKNOWLEDGEMENT

It is a great pleasure that I am penning down these lines


to express my sincere thanks to all those people who
helped me in completing this project.

The harmonious environment in our school provided the


proper atmosphere for preparing this project. It was a
privilege to have been guided by our Teacher Mrs.
Cinderalla A Augustine and our Principal Mrs. Rachna
Mishra.

I am also grateful to my classmates who have helped me


during the finalization of this project with their
constructive criticism and advice.
Introduction to Python
Python is a powerful multi-purpose programming language created by
Guido van Rossum.

Python is an easy to learn, powerful programming language. It has


efficient high-level data structures and a simple but effective approach
to object-oriented programming. Python’s elegant syntax and dynamic
typing, together with its interpreted nature, make it an ideal language for
scripting and rapid application development in many areas on most
platforms.

The Python interpreter and the extensive standard library are freely
available in source or binary form for all major platforms from the
Python Web site, https://www.python.org/, and may be freely distributed.
The same site also contains distributions of and pointers to many free
third party Python modules, programs and tools, and additional
documentation.

The Python interpreter is easily extended with new functions and data
types implemented in C or C++ (or other languages callable from C).
Python is also suitable as an extension language for customizable
applications.

Python is a cross-platform programming language, meaning, it runs on


multiple platforms like Windows, MacOS, Linux and has even been ported
to the Java and .NET virtual machines. It is free and open source.

Features of Python Programming


 A simple language which is easier to learn. Python has a very simple and
elegant syntax. ...
 Free and open-source. ...
 Portability. ...
 Extensible and Embeddable. ...
 A high-level, interpreted language. ...
 Large standard libraries to solve common tasks. ...
 Object-oriented

Python is a multi-paradigm programming language. Meaning, it supports


different programming approach.

One of the popular approach to solve a programming problem is by


creating objects. This is known as Object-Oriented Programming (OOP).

An object has two characteristics:

 attributes
 behavior

Let's take an example:

Person is an object,

 name, age, color are attributes


 singing, dancing are behavior

The concept of OOP in Python focuses on creating reusable code. This


concept is also known as DRY (Don't Repeat Yourself).

In Python, the concept of OOP follows some basic principles:

A process of using details from a new class without


Inheritance modifying existing class.

Encapsulation Hiding the private details of a class from other objects.

A concept of using common operation in different ways


Polymorphism for different data input.
Class

A class is a blueprint for the object.

Object

An object (instance) is an instantiation of a class. When class is defined,


only the description for the object is defined. Therefore, no memory or
storage is allocated.

Methods

Methods are functions defined inside the body of a class. They are used
to define the behaviors of an object.

Inheritance

Inheritance is a way of creating new class for using details of existing


class without modifying it. The newly formed class is a derived class (or
child class). Similarly, the existing class is a base class (or parent class).

Encapsulation

Using OOP in Python, we can restrict access to methods and variables.


This prevent data from direct modification which is called encapsulation.
In Python, we denote private attribute using underscore as prefix i.e
single “ _ “ or double “ __“.

Polymorphism

Polymorphism is an ability (in OOP) to use common interface for multiple


form (data types).

Suppose, we need to color a shape, there are multiple shape option


(rectangle, square, circle). However we could use same method to color
any shape. This concept is called Polymorphism.

What are exceptions in Python?


Python has many built-in exceptions which forces your program to output
an error when something in it goes wrong.

When these exceptions occur, it causes the current process to stop and
passes it to the calling process until it is handled. If not handled, our
program will c

In Python, exceptions can be handled using a try statement.

A critical operation which can raise exception is placed inside the try
clause and the code that handles exception is written in except clause.

Introduction to MYSQL

MySQL is an open-source, fast reliable, and flexible relational database


management system.

 MySQL server design is multi-layered with independent modules.

 MySQL is fully multithreaded by using kernel threads. It can handle


multiple CPUs if they are available.

 MySQL provides transactional and non-transactional storage engines.

 MySQL has a high-speed thread-based memory allocation system.

 MySQL supports in-memory heap table.

 MySQL Handles large databases.

 MySQL Server works in client/server or embedded systems.

 MySQL Works on many different platforms.


SQL commands are divided into four subgroups, DDL, DML, DCL, and TCL.

DDL
DDL is short name of Data Definition Language, which deals with
database schemas and descriptions, of how the data should reside in the
database.

 CREATE - to create a database and its objects like (table, index, views,
store procedure, function, and triggers)

 ALTER - alters the structure of the existing database

 DROP - delete objects from the database

 TRUNCATE - remove all records from a table, including all spaces


allocated for the records are removed

 COMMENT - add comments to the data dictionary

 RENAME - rename an object

DML
DML is short name of Data Manipulation Language which deals with data
manipulation and includes most common SQL statements such SELECT,
INSERT, UPDATE, DELETE, etc., and it is used to store, modify, retrieve,
delete and update data in a database.

 SELECT - retrieve data from a database

 INSERT - insert data into a table

 UPDATE - updates existing data within a table

 DELETE - Delete all records from a database table

 MERGE - UPSERT operation (insert or update)


 CALL - call a PL/SQL or Java subprogram

 EXPLAIN PLAN - interpretation of the data access path

 LOCK TABLE - concurrency Control

DCL
DCL is short name of Data Control Language which includes commands
such as GRANT and mostly concerned with rights, permissions and other
controls of the database system.

 GRANT - allow users access privileges to the database

 REVOKE - withdraw users access privileges given by using the GRANT


command

TCL
TCL is short name of Transaction Control Language which deals with a
transaction within a database.

 COMMIT - commits a Transaction

 ROLLBACK - rollback a transaction in case of any error occurs

 SAVEPOINT - to rollback the transaction making points within groups

 SET TRANSACTION - specify characteristics of the transaction.

Connecting MYSQL with Python

There are the following steps to connect a python application to our


database.

1. Import mysql.connector module


2. Create the connection object.
3. Create the cursor object
4. Execute the query

Creating the connection:


To create a connection between the MySQL database and the python
application, the connect() method of mysql.connector module is used.

Pass the database details like HostName, username, and the database
password in the method call. The method returns the connection object.

The syntax to use the connect() is given below.

Connection-Object= mysql.connector.connect(host = <host-


name> , user = <username> , passwd = <password> )

Creating a cursor object:

The cursor object can be defined as an abstraction specified in the


Python DB-API 2.0. It facilitates us to have multiple separate working
environments through the same connection to the database. We can create
the cursor object by calling the 'cursor' function of the connection object.
The cursor object is an important aspect of executing queries to the
databases.

The syntax to create the cursor object is given below.

<my_cur> = conn.cursor()

You might also like