Class 12 CS Record File 2023-2024
Class 12 CS Record File 2023-2024
Class 12 CS Record File 2023-2024
14 22/8/2023 SQL-ACCOUNT_TRANSACT
15 22/8/2023 SQL-PRODUCT-CLIENT
16 22/8/2023 SQL-TEACHER-POSTING
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified.
Prog:2 Python program to make user define module and import same
in another module or program.
Aim:
To write a Python program to make user define module and import same
in another module or program.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the codes separately as Area_square and Area_rect and run import package
by pressing F5 key
Source Code:
Area_square.py
Area_rect.py
Import package.py
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified.
Prog:3 Read a text file line by line and display each word
separated by a #.
Aim:
To read a text file line by line and display each word separated by a #.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:4 Read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the file.
Aim:
To read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the file.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:5 Remove all the lines that contain the character 'a' in a
file and write it to another file.
Aim:
To remove all the lines that contain the character 'a' in a file and write it
to another file.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:6 Binary File-Creation and Searching
Aim:
To create a binary file with name and roll number. Search for a given roll
number
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:7 Binary File-Creation and Updating
Aim:
To create a binary file with roll number, name and marks. Input a roll
number and update the marks
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:8 CSV File-Creation and Search based on roll number
Aim:
To create a CSV file with name and roll number.Search for a given roll
number and display the name,if not found display appropriate message.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:9 CSV File-Creation and Search based on username
Aim:
To create a CSV file with user-id and password.Search for a given
userid and display the password, if not found display appropriate message.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified.
Prog:10 Program to implement a stack using a list data-structure
(Using Function)
Aim:
To write a Python program to implement a stack using a list
data-structure (using Function)
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the given program is executed successfully, and the output is
verified.
Prog:11 Find most commonly occurring words in phishing mails
Aim:
To find most commonly occurring words in phishing mails.
Procedure:
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the Python program is executed successfully, and the output is
verified
Prog:12 SQL- CUSTOMERBANK
Create the following table with the data given and perform the queries
given below:
a. Display the amount and date of joining of savings accounts.
d. Display the customers who have joined after 1998 May 31.
Create the following table with the data given and perform the queries
given below:
(i) To display the records from table student in alphabetical order as per
the name of the student.
(ii) To display Class, Dob and City whose marks is between 450 and 551.
(iii) To display Name, Class and total number of students who have secured
more than 450 marks.
TABLE: ACCOUNT
ANO ANAME ADDRESS
101 Yuvraj Singh Bangalore
102 Rohan Gupta Chennai
103 Ali Reza Hyderabad
104 Rishabh Jain Chennai
105 Simran Kaur Chandigarh
TABLE: TRANSACT
TNO ANO AMOUNT TYPE DOT
T001 101 2500 Withdraw 2017-12-21
T002 103 3000 Deposit 2017-06-01
T003 102 2000 Withdraw 2017-06-12
T004 103 1000 Deposit 2017-10-22
T005 101 12000 Deposit 2017-11-06
Write SQL commands for the following queries (i) to (iv) based on the
relations Account and Transact given below
i. To display details of all transactions of TYPE Deposit from Table
TRANSACT
ii. To display the ANO and AMOUNT of all Deposits and Withdrawals
done in the month of October2017 from table TRANSACT
iii. To display the last date of transaction (DOT) from the table
TRANSACT for the Accounts having ANO as 103
iv. To display all ANO, ANAME and DOT of those persons from tables
ACCOUNT and TRANSACT who have done transactions less than
or equal to 3000.
Write the outputs of the SQL queries (i) to (v) based on the relations
Account and Transact given below:
i. SELECT ANO, COUNT (*), MIN (AMOUNT) FROM TRANSACT
GROUP BY ANO HAVING COUNT(*) > 1;
ii. SELECT COUNT (*),SUM(AMOUNT) FROM TRANSACT
WHERE DOT < = '2017-06-12';
Create the following table with the data given and perform the queries
given below:
\
(i) To display the details of those Clients whose City is Delhi.
(iii) To display the ClientName, City from Table Client, and ProductName
and Price from Table Product, with their corresponding matching P_ID.
(iv)) To display teacher's name, salary, age for male teachers only.
(v) To display name, bonus for each teacher where bonus is 10% of salary
Write the outputs of the SQL queries (i) to (iii) based on the relations
Teacher and Posting given below:
(i) SELECT Department, count(*) FROM Teacher GROUP BY
Department;
Aim:
To integrate SQL with Python by importing the MySQL module to
store a record of employee and display the record.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the given program is executed successfully, and the output is
verified
Prog:18 Integrate SQL with Python by importing the MySQL module
to search an employee using employee no.
Aim:
To integrate SQL with Python by importing the MySQL module to
connect with a database and search employee number in table employee and
display record, if employee no not found display appropriate message
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the given program is executed successfully, and the output is
verified
Prog19 Integrate SQL with Python by importing the MySQL module
to search an employee using employee no and update the record.
Aim:
To integrate SQL with Python by importing the MySQL module to search
an employee using employee no and update the record.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the given program is executed successfully, and the output is
verified
Prog:20 Integrate SQL with Python by importing the MySQL module
to search an employee using employee no and delete the record..
Aim:
To integrate SQL with Python by importing the MySQL module to search
an employee using employee no and delete the record.
Procedure:
Start Python IDLE. Click File->New File and type the following code.
Save the code and run it by pressing F5 key
Source Code:
Output:
Result:
Thus, the given program is executed successfully, and the output is
verified