Computer Science Practical File Class 12
Computer Science Practical File Class 12
8 Create a CSV file by entering user-id and password, read and search the
password for given userid.
9 Create a student table and insert data. Implement the following SQL
commands on the student table: ALTER table to add new attributes /
modify data type / drop attribute
10 UPDATE table to modify data
13 GROUP BY and find the min, max, sum, count and average
19 Delete record from table for roll no. using python interface
SOURCE CODE:
OUTPUT:
PROGRAM 3
AIM: Remove all the lines that contain the character 'a' in a file and
write it to another file
SOURCE CODE:
OUTPUT:
PROGRAM 4
AIM: Create a binary file with name and roll number. Search for a
given roll number and display the name, if not found display
appropriate message
SOURCE CODE:
OUTPUT:
PROGRAM 5
AIM: Create a binary file with roll number, name and marks. Input a
roll number and update the marks.
SOURCE CODE:
OUTPUT:
PROGRAM 6
AIM: Write a random number generator that generates random
numbers between 1 and 6 (simulates a dice).
SOURCE CODE:
OUTPUT:
PROGRAM 7
AIM: Write a Python program to implement a stack using list.
SOURCE CODE:
OUTPUT:
PROGRAM 8
AIM: Create a CSV file by entering user-id and password, read and
search the password for given userid.
SOURCE CODE:
OUTPUT:
PROGRAM 9
AIM: Create a student table and insert data. Implement the following
SQL commands on the student table: ALTER table to add new
attributes / modify data type / drop attribute
SOURCE CODE:
OUTPUT:
PROGRAM 10
AIM: Create a student table and insert data. Implement the following
SQL commands on the student table: UPDATE table to modify data
SOURCE CODE:
OUTPUT:
PROGRAM 11
AIM: Create a student table and insert data. Implement the following
SQL commands on the student table:ORDER By to display data in
ascending / descending order
SOURCE CODE:
OUTPUT:
PROGRAM 12
AIM: Create a student table and insert data. Implement the following
SQL commands on the student table: DELETE to remove tuple(s)
SOURCE CODE:
OUTPUT:
PROGRAM 13
AIM: Create a student table and insert data. Implement the following
SQL commands on the student table: GROUP BY and find the min,
max, sum, count and average
SOURCE CODE:
OUTPUT:
PROGRAM 14
AIM: Create table student inside database “School” using python
SOURCE CODE:
OUTPUT:
PROGRAM 15
AIM: Insert multiple records in a table using python interface
SOURCE CODE:
Preeti Arora Practical Implementation No 9
OUTPUT:
PROGRAM 16
AIM: To display all records of table using python interface
SOURCE CODE:
OUTPUT:
PROGRAM 18
AIM: Search a record using string template with {} and format
function
SOURCE CODE:
Preeti Arora Page No 8.21 © part
OUTPUT:
PROGRAM 19
AIM: Delete record from table for roll no. using python interface
SOURCE CODE:
Preeti Arora Practical Implementation 16
OUTPUT:
PROGRAM 20
AIM: Write a code to connect to a Mysql database namely School and
then fetch all those records from table Student where grade is ‘A’.
SOURCE CODE:
OUTPUT: