yash cs
yash cs
yash cs
PRACTICAL FILE
SESSION: 2023-24
CLASS: XII-A
OUTPUT:
3.Remove all the lines that contain the character 'a' in a file and
write it to another file.
Input File:
OUTPUT:
4.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.
OUTPUT:
5.Create a binary file with roll number, name and marks. Input a
roll number and update the marks.
OUTPUT:
4
7.Write a Python program to implement a stack using list.
OUTPUT:
8.Create a CSV file by entering user-id and password, read
and search the password for given user id.
OUTPUT:
OUTPUT:
OUTPUT:
12.Write a binary program to read, search, update, delete
records.
OUTPUT:
13.Program to write data onto “student” CSV file using
writerow() method.
OUTPUT:
Output:
15.Write a menu -driven program for performing all the operations on a
table 'student'.
OUTPUT:
4 Programs based on Python – Sql
connectivity
OUTPUT :
17.Program
to update the records of employees
by increasing salary by Rs. 1000 of all those employees
whoare getting less than Rs. 80000.
Output :
18.Program
to delete the record on the basis of inputted
salary.
Output :
19.Program
1. ALTER table to add new attributes / modify data type / drop attribute
OUTPUT:
OUTPUT:
2.To display details of those models manufactured in 2011 and whose cost isbelow 2000
SELECT * FROM Model WHERE year (DateOfManufacture) = 2011 AND Cost <2000;
3.To display the Model_ID, Comp_ID, Cost from the table Model, CompNameand
ContactPerson from Company table , with their corresponding Comp_ID.
SELECT Model _ID, Comp_ID, Cost, CompName, ContactPerson FROMModel,
Company WHERE Model.Comp_ID = Company.Comp_ID;
4.To decrease the cost of all the models in Model table by 15%
UPDATE Model SET Cost = Cost - 0.15*Cost;
3.To display the content of the entire EMPLOYEEs table, whose DOJ is
inbetween ‘09-Feb-2006’ and ‘08-Aug-2009’
SELECT * FROM EMPLOYEE WHERE DOJ BETWEEN ‘2006-02-09’ AND ‘2009-08-
02’
4.To add a new row with the following content:
109,’Harish Roy’,’HEAD-IT’,’S02’,’9-Sep-2007’,’21-Apr-1983’
INSERT INTO EMPLOYEE VALUES(109, ‘Harish Roy’, ‘HEAD-IT’, ‘S02’, ‘2007-09-09’,‘1983-04-21’);
Set 4
TABLE – teacher
1.To show information about the teacher of the History
department. select * from teacher where DEPT=”History”;
3.To list the name of all student with their data of admission in ascending order.
select * from student order by dataofadm;
3.To add another column DocName (Doctor Name) of the type varchar in the above table.
alter table hospital add DocName varchar(20);
4.To display patient detail whose age is missing(null).
select* from hospital where age is NULL;
5.To decrease the charges by 5% of all the patients admitted to the ENT department.
update hospital set charges = charges-(charges*5)/100 where department =”ENT”;