Class XII Practical List

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CLASS XII PRACTICAL QUESTION (SQL)

SESSION 2021-22

Experiment No. 1

Objective: Understanding the use of DMLcommand at MySQL plateform.


Task:
1. Create a table name Emp with following structure (EmpID Primary Key)

EmpID EmpName Designation DOJ sal comm


Number Varchar Char(10) Date Number Number
2. Insert the following Records-

EmpID EmpName Designation DOJ Sal commissio


8369 SMITH CLERK 18-12-1990 800.00 NULL
8499 ANYA SALESMAN 20-02-1991 1600.00 300.00
8521 SETH SALESMAN 22-02-1991 1250.00 500.00
8566 MAHADEV MANAGER 02-04-1991 2985.00 NULL
8654 MOMIN SALESMAN 18-09-1991 1250.00 400.00

3. Write a query to display all the records with all the columns.
4. Write a query to display EmpName and Sal of employees whose salary are greater than or equal
to 2200
5. Write a query to display details of employs who are not getting commission.
6. Write a query to display employee name and salary of those employees who don’t have their salary in
range of 2500 to 4000.
7. Write a query to display the name of employee whose name contains “A” as third alphabet in
Ascending order of employee names.
8. Write a query to display the ename and sal with 50% of sal as DA.
9. Write a query to display details of employs with the text “Notgiven”, if commission is null.
10. Display the distinct job titles offered by the Organization.
11. Display the Names of employees who are working as Manager or Analyst.
12. Display the names of employees who joined on or after 01/05/1991.
13. Display the employee records in order by DOJ.
14. Display the Distinct Designation in the Organisation.
Experiment No. 2
Objective: Understanding the use of DDL commands.
Task:Write and Execute the SQL command for the following and also write the steps/commands
in Practical notebook.
1. Create table CUSTOMER as per following Table structure.

Column CustID CustNam CustAdd CustCity CustPhone


Name e
DataType NUMB VARCH VARCH VARCH VARCHA
Length 7 30 40 30 10
Constraints Primary NotNull

2. Insert 5 records with relevant information in the Customer table.


3. Update all the records as add ‘Mr.’ with CustName.
4. Add one column Email of data type VARCHAR and size 30 to tableCustomer.
5. Add one more column CustIncomeGroup of data type VARCHAR(10).
6. Drop the column CustomerIncomeGroup from table Customer.
7. Modify the column CustCity as change the size 40 characters long.
8. Delete all the records who belongs to a particular city name.
PRACTICAL QUESTION (PYTHON)
1. Write a python program to create a series object using an ndarray that has 5 elements in the range
24 to 64.
2. Write a python program to create a series object using a dictionary that stores the number of
students in each section of class 12 in your school.
3. Write a python program to create a series object using a dictionary that stores the number of
students in each section of class 12 in your school and sort them in ascending order.
4.
5. Write a program to create a dataframe from a list containing 2 list, each containing target and
actual sales figures of four zonal offices. Give appropriate row labels.
6. Write a python program to create a dataframe to store weight, age and name of 3 people. Print the
dataframe and its transpose.
7. Write a program to display number of rows and number of columns in dataframedf.
8. Given a series that stores the area of some states in km2. Write code to find out the biggest and
smallest three areas from the given series. Given series has been created like this.
Ser1 = pd.series([34567,890,67894,54564,5464,3654,454,7989,64784,12121,68778,448])
9. Write a python program to print the dataframedf, one row at a time.
10. Write a python program to print the dataframedf, one column at a time
11. Given a data frame namely data as shown in adjacent figure. Write code statement to

Color Count Price


Apple Red 3 120
Apple Green 9 110
Pear Red 25 125
Pear Green 26 150
Lime Green 99 70
a. Find all rows with the label “apple”. Extract all columns.
b. List only the columns count and price using loc.
c. List only rows with labels ‘apple’ and ‘pear’ using loc.

12. Given a data frame namely wdf as shown below :

minTemp MaxTemp Rainfall Evaporation


0 1 8.0 24.3 0.0
1 2 14.0 26.9 3.6
2 3 13.7 23.4 3.6
3 4 13.3 15.5 39.8
4 5 7.6 16.1 2.8
5 6 6.2 16.6 0.0

i) Write command to compute sum of every column of the dataframe.


ii) Write command to compute mean of column rainfall.
iii) Write command to compute sum of every row of the dataframe.
iv) Write command to compute average of all the columns for the last 3 rows only.
v) Write command to compute average maxTemp,rainfall for first 3 rows.
13. A dataframefdf stores data about passengers, flights and years. First few rowss of dataframe are
shown below.
Year Month Passengers
0 2009 Januray 112
1 2009 February 118
2 2009 March 132
3 2009 April 129
4 2009 May 121
Using above dataframe, write commands for the following :
a) Compute total passengers per year.
b) Compute average passengers per month.

14. Consider the dataframe mks1 given below and write a program to calculate the Mode for each
subject
A B C D
ACCT 99 94 92 99
ECO 94 94 92 97
ENG 95 89 91 89
IP 94 87 99 94
MATHS 97 100 99 99
15. Consider the dataframe mks1 given below and write a program to calculate Median for each
subject
A B C D
ACCT 99 94 92 99
ECO 94 94 92 97
ENG 95 89 91 89
IP 94 87 99 94
MATHS 97 100 99 99
16. Consider the dataframe mks1 given below and write a program to calculate Average for each
subject.
A B C D
ACCT 99 94 92 99
ECO 94 94 92 97
ENG 95 89 91 89
IP 94 87 99 94
MATHS 97 100 99 99

17. Consider the dataframe mks1 given below and write a program to calculate Maximum marks
scored in each subject across all sections.
A B C D
ACCT 99 94 92 99
ECO 94 94 92 97
ENG 95 89 91 89
IP 94 87 99 94
MATHS 97 100 99 99
18. Marks is a list that stores marks of a student in 10 unit tests. Write aprogram to plot the students
performance in these 10 unit tests.
19. Write a python program to import excel file already created in python.
20. Write a program to plot a scatter graph taking a random distribution in X and Y(Both with shape
a 100) having randomly generated integers and plotted against each other.

21. Consider the following table and plot a bar chart from the medals won by Australia.
Country Gold Silver Bronze Total
Australia 80 56 15 151
England 20 23 26 69
India 36 22 35 93
Canada 15 58 12 85
South 12 36 32 80
Africa

22. TSS school celebrated volunteering week where each section of class XII dedicated a day for
collecting amount for charity being supported by the school. Section A volunteered on Monday,
B on Tuesday, C on Wednesday and so on. There are six section in class XII. Amount collected
by sections A to F are 8000,12000,9800,11200,15500,7300.
Write a program to create a pie chart showing collection amount section wise.

23. Three days price are available in three list as shown below:
Day 1 =[74.25,76.06,69.5,72.55]
Day 2 =[56.03,68.71,62.89,56.42]
Day 3 =[59.3,72.07,77,65,66.46]
Write a programme to create filled boxpolt from this data with their unique label.

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