Adobe Scan Nov 06, 2023
Adobe Scan Nov 06, 2023
1 Read a text file line by line and display each word separated by a '#.
Read a text file and display the number of vowels/consonants/uppercase/lowercase
2
characters in the file.
another file.
3 Remove all the line that contain the character 'a' in a file and write it to
/) based on the user's
4. Write a menudriven program to perform arithmeticoperation (+,-,*,
choice.
update the
5. Create a binary file with roll number, name and marks, Input a roll numberand
marks.
given
6. Create a CSV file by entering user-id and password, read and search the password for
user-id.
16 (simulates
7. Write a random number generator that generates random numbers between
a dice).
8. Write a function that receive two string, arguments and check whether they are of same
length string (return True in this case otherwise False).
9. Write a python program to display Fibonacci series up to n' numbers.
10. Write a python program to calculate simple interest and compound interest using a
function.
11. Write afunction in python that counts the number of 'ME' or MY words present in a text
file. "Story.txt". If the "Story\.txt" contents are as follows- My first book was 'ME and MY
Family'. It gave me the chance to be known to the world.
12. Write aprogram to create a cSV file to store student data (RollNo., Name, Marks). Obtain
data from user and write 5 records into the file.
13. Write aprogram to a binary file called emp.dat and write into it the employee details of
some employees, available in the form of dictionaries.
14. Write a program to get data (roll no., name and marks) from the user and write onto a
binary file. The program should be able to get data from the user and write onto the file as
long as the user wants.
15. Create apython program to implement stack operations.
16. Towrite Queries for the following Questions based on the given table.
TABLE: Info
Rollno Name Gender Age Dept DOA Fees
1, Arun M 24 Computer 1997-01-10 120
2. Ankit M 21 History 1998-03-24 200
3 Anu 20 Hindi 1996-12-12 300
4. Bala 19 NULL 1999-07-01 400
5. Charan M 18 Hindi 1997-06-27 250
6. Deepa F 19 History 1997-02-25 300
7 Dinesh M 22 Computer 1997-06-27 210
Usha 23 NULL 1997-07-31 200
number is 8.
a) Write a Query to delete the details of Roll
whose Roll number is 1, if the
b) Write a Query to change the fees of Students to 17O
existing fees is less than 130.
in table Info.
c) Write a Query to add a new column Area of type varchar
Area Contains NULL.
d) Write a Query to display Name of allstudents whose
table Info.
e) Write a Query to delete Area Column from the
database.
f) Write a Query to delete table from
table:
19. To write Queries for the following Questions based on the given
Table : STOCK
itemNo item Dcode Qty UnitPrice StockDate
Ball Pen 0.5 102 100 16 31-03-10
5005
Ball Pen 0.25 102 150 20 01-01-10
5003
Gel Pen Premium 101 125 14 14-02-10
5002
Gel Pen Classic 101 200 22 01-01-09
5006
Eraser Small 102 210 5 19-03-09
5001
102 60 10 12-12-09
5004 Eraser Big
Sharpener Classic 103 160 8 23-01-09
5009
Table: DELERS
Dcode Dname
101 Reliable Staioners
103 Classic Plastic
102 Clear Deals
a) To display the total Unit price of allthe
products whose Dcode as 102.
b) To display details of all products in the stock in
descending order of Stock date.
c) To display maximum unit price of products for each dealer
from the table Stock.
individually as per Dcode
d) To display the Pname and Dname from table stock and
dealers.
20. Write Queries for the following Questions basedon
the given table empl:
EMPNO ENAME JOB MGR DEPTNO
HIREDATE SAL COMM
8369 Smith Clerk 20
8902 1990-12-18 800 NULL
8499 Anya Salesman 8698 1991-02-20 1600 300 30
8521 Seth Salesman 8698 1250 500 30
1991-02-22
8566 Mahadevan Manager 8839 1991-04-02 2985 NULL 20
8654 Momin Salesman 8698 1991-09-28 1250 1400 30
8698 Bina 30
Manager 8839 1991-05-01 2850 NULL
8839 Amir President 1991-11-18 5000 NULL 10
8844
Kuldeep Salesman 8698 1991-09-08 1500 30
8882 Shivansh Manager 8839 1991-06-09 2450 NULL 10
8886 Anoop Clerk 8888 1993-01-12 1100 NULL 20
8900 Jatin Clerk 8698 1991-12-03 950 NULL 30
8902 Fakir Analyst 8566 1991-12-03 3000 NULL 20
8934 Mita Clerk 8882 1992-01-23 1300 NULL 10
a) Write aquery to calculate average salary of all employees listed in table empl.
b) Write a queryto count number of records in table empl.
c) Write a query to count number of jobs in table empl.
d) Writea query to find how many distinct jobs are listed in table empl.
e) Write a query to display maximum salary from table empl.
f) Write a query display the joining date of senior most employee.
g) Write aquery to display total salary of all employees listed in empl.
21. Creating a python program to integrate MySQL with Python (updating records).
22. Program to connect with database and delete the endeared empno.
23. Creating a python program to integrate MySQL with python (inserting records and displaying
records).
24. Creating apython program to integrate MySQL with python (searching and displaying
records).
Clas-X(A