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

3Practical File -12 CS (1)

Uploaded by

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

3Practical File -12 CS (1)

Uploaded by

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

List of Programs for Practical File

CLASS XII COMPUTER SCIENCE


1. Write a program in python to check a number whether it is Prime or not using user defined function
2. Write a program to input a character and to print whether a given character is an alphabet, digit or
any other character.
3. Write a function search_replace() in Python which accepts a list L of numbers and a number to be
searched. If the number exists, it is replaced by 0 and if the number does not exist, an appropriate
message is displayed.
4. Write a program to generate random numbers between 1 to 6 and check whether a user won a
lottery or not.
5. Write a program to count the number of vowels present in a text file.
6. Write a program in python to write multiple lines of text contents into a text file daynote.txt line.
7. Write a program in python to read the content from a text file story.txt line by line and display the same on
screen.
8. Write a program of a Python function named LongLines( ) which reads the contents of a text file named
'LINES.TXT' and displays those lines from the file which have at least 10 words in it.
9. Write a program to write those lines which have the character 'p' from one text file to another text
file
10. Write a program to insert n records in a binary file student.dat.
11. Write a program to read records from binary file student.dat.
12. Write a program to implement search operation in a binary file
13. Write a program to update a record stored in binary file student.dat.
14. Write a program to delete a record from binary file.
15. Write a program to create a CSV file and read it
16. Write a program to count umber of records from CSV file
17. Write a program to save some user id and passwords in a csv file. Ask user to enter a user id and
password, if combination matches it should print ‘welcome’ otherwise print ‘data mismatch’.
18. Write a program to insert an element in the list.
19. Write a menu-based program to perform PUSH, POP and DISPLAY operation on stack in python using
list.
20. Write a menu-based program to perform PUSH, POP and DISPLAY operation on stack in python using
Dictionary.
21. Write a program to connect Python with MySQL using database connectivity and perform the
following operations on data in database:company(Table:employee) Add, Search, Update, Delete and
View complete Table.
22. Write a program to connect Python with MySQL using database connectivity and perform the
following operations on data in database:Class_management(Table:Class_info) Fetch, Update and
delete the data.
23. Create the following table PRODUCT in MySql and answer the questions follows:
TABLE : PRODUCT

P_ID ProductName Manufacturer Price


TP01 Talcom Powder LAK 40
FW05 Face Wash ABC 45
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120
FW12 Face Wash XYZ 95
PP01 Hand Wash NULL 95

i. To increase the Price of all Products by 10.


ii. To display average price of product sorted on the basis of Manufacturer.
iii. To display minimum and maximum Price of product Manufacturer wise.
iv. To display details of product having name ends with ‘h’.
v. To display product name and price of product having P_ID either BS01 or FW12.
vi. To display manufacturer wise sum of Price in descending order of Price.
vii. To count and print unique Manufacturer.
viii. To print average Price of product from manufacturer either ‘ABC’ or ‘XYZ’.
ix. To delete record of ‘Shampoo’.
x. To decrease the price of product by 20 of manufacturer ‘XYZ’.
xi. To print P_ID, ProductName, price and price of 12 items as BunchPrice.
xii. To print details of product with null manufacturer.
24. Consider following tables and answer queries (i) to (iv)
SUPPLIER
SNO SNAME CITY
1 ABC Pvt NEW DELHI
2 INDIA Enterprises JAIPUR
3 Deep Ltd UDAIPUR
4 G&G Corp JAIPUR

ITEM
CODE I_NAME PRICE SNO
C1 COLD DRINK 150 2
B2 BISCUITS 100 3
T3 TEA 200 1

a) Display Item code and item name whose price is more than 100 in the descending order of price.
b) Show Item name and their respective supplier name.
c) Display Supplier no, supplier name who have supplied item for which item code is B2.
d) List the Item name, price, and supplier name of item(s) which have been supplied by a supplier of
JAIPUR.
e)

25. Consider following tables and answer queries (a) to (c) and write down the output of (d) : -
CUSTOMER
Cust_ID CNAME GENDER CITY CLUB_ID
C01 DEVESH M NEW DELHI 101
C02 SURAJ M JAIPUR 102
C03 SHEELA F UDAIPUR 102
C04 MEENAKSHI F JAIPUR 101
C04 AAKRITI F UDAIPUR 103

CLUB
CLUB_ID CLUB_NAME FEES
101 YOGA 800
102 MUSIC 1000
103 SPORTS 2000

a) Display Customer name along with their respective club name.


b) Show Customer name, customer id who have joined MUSIC Club.
c) Display Customer name, gender and club name of all customers who live in JAIPUR.
d) SELECT CNAME,CLUB_NAME FROM CUSTOMER,CLUB
WHERE CUSTOMER.CLUB_ID=CLUB.CLUB_ID and GENDER =”M”;

26. Consider following tables and answer queries (i) to (iv): -


WORKER
WID WNAME JOB SALARY DNO
1001 RAHUL SHARMA CLERK 15000 D03
1002 MUKESH VYAS ELECTRICIAN 11000 D01
1003 SURESH FITTER 9000 D02
1004 ANKUR GUARD 8000 D01
DEPT
DNO DNAME LOCATION MANAGER
D01 PRODUCTION GROUND FLOOR D K JAIN
D02 ACCOUNTS 1ST FLOOR S ARORA
D03 SECURITY 1ST FLOOR R K SINGH

a) How many departments are there on the first floor?


b) Display Worker name and their respective jobs whose name contains the string ‘ESH’.
c) Display the average salary of workers who are working in the “PRODUCTION” department.
d) Display Worker name, Job and their respective manager.
27. Write queries (a) to (d) based on the tables CUSTOMER and ORDER given below:
TABLE:CUSTOMER
CUSTOMERID CUSTOMERNAME CITY COUNTRY
101 AMAN JAIPUR INDIA
102 SURESH BARANG GERMANY
103 ANAND RODIX MEXICO
104 RISHABH TENDA GERMANY
105 AARYAN KOTA INDIA

TABLE:ORDER
ORDERID CUSTOMERID ORDERDATE
1 101 12/5/2016
2 102 3/8/1990
3 101 21/9/2020

(a)To display customer name with their order id.


(b)To display the total number of customers country-wise.
(c)To display customer names in ascending order who have placed orders.
(d)To display the total number of customers whose city name starts with “J”.

You might also like