practical practise questions
practical practise questions
1. Write a python program to maintain book details like book code, book title
and price using stacks data structures? (implement push(), pop() and
traverse() functions)
2. Write a python program to read a file named “article.txt”, count and print total alphabets in the file?
3. Write a python program to read a file named “article.txt”, count and print total lines starting with
vowels in the file?
1. Add record
2. Display records
3. Search record
4. Exit
The structure of file content is: [s_id, name, brand, type, price]
7. Write a menu drive program to python to implement stack using a list and perform following
functions:
1. Push
2. Pop
3. Display
4. Exit
8. Consider the tables books and issue write SQL command for given statements:
(i) Write command to add primary key and foreign key in tables using alter.
(ii) Increase the price of all computer books by 70.
(iii) Display the book id, book name and quantity issued for all books which have been issued.
(iv) Display the book id, book name, author name, quantity issued for all books which price are
200 to 400.
id Name Designation
Relation : Details
id Salary PhoneNo
iv. Display Name and salary of all employees having salary more than 40000
Relation : Hospital
ii. Show information of patients who visited between ‘2018-12-01’ and ‘2019-12-
01’.
iii. Show information of patients who visited before ‘2018-12-01′ or after 2019-
12-01’.
iv. List those patients whose name starts with alphabet ‘M’.
vii. List those patients whose name starts with alphabet ‘M’ and ends with ‘n’.
11. Consider a binary file “data.dat” which stores the record of “Hotel” in the form
13.
14.
15.
16.
17.
18.
19
20.