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

Ip Practical File Final

Uploaded by

Samuel
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)
24 views

Ip Practical File Final

Uploaded by

Samuel
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/ 50

INFORMATICS PRACTICES

PRACTICAL RECORD

Samuel Jerald Xavier Dhas


12 F
Affiliated to the Central Board of Secondary Education. Affiliation No. 6630016

Subject: Informatics Practices


Practical Record

Submitted at the time of Senior School Certificate Examination (AISSCE)


conducted by Central Board of Secondary Education during the academic year
2024-25.

Roll No: ………………………………

Certified that this is the bona fide record of work done by


………………………………………………..
Roll Number ……………………………………………….
of Class XII during the year 2024-2025 in Informatics Practices.

Date: …………………………………….

Internal Examiner No. :…………………………………………………………………


Internal Examiner Sign :…………………………………………………………………

External Examiner No. :………………………………………………………………..


External Examiner Sign:………………………………………………………………..
INDEX
Sl. Topic Page
No No
Python Pandas

1 Create a series from a dictionary of values and a ndarray 1

2 Multiply and divide two Pandas Series. 2

3 Create pandas series for term marks and calculate the final marks. 3
Program to create a Series named S1 and display its type, change the Series into a list and
4 display its type , display the elements of the Series which are above 20. 5

5 Change the order of index of a given series 6

6 Create and display a DataFrame from a specified dictionary with index labels. 7

7 Get the first 3 rows and last 4 rows of a given DataFrame 8


Create a dataframe for examination result and display row labels, column labels, data
8 9
types of each column and the dimensions
9 Create a dataframe and display the specified columns and rows with the given condition 11
Create a dataframe and display the specified columns of given rows, access a particular
10 value and rows with the given condition from it. 12

11 Count the number of rows and columns of a DataFrame. 14


12 Import and export data between Pandas and CSV file 15
13 DataFrame - Adding columns and removing columns 16
Dataframe – Adding column , adding row and renaming column
14 18
Program to select the 'name' and 'score' columns from the given DataFrame. Also change
15 the score in row ‘d’ to 11.5 20

16 Add a column, delete a column, delete a row and rename a column in a dataframe 22
Data Visualization

Create a dataframe to store the school result data, analyses the performance of the students
17 on different parameters, e.g., subject wise or class wise. 24

18 Program to create line chart and bar chart 26


19 Program to create histogram 28

20 Program to create line chart, bar chart and multiple bar chats 30
Data Management

21 DDL & DML commands - Student Table 33


22 DDL & DML commands – Teacher Table 41
23 Join Queries 45
1. Write a program to create a pandas series from a dictionary of values and
a ndarray.

Output:

1
2. Write a program to multiply and divide two Pandas Series.

Output:

2
3. Three series objects stores the marks of 10 students in three terms. Roll numbers of
students form the index of these Series objects. The three series objects have the
same indexes.
Write a Python Program to calculate the final marks obtained by students as per
following formula :
Final marks = 25% term1 + 25% term2 + 50% term3
Store the final marks of students in another Series object.

Output:

3
4
4. Write a program to create a Series named S1 and display its type. Change the Series
into a list and display its type. Also display the elements of the Series which are above
20.

Output:

5
5.Write a program to change the order of index of a given
series.
Original Data Series:
A1
B2
C3
dtype: int64
Data Series after changing the order of index:
B2
A1
C3
dtype: int64

Output:

6
6. Write a program to create and display a DataFrame from a specified dictionary
with index labels.

Output:

7
7. Write a program to get the first 3 rows and last 4 rows of a given
DataFrame

Output:

8
8. Create a dataframe for examination result and display row labels, column labels, data
types of each column and the dimensions

Outputs:

9
9. Write a program to create a Dataframe quarterly sales where each row contains the item
category, item name, and expenditure.

Do the following tasks in the dataframe:

Outputs:

a) Display the itemname and expenditure columns

10
b) Display the rows where expenditure is more than 2500

11
10.

Outputs:

12
a) Display city and favourite_color columns of first, fourth and seventh rows

b) Access value Chennai

c) Find rows where value of age is more than 16

d) Find rows where age is more than 13 and gender is Female

13
11. Write a Pandas program to count the number of rows and columns of a DataFrame.

Output:

14
12. Write a program to import and export data between Pandas and CSV file.

Outputs:

15
13. Write a Program to create a dataframe emp to hold empno, empname and salary details of 5
employees and perform the following tasks:

Outputs:

16
a) Add a column ‘Bonus’ which is calculated as 5% of salary.

b) Add a column ‘Dept’ between empname and salary columns and populate it with appropriate
values.

c) Remove the column ‘Bonus’.

17
14.

Outputs:

i. Add a column called Num_Copies with the following data: [300,290,450,760].

18
ii. Add a new genre of type ‘Folk Tale' having code as “FT” and 600 number of copies.

iii. Rename the column ‘Code’ to ‘Book_Code’.

19
15. Write a program to select the 'name' and 'score' columns from the following DataFrame.
Also change the score in row ‘d’ to 14.5
Sample DataFrame:
exam_data = {'name': ['Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew',
'Laura', 'Kevin', 'Jonas'],
'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5, np.nan, 8, 19],
'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1],
'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']}
labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

Outputs:

20
21
16.

Outputs:

(a) Add a new column ‘qty’ with values 10,65,45,80

22
(b) Delete column price

(c) Delete the second row in the Dataframe

(d) Rename column qty to quantity

23
Data visualization

17. Write a program to create a dataframe to store the school result data, analyses the
performance of the students on different parameters, e.g., subject wise or class wise.

Outputs:

24
25
18.

Outputs:

26
a) A line chart from the 1990 and 2000 columns of dataframe df1

b) Create a bar chart plotting the three columns of dataframe df1

27
19. Create a Dataframe quarterly_sales with columns Salesman, Sales, Quarter and District.
Write a program to draw a histogram based on monthly sales report for all numeric columns.

Outputs:

28
29
20.

30
Outputs:

(a) A line chart depicting the prices of the apps

31
(b) A bar chart depicting the downloads of the apps

(c) Compute Estdownload sequence that has each download value divided by 1000.

32
21.

(a) Create a database school. Inside this database, create a table student with the appropriate
specifications for storing the following data.

CREATE DATABASE school;

USE school;

CREATE TABLE student (

No INT PRIMARY KEY,

Name VARCHAR(50),

Stipend DECIMAL(5,2),

Stream VARCHAR(50),

AvgMark DECIMAL(3,1),

Grade CHAR(1),

Class CHAR(3));

(b)Populate the table with the following records

33
INSERT INTO student VALUES

(1, 'Karan', 400.00, 'Medical', 78.5, 'B', '12B'),

(2, 'Divakar', 450.00, 'Commerce', 89.2, 'A', '11C'),

(3, 'Divya', 300.00, 'Commerce', 68.6, 'C', '12C'),

(4, 'Arun', 350.00, 'Humanities', 73.1, 'B', '12C'),

(5, 'Sabina', 500.00, 'Nonmedical', 90.6, 'A', '11A'),

(6, 'John', 400.00, 'Medical', 75.4, 'B', '12B'),

(7, 'Robert', 250.00, 'Humanities', 64.4, 'C', '11A'),

(8, 'Rubina', 450.00, 'Nonmedical', 88.5, 'A', '12A'),

(9, 'Vikas', 500.00, 'Nonmedical', 92.0, 'A', '12A'),

(10, 'Mohan', 300.00, 'Commerce' ,67.5, 'C', '12C');

SELECT * FROM student;

Output:

34
c) Delete the details of ‘Mohan’. Undo the changes. Save the details permanently.

DELETE FROM student WHERE Name = 'Mohan';

SELECT * FROM student;

Output:

ROLLBACK;

COMMIT;

SELECT * FROM student;

(d) Display all the Nonmedical stream students from the table.

SELECT * FROM student WHERE Stream = ‘Nonmedical';

Output:

35
(e) List the names of those students who are in class 12 sorted by stipend

SELECT Name FROM student WHERE Class like ’12%' ORDER BY

Stipend ASC;

Output:

(f) List all students sorted by AvgMarks in descending order

SELECT Name FROM student ORDER BY AvgMark DESC;

Output:

36
(g) Display the average stipend of each stream

SELECT DISTINCT Stream, AVG(Stipend) AS AvgStipend FROM

student GROUP BY Stream;

Output:

(h) Display the details of students who scored Avgmarks less than 75 and Grade is B

SELECT * FROM student WHERE AvgMark < 75 AND Grade = ‘B’;

Output:

(i) Display the total stipend spent for class 12

SELECT SUM(Stipend) AS TotalStipend FROM student WHERE Class

like ’12%';

Output:

37
(j) List the name and stream of students whose name contains letter ‘a’

SELECT NAME, STREAM FROM student WHERE Name like ‘%a%';

Output:

(k) List the details of students whose grade is either A or C

