0% found this document useful (0 votes)
18 views3 pages

Class 12 Assignnment 2024

fg

Uploaded by

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

Class 12 Assignnment 2024

fg

Uploaded by

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

TABLE OF CONTENTS

S.No Name of the Exercise

Python Programs
1. Creating a menu driven program to perform arithmetic operations.

2. Creating a python program to display Fibonacci series

3. Creating a menu driven program to find factorial and sum of list of numbers
using function.

4. Creating a python program to implement returning value(s) from function.

5. Creating a python program to implement mathematical functions.

6. Creating a python program to generate random number between 1 to 6

7. Creating a python program to read a text file line by line and display each word
separated by '#'.

8. Creating a python program to read a text file and display the number of
vowels/consonants/lower case/ upper case characters.

9. Creating python program to display short words from a text file

10. Creating a python program to copy particular lines of a text file into another text
file.

11. Creating a python program to create and search records in binary file.

12. Creating a python program to create and update/modify records in binary file.

13. Creating a python program to create and search employee’s record in csv file.

14. Creating a python program to implement stack operations (list).

15. Creating a python program to implement stack operations (dictionary).

Python – SQL connectivity programs


16. Creating a python program to integrate mysql with python (creating database
and table)
17. Creating a python program to integrate mysql with python (inserting records and
displaying records)
18. Creating a python program to integrate mysql with python (searching and
displaying records)
19. Creating a python program to integrate mysql with python (updating records)

SQL Queries
20. Consider the following `Product` table:
ProductID ProductName Category Price Stock SupplierID
1 Laptop Electronics 800 15 101
2 Tablet Electronics 300 25 102
3 Chair Furniture 120 50 103
4 Desk Furniture 250 20 104
5 Monitor Electronics 180 30 101
1. Write an SQL query to create the `Product` table as shown above.
2. Write an SQL query to retrieve the names of all products priced between 200 and 500.
3. Write an SQL query to display the total `Stock` available for each `Category`.
4. Write an SQL query to delete products that are out of stock (i.e., `Stock` = 0).
5. Write an SQL query to update the `Price` of all `Furniture` items by reducing it by
10%.

21. Consider the following `Customer` table:


CustomerID CustomerName Age City LoyaltyPoints
201 Alice 28 New York 1200
202 Bob 35 Los Angeles 500
203 Carol 22 Chicago 800
204 Dave 45 Miami 1500
205 Eve 30 New York 950
1. Write an SQL query to list all unique cities where customers are located.
2. Write an SQL query to retrieve the `CustomerName` and `LoyaltyPoints` for customers aged
between 25 and 40.
3. Write an SQL query to find the average `LoyaltyPoints` of customers from New York.
4. Write an SQL query to update the `LoyaltyPoints` by adding 100 points for all customers aged
30 and above.
5. Write an SQL query to delete records of customers with less than 600 `LoyaltyPoints`
22. Consider the following `Sales` table:
SaleID ProductID SaleDate QuantitySold TotalAmount
301 1 2023-07-10 2 1600
302 3 2023-07-15 5 600
303 2 2023-08-05 3 900
304 5 2023-08-20 1 180
305 1 2023-09-01 1 800
1. Write an SQL query to display the total sales (`TotalAmount`) for each `ProductID`.
2. Write an SQL query to find the total quantity sold for each month in 2023.
3. Write an SQL query to retrieve sales records where the `QuantitySold` is greater than 2.
4. Write an SQL query to delete sales records where `TotalAmount` is less than 500.
5. Write an SQL query to retrieve the maximum `TotalAmount` for each `ProductID`.

23. Consider the following `Supplier` table:

SupplierID SupplierName ContactNumber City


101 TechSupply 555-1234 New York
102 GadgetPro 555-5678 San Francisco
103 HomeFurnish 555-8765 Los Angeles
104 OfficeEquip 555-4321 Chicago
105 ElecMart 555-7890 New York
1. Write an SQL query to list all suppliers located in New York.
2. Write an SQL query to count the number of suppliers from each city.
3. Write an SQL query to retrieve supplier names that have "Tech" in their `SupplierName`.
4. Write an SQL query to update the `ContactNumber` for the supplier with `SupplierID` 103 to
"555-9999".
5. Write an SQL query to delete suppliers from cities where there are more than one supplier.

24. Consider the following `Employee` table:


EmpID Name Age Department Salary JoinDate
1 Alice 30 HR 55000 2021-05-21

2 Bob 40 IT 75000 2018-11-12

3 Charlie 35 IT 68000 2019-06-15

4 Diana 28 Sales 49000 2022-03-01

5 Edward 45 HR 78000 2017-01-10

1. Write an SQL query to add a new column `Experience` (in years) to the `Employee` table.
2. Write an SQL query to increase the `Salary` by 5% for employees in the `HR` department.
3. Write an SQL query to retrieve names of employees who earn more than 60000 and are in the
`IT` department.
4. Write an SQL query to display the `Department` and the total `Salary` paid to employees in each
department.
5. Write an SQL query to delete records of employees who joined before `2019`.

You might also like