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

practical questions for class xii cs

cs practical ques for viva and mcq

Uploaded by

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

practical questions for class xii cs

cs practical ques for viva and mcq

Uploaded by

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

Apeejay School Saket

Python programming questions for practice

1. Write a menu-driven program to:

1. Create a text file to store a list of programming languages.


2. Search and count how many languages start with a given letter.
3. Display all programming languages from the file.
4. Exit.
2. Write a menu-driven program to:

1. Create a text file to store paragraphs of a story.


2. Count and display the total number of characters in the file.
3. Display the file content.
4. Exit.
3. Write a menu-driven program to:

1. Create a text file with names of countries.


2. Display all country names sorted alphabetically.
3. Display the contents of the file.
4. Exit.
4. Write a menu-driven program to:

1. Create a text file containing sports names.


2. Search and replace a specific sport with another sport.
3. Display the updated file contents.
4. Exit.
5. Write a menu-driven program to:

1. Create a text file with a shopping list (one item per line).
2. Remove a specific item from the shopping list.
3. Display the entire shopping list.
4. Exit.
6. Write a menu-driven program to:

1. Create a text file to store poetry lines.


2. Display the number of lines in the file that contain a specific word.
3. Display the file content.
4. Exit.
7. Write a menu-driven program to:

1. Create a text file with a list of books (one book per line).
2. Count the books whose titles contain more than a given number of characters.
3. Display all books in the file.
4. Exit.
8. Write a menu-driven program to:

1. Create a text file with names and phone numbers of friends.


2. Search for a phone number based on a name.
3. Display all records in the file.
4. Exit.
9. Write a menu-driven program to:

1. Create a binary file to store student records (Roll Number, Name, Marks, Grade).
2. Find and display all students with a specific grade.
3. Display all student records.
4. Exit.
10. Write a menu-driven program to:

1. Create a binary file to store sales records (Sale ID, Item, Quantity, Amount).
2. Calculate and display the total sales amount for a specific item.
3. Display all sales records.
4. Exit.
11. Write a menu-driven program to:

1. Create a binary file to store library details (Book ID, Title, Borrower Name).
2. Update the borrower name for a specific book ID.
3. Display all book records.
4. Exit.
12. Write a menu-driven program to:

1. Create a binary file to store product details (Product ID, Name, Stock, Price).
2. Calculate and display the total value of stock for a specific product.
3. Display all product details.
4. Exit.
13. Write a menu-driven program to:

1. Create a binary file to store customer records (Customer ID, Name, City).
2. Search for all customers in a specific city.
3. Display all customer records.
4. Exit.
14. Write a menu-driven program to:

1. Create a binary file to store employee records (Employee ID, Name, Department,
Salary).
2. Find and display the details of the employee with the highest salary.
3. Display all employee records.
4. Exit.
15. Write a menu-driven program to:

1. Create a binary file to store order details (Order ID, Customer Name, Amount).
2. Delete an order based on its Order ID.
3. Display all order details.
4. Exit.
16. Write a menu-driven program to:

1. Create a binary file to store exam scores (Student ID, Name, Marks in three
subjects).
2. Calculate and display the average marks for a specific student.
3. Display all student scores.
4. Exit.
17. Write a menu-driven program to:

1. Create a CSV file with employee records (ID, Name, Department, Salary).
2. Update the department of an employee based on their ID.
3. Display all employee records from the file.
4. Exit.
18. Write a menu-driven program to:

1. Create a CSV file with product details (Product ID, Name, Price, Quantity).
2. Calculate and display the total stock value of all products.
3. Display all product records.
4. Exit.
19. Write a menu-driven program to:

1. Create a CSV file with school student details (Roll Number, Name, Class, Marks).
2. Display all students who scored above a given threshold in marks.
3. Display all student records.
4. Exit.
20. Write a menu-driven program to:

1. Create a CSV file with event details (Event ID, Name, Venue, Date).
2. Search for all events happening at a specific venue.
3. Display all event records.
4. Exit.

21. Write menu driven Python program to do the following:


1. Push an element in the stack
2. Pop the element from the stack
3. Display the stack
4. Exit
( Given the stack consists of elements of dictionary: book_id, Title, Author,Publish, Price)
Note: Empty stack message to be displayed if the stack is empty during pop/ display operation
MYSQL QUESTIONS for practice

1. Write SQLcommandsfor(a) to (d ) on the basis of table PRODUCT.

Table: PRODUCT
Column Name Data Type Description

Product_ID INT Unique identifier for a product.

Product_Name VARCHAR(50) Name of the product.

Price DECIMAL(10, 2) Price of the product.

Quantity INT Quantity in stock.

Warranty INT Warranty in years.

a. Display details of products with a warranty of more than 2 years.


b. Display the price of products where the quantity is null.
c. Find the sum of prices of all products.
d. Add a new product record of your choice to the table.
e. Update the price of a product with Product_ID = 101 to 500.00.
f. Delete records of products with a quantity less than 5.

2. Write SQLcommandsfor(a) to (d ) on the basis of table EMPLOYEE

Table: EMPLOYEE
Column Name Data Type Description

Emp_ID INT Employee ID.

Emp_Name VARCHAR(50) Employee Name.

Department VARCHAR(50) Department Name.

Salary DECIMAL(10, 2) Salary of the employee.

Joining_Date DATE Joining date of the employee.

a. Display the names of employees who joined after '2020-01-01'.


b. Find the total salary paid to employees in the "HR" department.
c. Display details of employees earning more than 50000.00.
d. Insert a new employee record into the table.
e. Update the department of the employee with Emp_ID = 102 to "Finance".
f. Delete records of employees whose salaries are less than 30000.00.
3. Write SQLcommandsfor(a) to (d ) on the basis of tables ORDERS and CUSTOMERS

ORDERS

Column Name Data Type Description

Order_ID INT Unique Order ID.

Customer_ID INT Customer ID (foreign key).

Order_Amount DECIMAL(10, 2) Total order amount.

Order_Date DATE Order date.

CUSTOMERS

Column Name Data Type Description

Customer_ID INT Unique Customer ID.

Customer_Name VARCHAR(50) Name of the customer.

Contact_Number VARCHAR(15) Contact number of the


customer.

City VARCHAR(50) City of residence.

a. Display the names of customers who placed orders after '2023-01-01'.


b. Find the total order amount for each customer.
c. Display all orders along with the corresponding customer names.
d. Insert a new order into the ORDERS table for an existing customer.
e. Update the city of a customer with Customer_ID = 201 to "Mumbai".
f. Delete all orders where the order amount is less than 1000.00.

4. Write SQLcommandsfor(a) to (d ) on the basis of table STUDENTS


Column Name Data Type Description

Student_ID INT Unique Student ID.

Student_Name VARCHAR(50) Name of the student.

Class INT Class/Grade of the student.

Section CHAR(1) Section of the student.

Marks DECIMAL(5, 2) Marks scored by the student.


a. Display the names of students who scored more than 90 marks.
b. Find the average marks of students in class 10.
c. List all students in class 12, section 'A'.
d. Insert a new student record into the table.
e. Update the marks of a student with Student_ID = 110 to 95.00.
f. Delete records of students who scored less than 40 marks.

5. Write SQLcommandsfor(a) to (d ) on the basis of tables SALES and PRODUCTS

SALES

Column Name Data Type Description

Sale_ID INT Unique Sale ID.

Product_ID INT Product ID (foreign key).

Quantity_Sold INT Quantity sold.

Sale_Amount DECIMAL(10, 2) Total sale amount.

PRODUCTS

Column Name Data Type Description

Product_ID INT Unique Product ID.

Product_Name VARCHAR(50) Name of the product.

Price DECIMAL(10, 2) Price of the product.

Stock INT Stock available.

a. Display the names of all products sold with their quantities.


b. Calculate the total sales amount for each product.
c. Display the details of sales where the sale amount exceeds 5000.00.
d. Insert a new sale record into the SALES table.
e. Update the stock of a product after a sale (decrement based on Quantity_Sold).
f. Delete all sales records where the quantity sold is less than 2.

You might also like