You are on page 1of 8

PRACTICAL FILE- COMPUTER SCIENCE

LIST OF PRACTICALS (2022-23) CLASS-XII IP


Programming Language : Python
Distribution of Practical Marks

Suggested Practical List

Data Handling
1. Create a pandas series from a dictionary of values and an ndarray
2. Given a Series, print all the elements that are above the 75th percentile.
3. Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the
category, and print the total expenditure per category.
4. Create a data frame based on ecommerce data and generate descriptive statistics (mean, median, mode, quartile, and variance)
5. Create a data frame for examination result and display row labels, column labels data types of each column and the dimensions
6. Filter out rows based on different criteria such as duplicate rows..
7. Find the sum of each column, or find the column with the lowest mean.
8. Locate the 3 largest values in a data frame.
9. Subtract the mean of a row from each element of the row in a Data Frame.
10. Replace all negative values in a data frame with a 0.
11. Replace all missing values in a data frame with a 999.
12. Importing and exporting data between pandas and CSV file
13. Importing and exporting data between pandas and MySQL database
Visualization
14. Given the school result data, analyse the performance of the students on different parameters, e.g subject wise or class
wise.
15. For the Data frames created above, analyze and plot appropriate charts with title and legend.
16. Take data of your interest from an open source (e.g. data.gov.in), aggregate and summarize it. Then plot it using different
plotting functions of the Matplotlib library.

7.2 Data Management


17. Create a student table with the student id, name, and marks as attributes where the student id is the primary key.
18. Insert the details of a new student in the above table.
19. Delete the details of a particular student in the above table.
20. Use the select command to get the details of the students with marks more than 80.
21. Create a new table (order ID, customer Name, and order Date) by joining two tables (order ID, customer ID, and order
Date) and (customer ID, customer Name, contact Name, country).
22. Create a foreign key in one of the two tables mentioned above
23. Find the min, max, sum, and average of the marks in a student marks table.
24. Find the total number of customers from each country in the table (customer ID, customer Name, country) using group by.
25. Create a new table (name, date of birth) by joining two tables (student id, name) and (student id, date of birth).
26. Write a SQL query to order the (student ID, marks) table in descending order of the marks.
Write the queries in SQL for following table -
Write the SQL commands for following ---------HOSPITAL
No. Name Age Department Date of Charge Queries
Adm s
1 Arpit 34 Surgery 21-Oct-98 345 *To Show all information about the patients of cardiology department.
2 Arun 45 Ent 22-Oct-98 456 *To list the names of patients who are in ENT department and charges
3 Ravi 42 Dental 23-Oct-98 678 are less than 300
4 Mahesh 36 Othopadic 24-Oct-98 876 *To list names of all patients with their date of admission in ascending
5 Meena 54 Surgery 25-Oct-98 745 order
6 Sangeeta 32 Eye 21-Oct-98 234 *Write the command to find out the no of total different departments.
7 Rahul 21 Cardiology 26-Oct-98 521 *To find out the total charges of ENT department
8 Vijay 34 Nurology 27-Oct-98 365 *To find out the average charges for date of admission before
9 Ashok 55 Urology 22-Oct-98 223 12/02/98.
*To count number of patients with age <30
10 Naresh 43 Cardiology 21-Oct-98 164

STUDENT
Student Cla Name Game Grade SUPW Grade1 Queires
No. ss
1 11 Sameer Cricket A Photography A *Display the names of the students who are getting grade ‘C’ in either
2 12 Sujit Tennis B Gardening C GAME or SUPW
*Display the number of students getting grade ‘A’ in cricket
3 11 Vinay Cricket B Planting C
*Display the different games offered in the school
4 12 Deepak Badminton B Photography C *Display the SUPW taken by the students, whose name starts with ‘A’
5 11 Raju Badminton A Music A *Add a new column named ‘Marks’
6 11 Meena Chess A Social Work B *Assign a value 200 for Marks for all those who are getting grade ‘B’ or
7 12 Sheela Chess C Social Work B above in GAME.Arrange the whole table in the alphabetical order of SUPW.
8 12 Narayan Cricked C Planting A
9 12 Kishore Badminton A Photography B
RECIPIENT SENDER

RecID SenderID RecName RecAddress Reccity SenderID SenderName SenderAddress Sendercity


KD01 ND01 R Bajpayee 5,Central Kolkata ND01 R Jain 2,ABC Appts New Delhi
Avenue
KD02 ND02 S Mahajan 116,A Vihar New Delhi ND02 H Sinha 12, Newtown Mumbai
KD03 ND03 K P Verma 111 B house Jaipur ND03 Amit 20 , V Enclave New Delhi
KD04 ND04 M Malviya 123 C house Jaipur ND04 Kapil 12 , B54 N Rly Jaipur
KD05 ND05 S Dashrath 34 Wing C Jodhpur ND05 Rahul 23 Lic Colony Jaipur
KD06 ND06 R Subharm 45 Wing D Jodhpur ND06 Sanjay 28 Ganpati ngr New Delhi
KD07 ND07 J Santoshi 33 White rd Kanpur ND07 Sanjeev 11 pushpvihar Bangalore
KD08 ND08 M Joseph 45 Narangngr New Delhi ND08 Mohit 34 rajendra ngr Varanasi
KD09 ND09 V Joshi 43 B 52 New Delhi ND09 Rajeev 22 asha ganj Banagalore
KD10 ND10 K Ashwin 12 Cannot P New Delhi ND10 Krishna 28 janta ngr Ahmedaba
d
















 To display the names of all senders from Mumbai
 To display the RecID,SenderName,SenderAddress,RecName,RecAddress for every Recipient.
 To display recipient details in ascending order of RecName
 To display number of recipients from each city
 To display recipient name and sender name.

