0% found this document useful (0 votes)
21 views2 pages

Important Questions Practicals

The document outlines important practical questions for programming, focusing on Python and MySQL. It includes tasks related to CSV file handling, binary file operations, stack operations, and SQL queries on a student results table. Each section specifies user-defined functions and queries to manipulate and retrieve data from the respective structures.

Uploaded by

testingapks084
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)
21 views2 pages

Important Questions Practicals

The document outlines important practical questions for programming, focusing on Python and MySQL. It includes tasks related to CSV file handling, binary file operations, stack operations, and SQL queries on a student results table. Each section specifies user-defined functions and queries to manipulate and retrieve data from the respective structures.

Uploaded by

testingapks084
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/ 2

IMPORTANT QUESTIONS FOR PRACTICALS

Q1 Program using CSV: 8 Marks


Sangeeta is a python programmer working in a computer hardware company. She has to
maintain the records of the peripheral devices. She created a csv file, peripheral.csv, to store
details. The structure of peripheral.csv is [p_id,p_name,price], whre p_id is peripheral device
id(integer), p_name is peripheral device name(string) and price is peripheral device
price(integer).
Sangeeta wants to write the following user defined functions:
 Add_device() : To accept a record from user and add it to csv file.

 Count_device(): To count and display the number of peripheral devices whose price is
less than 1000
Q2. MySQL Queries : 4 marks

Consider the table RESULT2023 given below and answer the following questions(any 4)

RollNo Name Class Gender City Marks


1 Naman XII M Bhopal 453
2 Nandini X F Jaipur 551
3 Nakshatra X F Delhi 553
4 Shailesh XI M Chandigarh 458
5 Trisha XII F Delhi 430
6 Manisha XII F Jaipur 530

(a) To display the details of class XII students in descending order of their marks.
(b) Display the sum of the marks of students who have scored more than 500.
(c) Find the maximum marks of the student for each class.
(d) Count the students class wise and display only those number which is more than 2.
(e) Display unique cities from the table.

Q1 Program using File Handling 8 marks


A binary file “student.dat” has structure [rollno, name, marks].
i. Write a user defined function insertRec() to input data for a student and add to
student.dat.
ii. Write a function searchRollNo( r ) in Python which accepts the student’s rollno as
parameter and searches the record in the file “student.dat” and shows the details of student
i.e. rollno, name and marks (if found) otherwise shows the message as ‘No record found’.

Q2. MySQL Queries : 4 marks


Consider the table RESULT2023 given below and answer the following questions:(any 4)

RollNo Name Class Gender City Marks (a) Display


1 Naman XII M Bhopal 453 All the
boys
2 Nandini X F Jaipur 551
whose city
3 Nakshatra X F Delhi 553 is Bhopal.
4 Shailesh XI M Chandigarh 458
5 Trisha XII F Delhi 430
6 Manisha XII F Jaipur 530
(b) To display the details of class XII students in descending order of their marks.
(c) Display the Average of the marks of students who have scored more than 500.
(d) Find the maximum marks of the student for each class.
(e) Display All the student name starting with Letter “N”.

Q1 Program using Stack 8 marks


A list contains the following record of a customer:
[customer_name,phone_number,city]
Write the following user defined functions to perform given operations on the stack named ‘status’

1) Push_element() : To push to the stack an object containing name and phone number of
customer who live in Khandwa.

2) Pop_element() : To pop the objects from the stack and display them. Also, display ‘Stack
Empty’ When there is no elements in the stack.

Q2. MySQL Queries : 4 marks


Consider the table RESULT2023 given below and answer the following questions:
( Any 4)
RollNo Name Class Gender City Marks
1 Naman XII M Bhopal 453
2 Nandini X F Jaipur 551
3 Nakshatra X F Delhi 553
4 Shailesh XI M Chandigarh 458
5 Trisha XII F Delhi 430
6 Manisha XII F Jaipur 530

(a) To display city wise total marks.


(b) To display the details of class XII students whose city is “Delhi”.
(c) Display the sum of the marks of students who have scored less than 500.
(d) Find the average marks of the student for each class.
(e) Display unique cities from the table.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy