IP Class12 Practical Questions
IP Class12 Practical Questions
File
Python Programs
1. Create a series of these numbers: 33, 55, 65, 29, 19, 23.
2. Write code to show all attributes of series. Use series in Q1.
3. Write code to change value 29 and 23 from series Q1.
4. Create a series of 10 numbers starting with 41 and with the increment of 3.
5. Use Series created in Q2 and find output of following commands: s[:2], s[1:3] &
s[[1,3,4]].
6. Create a series of 10 numbers using ndarray.
7. Write code to sort series in descending order (Use Q6).
8. Create a series and print the top 3 and bottom 3 elements using the head and tail
functions.
9. Create a dataframe countries using a dictionary which stored 5 country names, capitals
and populations of the country. Index will be years.
10.Write a program to show all attributes of dataframe created in Q9.
11.Create a dataframe players to store 10 players with their highest and lowest score,
no_of_matches columns. Player names are indices of dataframe. Perform following
questions:
a) Show data of any two players using loc function.
b) Show any two columns.
c) Show data of two rows and two columns using loc function.
d) Make use of rename command to change column name no_of_matches to
Matches_played.
e) Drop row of last player.
12.Make multiple bar graph for dataframe created in Q11.
13.Create line graph for temp. seven days of week.
14.Create histogram to show sales of one month data.
MySQL Programs
1. Create the following table product:
Table: Products
| Pcode | Pname | Qty | Price | Company |
|-------|--------------------|-------|--------|---------|
| P1001 | Ipad | 15000 | Apple |
| P1002 | LED TV | 85000 | Sony |
| P1003 | DSLR CAMERA | 25000 | Philips|
| P1004 | iPhone | 95000 | Apple |
| P1005 | LED TV | 45000 | MI |
| P1006 | Bluetooth Speaker | 20000 | Ahuja |
2. Show table structure.
3. Show records of table products.
4. Show products of pcode P1001 and P1005.
5. Show data of products starting with i.
6. Show data of all products whose quantity > 50 and price > 30000.
7. Show sum of price of all products.
8. Show product names in upper case and also length of all products.
9. Show product name and qty joined with space under heading “Product and Qty”.
10.Display first 2 and last 2 letters from Pname.
11.Write queries using empl table:
Show avg salary of each job.
Show min salary of each department where minimum employees are > 3.
12.Write queries using empl and dept table:
Show employee names and location of job.
Show avg salary of employees working in sales department.
Show ename, salary, dname, and location and all employees.
13.Display current date and time.
14.Display day of week, day of year and day name for current date.
15.Write query to drop the table product.