Library
No Title Author Type Pub Qty Price
1 Data Structure Lipschutz DS McGraw 4 217 (a)Select all the PROG type published by BPB from
2 Computer Studies French FND Galgotia 2 75 Library.
(b) Display a list of all books with price more than
3 Advanced Pascal Schildt PROG McGraw 4 350
130 and sorted by Qty.
4 Dbase Dummies Palmer DBMS PustakM 5 130
(c) Display all the books sorted by price in ascending
5 Mastering C++ Gurewich PROG BPB 3 295
order .
6 Guide Network Freed NET ZPress 3 200 (d) count the number of books published by PHI.
7 Mastering Foxpro Seigal DBMS BPB 2 135 (e) Display the average price for qyt < 3 .
8 DOS guide Norton OS PHI 3 175
9 Basic for beginners Morton PROG BPB 3 40
10 Mastering Window Cowart OS BPB 1 225

 List the names of those students who have obtained

GRADUATE : Div I sorted by name.


 Display the report , listing NAME , STIPEND , SUBJECT and amount of
S.N Name STIPEN SUBJECT AVER DIV stipend received in a year assuming that the STIPEND is paid every month.
o. D AGE  To count the number of students who are either PHYSICS or COMPUTER
1 KARAN 400 PHYSICS 68 1 graduates.
2 DIWAK 450 COMPUTE 68 1  To insert a new row in the graduate table –
AR R 11,’KAJOL’,300,’COMPUTER’,75,1
3 DIVYA 300 CHEMISTR 62 2  Give the output of following SQL statements based
Y
4 ARUN 350 PHYSICS 63 1 on table GRADUAT
5 SABINA 500 MATHS 70 1 (i) Select MIN(AVERAGE) from
6 JOHN 400 CHEMISTR 55 2
Y GRADUATE where SUBJECT = “PHYSICS”
7 ROBER 250 PHYSICS 64 1 (ii) Select SUM(STIPEND) from GRADUATE where
T DIV = 2 ;
(iii) Select AVG(STIPEND) from GRADUATE where
average >=65 ;
8 RUBIN 450 MATHS 68 1
A
9 VIKAS 500 COMPUTE 62 1
R
10 MOHA 300 MATHS 57 2
N

Table : SchoolBus Write SQL commands for the following –


*To show all the records for noofstudents more than the
RtN Area_covered Capacit Noofstudents Distance Transporter charges capacity in order of RtNo.
o y
1 Vasant kunj 100 120 10 Shivam Travels 100000 *To show area_covered for buses covering more than 20 Km,
2 Hauz Khas 80 80 10 Anand Travels 85000 but charges less than 80000.
3 Pitampura 60 55 30 Anand Travels 60000 *To show transporterwise total no. of students traveling .
4 Rohini 100 90 35 Anand Travels 100000
*To show Rtno , area_covered and average cost per student for
5 Yamuna 50 60 20 Bhall Co. 55000
Vihar all routes.
6 Krishna 70 80 30 Yadav Co. 80000 *Add a new column drivername in the schoolbus relation .
Nagar
7 Vasundhara 100 110 20 Yadav Co. 100000
8 Paschim 40 40 20 Speed Travels 55000
Vihar
9 Saket 120 120 10 Speed Travels 100000
10 Jank Puri 100 100 20 Kisan Tours 95000
Q15. Consider the following tables WORKERS and DESIG. Write SQL commands for the following queries –
W_ID FIRSTNAME LASTNAME ADDRESS CITY
102 Sam Tones 33 Elm Stn. Paris
105 Sarah Ackerman 440 Us 110 New York
144 Manila Sengupta 24 Friends Street New Delhi
210 George Smith 83 First Street Howard
255 Marry Jones 842 Vine Ave Losantiville
300 Robert Samuel 9 Fifth Cross Washington
355 Henry Williams 12 Moore Street Boston
403 Ronny Lee 121 Harison Station New York
451 Pat Thompson 11 Red Road Paris
DESIG
W_ID SALARY BENEFITS DESIGNATION
102 75000 15000 Manager *To display W_ID , Firstname , Address and city of all employees living in New
105 85000 25000 Director York from the table workers.
144 70000 15000 Manager *To display the content of WORKERS table in ascending order of Lastname.
210 75000 12500 Manager *To display the firstname , Lastname and Total salary of all Clerks from the tables
WORKERS and DESIG , where total salary is calculated as Salary + Benefits .
255 50000 12000 Clerk
*To display the minimum salary among managers and clerks from the table
300 45000 10000 Clerk
DESIG .
355 40000 10000 Clerk
*To display the firstname , salary of all managers.
400 32000 7500 Salesman
451 28000 7500 Salesman
To list the total different designations.
(b) Write SQL commands for the flowing statements:
(i) To display the names of all activities with their Acodes in descending order.
(ii) To display sum of PrizeMoney for the Activities played in each of the Stadium
separately.
(iii) To display the coach's name and ACodes in ascending order of ACode from
the table COACH
(iv) To display the content of the Activity table whose ScheduleDate earlier than
01/01/2004 in ascending order of ParticipantsNum.
(c) Give the output of the following SQL queries: 2
(i) SELECT COUNT(DISTINCT ParticipantsNum) FROM ACTIVITY;
(ii) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM ACTIVITY;
(iii) SELECT Name,ActivityName FROM ACTIVITY A,COACH C
WHERE A.Acode=C.Acode AND A.ParticipantsNum=10;
(iv) SELECT DISTINCT Acode FROM COACH

You might also like