updated QUESTION AND ANSWER
updated QUESTION AND ANSWER
1. Write a python program to read a text file line by line and display each word
separated by '#'. (3)
2. Write a program in python that defines and calls the following user defined
functions:
The structure of peripheral.csv is: [p_id, p_name, price]
Add_device( ) : to accept a record from the user and add it to a csv file,
peripheral.csv
Count_device( ) : to count and display number of peripheral devices whose price
is less than 1000.
(5)
3. Write SQL queries to do the following: Table:Student (4)
2. Write a python program to create a binary file with roll number and name. Search
for a given roll number and display the name, if not found display appropriate
message.
(5)
3. Write SQL Queries for the following Queries: Table: Employee (4)
EmpNo EmpName Dept Salary Designation
150 Arnav Marketing 45000 Executive
134 Bharathi Sales 35000 Executive
167 Chandru Marketing 38500 Asst. Manager
195 Dithya Null 37000 Manager
208 Feroz Sales 60000 Manager
2. Write a python program to get student data (rollno, name, marks) from 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. (5)
3. Write SQL Queries for the following Queries: Table: Employee (4)
PROD_ID PROD_NAME PRICE COMPANY TYPE
P001 Mouse 200 LOGITECH INPUT
P002 Laser Printer 4000 CANON OUTPUT
P003 Keyboard 500 LOGITECH INPUT
P004 Joystick 1000 IBALL INPUT
P005 Speaker 1200 CREATIVE OUTPUT
SET D
1. Write a python program to display lines that starts with ‘A’ from a text file. (3)
2. Write a program in Python that defines and calls the following user defined
functions: The structure of 'courier.csv' is: cid, s_name, Source, destination
(i) COURIER_ADD() : It takes the values from the user and adds the details to a csv
file 'courier.csv'.
(ii) COURIER_SEARCH() : Takes the destination as the input and displays all the
courier records going to that destination. (5)
3. Write sql queries for the following table. Table: Student (4)
SET E
1. Creating a python program to read a text file and display the number of vowels/
consonants/lower case/ upper case characters. (3)
2. Write a program in python that defines and calls the following user defined
functions: The structure of peripheral.csv is: [p_id, p_name, price]
Add_device( ) : to accept a record from the user and add it to a csv file,
peripheral.csv
Count_device( ) : to count and display number of peripheral devices whose price
is less than 1000. (5)
3. Write sql queries for the following table. TABLE : HOSIPTAL (4)
NO NAME AGE DEPARTMENT DOA CHARGES SEX
1 SANDEEP 65 SURGERY 23/02/98 300 M
2 RAVINA 24 ORTHOPEDIC 20/01/98 200 F
3 KARAN 45 ORTHOPEDIC 19/02/98 200 M
4 TARUN 12 SURGERY 01/04/98 300 M
5 ZUBIN 36 ENT 12/02/98 250 M
6 KETAKI 16 ENT 24/02/98 300 F
7 ANKITA 29 CARDIOLOGY 20/02/98 800 F