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

Final

The document outlines a practical file for a class project involving SQL commands related to banking and customer data, as well as Python programming for database integration and file handling tasks. It includes specific SQL queries to display customer information, count transactions, and manipulate employee records in a database. Additionally, it describes various Python programs for reading files, counting characters, and managing records in different formats.

Uploaded by

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

Final

The document outlines a practical file for a class project involving SQL commands related to banking and customer data, as well as Python programming for database integration and file handling tasks. It includes specific SQL queries to display customer information, count transactions, and manipulate employee records in a database. Additionally, it describes various Python programs for reading files, counting characters, and managing records in different formats.

Uploaded by

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

CS PRACTICAL

FILE

NAME -TUSHAAR BHARARA TEACHER IN-CHARGE-MS. PARUL


CLASS -12 -A
TH
SESSION -2024-2025
Consider the following BANK and table CUSTOMER Write SQL
commands for the statements i to vi and give outputs for SQL queries vii
and viii
1) Display data for all customers whose transaction exists between 8 and 11.

2) Display data for all customers sorted by their Dateofopen.

3) To count the number of customers with amount < 30000

4) List the minimum and maximum amount from the BANK


5) To list Cname, Bname, Amount for all the clients whose amount is <20000

6) To display Acc_no, Cname, Bname, total transaction in reverse order of amount.

7) Give the output of the following SQL commands:

i) SELECT AVG(Amount) FROM BANK WHERE Amount < 23000;

ii) SELECT MAX(Amount) FROM BANK WHERE Amount > 30000;


iii) SELECT SUM(T_Transactions) FROM BANK;

iv) SELECT COUNT (DISTINCT Bname) FROM BANK;

v) SELECT CName,Tbank FROM BANK, CUSTOMER WHERE bank.CName = customer.Tname;


PYTHON AND MYSQL
INTERFACE
AIM - Write a Program to integrate SQL with Python by importing the
MySQL module and create a table Emp (EID,Ename,Gender and Salary)
in the Database Company
Code-

Output in MySQL -
AIM - Write a Program to integrate SQL with Python by importing the
MYSQL module to insert the records in the Emp Table and display the
records.
Code-

Output-
AIM - Write a Program to integrate SQL with Python by importing the
MYSQL module to search an Employee using EID and display the record if
present in already existing table Emp, if not display the approprite
message.
Code-

Table -

Output-
AIM - Write a Program to integrate SQL with Python by importing the
MYSQL module to delete all the records from the Emp table whose salary
> 30000
Code –

Table –

Output –
FILE HANDLING
AIM - Create a programme to read a text file line by line and display each
word separated by a #.
Input-

Ouput-

AIM – Read a text file and display the number of


vowels/consonants/uppercase/loweгсasе characters in the file

Input -

Ouput –
AIM - Creating python program to display short words from a text file
Input-

Output –
AIM - Creating a python program to copy particular lines of a text file into
another textfile which start from either a or A
INPUT –

Output –

AIM - Creating a python program to create and search records in binary


file.
INPUT –
OUTPUT –

AIM - Creating a python program to create and update/modify records in


binary file.
INPUT -

OUTPUT –
AIM - Creating a python program to create and search employee’s record
in csv file.
INPUT -

OUTPUT –
AIM - Creating a python program to implement stack operations (List)
Code-
OUTPUT-

You might also like