SELECT * FROM student WHERE Grade in (‘A','C');

Output:

(l) Display No, Name and Class of students whose score is in the range 60 to 80

SELECT No, NAME, Class FROM student WHERE AvgMark BETWEEN 60

And 80;

38
Output:

(m) Display the different streams in the table

SELECT DISTINCT Stream FROM student;

Output:

(n) Display the number of students in each stream

SELECT COUNT(*) FROM student GROUP BY Stream;

Output:

39
(o) List the details of students who are not in the Humanities stream

SELECT * FROM student WHERE Stream != ‘Humanities';

Output:

40
22. (a) Create table Teacher in database school with the appropriate specification in order to
store the given data

CREATE TABLE Teacher (


ID INT PRIMARY KEY,
Name VARCHAR(50),
Department VARCHAR(50),
Hiredate DATE,
Category VARCHAR(5),
Gender CHAR(1),
Salary DECIMAL(8, 2));

(b) Insert the given records into the table

INSERT INTO Teacher VALUES

(1, 'Tanya Nanda', 'Social Studies', '1994-03-17', 'TGT', ‘F',25000),

(2, 'Saurabh Sharma', 'Art', '1990-02-12', 'PRT', 'M', 20000),

(3, 'Nandita Arora', 'English', '1980-05-16', 'PGT', 'F', 30000),

(4, 'James Jacob', 'English', '1989-10-16', 'TGT', 'M', 25000),

(5, 'Jaspreet Kaur', 'Hindi', '1990-08-01', 'PRT', 'F', 22000),

(6, 'Disha Sehgal', 'Math', '1980-03-17', 'PRT', 'F', 21000),

(7, 'Siddharth Kapoor', 'Science', '1994-09-02', 'TGT', 'M', 27000),

(8, 'Sonali Mukherjee', 'Math', '1980-11-17', 'TGT', 'F', 24500);

41
SELECT * FROM Teacher;

Output:

(c) Display all information about teachers of PGT category

SELECT * FROM Teacher WHERE Category = ‘PGT’;

Output:

(d) To list the names of female teachers of Hindi Department

SELECT Name FROM Teacher WHERE Gender = 'F' AND Department = 'Hindi';

Output:

(e) To list names, departments and date of hiring of all teachers in ascending order of date of
hiring

SELECT NAME, Department, Hiredate FROM Teacher ORDER BY Hiredate ASC;

Output:

42
(f) To count the number of teachers in English department

SELECT COUNT(*) FROM Teacher WHERE Department = ‘English';

(g) To list the teachers details whose name starts with letter ’s’

SELECT * FROM Teacher WHERE Name like ’s%';

Output:

(h) Display gender wise average salaries

SELECT Gender, AVG(Salary) FROM Teacher GROUP BY Gender;

Output:

(I) Display total salary of each category

SELECT Category, SUM(Salary) FROM Teacher GROUP BY Category;

Output:

(j) To list the details of teachers who joined in year 1980

SELECT * FROM Teacher WHERE Hiredate like ‘1980%';

43
Output:

(k) Display the name, department and category of teachers whose salary is less than 23000

SELECT NAME, Department, Category FROM Teacher WHERE Salary < 23000;

Output:

(l) Add a new column Bonus to the table and Compute the Bonus as 10% of Salary

ALTER TABLE Teacher ADD Bonus DECIMAL(8, 2);

UPDATE Teacher SET Bonus = Salary * .10;

Output:

(m) Display the name and department of teachers whose name does not contain letter ‘r’

SELECT NAME, Department FROM Teacher WHERE Name NOT like ‘%r%’;

Output:

(n) Display the details of teachers in ascending order of Category, then descending order of
Salary

44
SELECT * FROM Teacher ORDER BY Category ASC, Salary DESC;

Output:

(o) Display the details of teachers whose department is either Art or Science

SELECT * FROM Teacher WHERE Department IN (‘Art','Science');

Output:

23. Excellent Consultancy Pvt. Ltd. maintains two tables for all its employees.

45
Write queries for the following:

a) Display the first name, last name and amount of reward for all employees.

SELECT Employee.First_name, Employee.Last_name, Reward.Amount

FROM Employee JOIN Reward ON Employee.Employee_id = Reward.Employee_id;

Output:

b) Display first name and salary of all the employees whose amount is less than 2000.

SELECT Employee.First_name, Employee.Salary

FROM Employee

JOIN Reward ON Employee.Employee_id = Reward.Employee_id

WHERE Reward.Amount < 2000;

Output:

46
c) Display the first name and date of reward of those employees who joined on Monday.

SELECT Employee.First_name, Reward.Date_reward

FROM Employee

JOIN Reward ON Employee.Employee_id = Reward.Employee_id

WHERE DAYNAME(Employee.Joining_date) = 'Monday';

Output:

EMPTY SET

d) Display sum of salary of those employees whose reward amount is greater than 3000.

SELECT SUM(Employee.Salary) AS Total_Salary

FROM Employee

JOIN Reward ON Employee.Employee_id = Reward.Employee_id

WHERE Reward.Amount > 3000;

Output:

47

You might also like