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

practical practise questions

The document contains a series of practical programming questions and SQL queries related to data structures, file handling, and database management. It includes tasks such as implementing stack operations in Python, counting characters and lines in a text file, and performing various SQL operations on tables related to books, employees, and hospital records. Additionally, it addresses file manipulation for a binary file storing hotel records.

Uploaded by

Manan Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

practical practise questions

The document contains a series of practical programming questions and SQL queries related to data structures, file handling, and database management. It includes tasks such as implementing stack operations in Python, counting characters and lines in a text file, and performing various SQL operations on tables related to books, employees, and hospital records. Additionally, it addresses file manipulation for a binary file storing hotel records.

Uploaded by

Manan Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

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?

6. Write a menu drive program to perform following operations into telephone.csv.

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.

9. Write SQL queries on the basis of following tables.


Relation : Employee

id Name Designation

101 Naresh Clerk

102 Ajay Manager


103 Manisha Clerk

104 Komal Advisor

Relation : Details

id Salary PhoneNo

101 32000 9898090909

102 45000 9888000909

103 33000 8008078787

104 40000 7009876543


i. View Name and salary of all employees.

ii. List Name, designation and salary of all Clerks.

iii. Display id, Name and salary of all employees.

iv. Display Name and salary of all employees having salary more than 40000

10. Write SQL queries on the basis of following table.

Relation : Hospital

PName Fee Gender Dateofvisit

Ramesh 200 M 2020-02-11

Mohnish 250 M 2019-12-22

Muskan 350 F 2019-11-22

Sunil 250 M 2018-12-02


Sonam null F 2019-01-19

Sahil 16950 F 2019-02-26

i. Show information of patients who visited after ‘2020-01-01’.

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’.

v. List those patients whose name ends with alphabet ‘m’.

vi. List those patients whose name contains alphabet ‘a’.

vii. List those patients whose name starts with alphabet ‘M’ and ends with ‘n’.

viii. List those patients whose name contains 4 characters.

ix. List those patients whose fee is null.

x. List those patients where fee is not null.

11. Consider a binary file “data.dat” which stores the record of “Hotel” in the form

of list containing Room_no, Price, Room_type. Do the following task in a file.


12.

13.

14.

15.

16.
17.

18.

19

20.

You might also like