0% found this document useful (0 votes)
100 views8 pages

Practical Exam Papers (2024)(Set - 1 and 2)with solutions

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

Practical Exam Papers (2024)(Set - 1 and 2)with solutions

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

SSCE PRACTICAL EXAM – 2024

SUBJECT: INFORMATICS PRACTICES (065)


(SET –I)
Grade: XII (Commerce) Duration: 3 Hours
Day & Date: Tuesday, 16th February’24 Max. Marks: 30

SET - 1
Q1. Programs using Pandas and Matplotlib
(A) Write a program in Python to create the following DataFrame named EMP storing [3]
the details of employees:

Ename Job Salary Join_Date Department


1001 Suresh Manager 35000 2010-10-01 Accounts
1002 Tushar Clerk 43000 2010-01-04 Admin
1003 Jay Clerk 31000 2009-03-01 Admin
1004 Sharman Salesman 60000 2009-04-01 Sales
1005 Manoj Manager 75000 2008-08-05 Sales
1006 Manish Salesman 40000 2008-08-06 Sales
1007 Ajay Clerk 30000 2009-10-10 Accounts

Considering the above DataFrame, answer the following queries by writing appropriate
command in Python Pandas.
(i) Add a new column named Bonus which is 15% of their Salary. [1]

(ii) Add a row with index 1008 as Akhilesh, Analyst, 80000, 2012-07-12, Admin. [1]

(B) Display Bar Chart: EName (X-axis) Vs. Salary (Y-axis). [3]
Also Display Proper Title, X-label, Y-label as well as all bars in Red colour.
ANSWER:

import pandas as pd

import matplotlib.pyplot as plt

# (A) Create the DataFrame

data = {

'EName': ['Suresh', 'Tushar', 'Jay', 'Sharman', 'Manoj', 'Manish', 'Ajay'],

'Job': ['Manager', 'Clerk', 'Clerk', 'Salesman', 'Manager', 'Salesman', 'Clerk'],

'Salary': [35000, 43000, 31000, 60000, 75000, 40000, 30000],

'Join_Date': ['2010-10-01', '2010-01-04', '2009-03-01', '2009-04-01', '2008-08-05', '2008-08-06', '2009-10-10'],


'Department': ['Accounts', 'Admin', 'Admin', 'Sales', 'Sales', 'Sales', 'Accounts']

EMP = pd.DataFrame(data,index=[1001,1002,1003,1004,1005,1006,1007])

print(EMP)

# (i) Add a new column named Bonus which is 15% of their Salary.

EMP['Bonus'] = 0.15 * EMP['Salary']

print(EMP)

# (ii) Add a row with index 1008 as Akhilesh, Analyst, 80000, 2012-07-12, Admin.

EMP.loc[1008] = ['Akhilesh', 'Analyst', 80000, '2012-07-12', 'Admin', 1000]

print(EMP)

# (B) Display Bar Chart: EName (X-axis) Vs. Salary (Y-axis).

plt.bar(EMP.Enamr, EMP.Salary, color='red')

plt.title('Employee Salary')

plt.xlabel('Employee Name')

plt.ylabel('Salary')

plt.show()

Q2. SQL Queries


Prepare a database in MySQL named IP_Exam1 and create a following table STUDENT [3]
by inserting data and also write SQL command for the following questions.
Table: STUDENT
RollNo Name Stipend Stream AvgMark Class
1 MOHAN 900.00 Medical 77.5 12B
(i) List the Name, Class, Stipend of those students who are in class 12 sorted by [1]
Stipend. 2 RAVI 650.00 Commerce 88.2 11C
(ii) To Count3 of number
GANESH 400.00
of Students as Commerce
Class and Stream. 58.6 12C [1]
4 VIJAY 750.00 Humanities 73.1 12C
(iii) Change the column’s name AvgMark to Average_Marks. [1]
5 NIRAJ 500.00 Nonmedical 90.6 11A
(iv) Increase6 the Stipend
SANJAYby 200/- to Humanities students.
600.00 Medical 75.4 12B [1]
7 SURESH 650.00 Humanities 64.4 11A
Q3. Practical File [5]
8 OM 450.00 Nonmedical 88.5 12A
Q4. Project 9Work TAMANNA 400.00 Nonmedical 92.0 12A [5]
Q5. Viva-voce10 JAYESH 700.00 Commerce 67.5 12C [5]
ANSWER:
1. Create the database:
CREATE DATABASE IP_Exam1;

2. Use the database:


USE IP_Exam1;

3. Create the STUDENT table:


CREATE TABLE STUDENT (
RollNo INT,
Name VARCHAR(50),
Stipend DECIMAL(8, 2),
Stream VARCHAR(50),
AvgMark DECIMAL(5, 2),
Class VARCHAR(10)
);

4. Insert data into the STUDENT table:


insert into STUDENT values(1,'MOHAN',400.00,'Medical',78.5,'12B');
insert into STUDENT values(2,'RAVI',450.00,'Commerce',89.2,'11C');
insert into STUDENT values(3,'GANESH',300.00,'Commerce',68.6,'12C');
insert into STUDENT values(4,'VIJAY',350.00,'Humanities',73.1,'12C');
insert into STUDENT values(5,'NIRAJ',500.00,'Nonmedical',90.6,'11A');
insert into STUDENT values(6,'SANJAY',400.00,'Medical',75.4,'12B');
insert into STUDENT values(7,'SURESH',250.00,'Humanities',64.4,'11A');
insert into STUDENT values(8,'OM',450.00,'Nonmedical',88.5,'12A');
insert into STUDENT values(9,'TAMANNA',500.00,'Nonmedical',92.0,'12A');
insert into STUDENT values(10,'JAYESH',300.00,'Commerce',67.5,'12C');

i) To list the Name, Class, and Stipend of those students who are in class 12 sorted by Stipend:
SELECT Name, Class, Stipend
FROM STUDENT
WHERE Class = '12'
ORDER BY Stipend;
(ii) To count the number of students by Class and Stream:
SELECT Class, Stream, COUNT(*) AS Count
FROM STUDENT
GROUP BY Class, Stream;

(iii) To change the column's name AvgMark to Average_Marks:


ALTER TABLE STUDENT
CHANGE AvgMark Average_Marks float(5, 2);

(iv) To increase the Stipend by 200/- for Humanities students:


UPDATE STUDENT
SET Stipend = Stipend + 200
WHERE Stream = 'Humanities';
A

❖
SSCE PRACTICAL EXAM – 2024
SUBJECT: INFORMATICS PRACTICES (065)
(SET-2)
Grade: XII (Commerce) Duration: 3 Hours
Day & Date: Tuesday, 16th February’24 Max. Marks: 30

SET - 2
Q1. Programs using Pandas and Matplotlib
(A) Write a program in python to create the following DataFrame named TEACHER [3]
storing the following details:

TName POST Subject Salary Dt_join


101 Mr. P K Sharma TGT Science 55000 2018-04-01
102 Mr. Krish Sinha TGT Hindi 40000 2018-10-01
103 Ms. Sneha Reddy PGT English 45000 2018-08-11
104 Ms. Neeti Shah PGT Social Science 38000 2018-01-07
105 Ms. Nidhi Patel PGT Mathematics 40000 2018-08-11
106 Mr. R K Khanna TGT Computer 30000 2018-01-07
107 Mrs. V K Gupta PGT Gujarati 28000 2019-03-10

Considering the above DataFrame, answer the following queries by writing appropriate
command in Python Pandas.
(i) Add a new column named Bonus which is 10% of their Salary. [1]

(ii) Add a row with index 108 as Mr. Abhishek Pathak, PGT, English, 30000, 2019-04-01. [1]

(B) Display Line Chart: TName (X-axis) Vs. Salary (Y-axis). [3]
Also Display Proper Title, X-label, Y-label as well as solid line and dot marker in Blue Colour.

ANSWER:

import pandas as pd

import matplotlib.pyplot as plt

# (A) Create the DataFrame

data_teacher = {

'TName': ['Mr. P K Sharma', 'Mr. Krish Sinha', 'Ms. Sneha Reddy', 'Ms. Neeti Shah', 'Ms. Nidhi Patel', 'Mr. R K
Khanna', 'Mrs. V K Gupta'],

'POST': ['TGT', 'TGT', 'PGT', 'PGT', 'PGT', 'TGT', 'PGT'],


'Subject': ['Science', 'Hindi', 'English', 'Social Science', 'Mathematics', 'Computer', 'Gujarati'],

'Salary': [55000, 40000, 45000, 38000, 40000, 30000, 28000],

'Dt_join': ['2018-04-01', '2018-10-01', '2018-08-11', '2018-01-07', '2018-08-11', '2018-01-07', '2019-03-10']}

TEACHER = pd.DataFrame(data_teacher,index=[101,102,103,104,105,106,107])

print(TEACHER )

# (i) Add a new column named Bonus which is 10% of their Salary.

TEACHER['Bonus'] = 0.10 * TEACHER['Salary']

print(TEACHER)

# (ii) Add a row with index 108 as Mr. Abhishek Pathak, PGT, English, 30000, 2019-04-01.

TEACHER.loc[108] = ['Mr. Abhishek Pathak', 'PGT', 'English', 30000, '2019-04-01', 0]

print(TEACHER)

# (B) Display Line Chart: TName (X-axis) Vs. Salary (Y-axis).

plt.plot(TEACHER.TName, TEACHER.SALARY, color='Blue', linestyle='solid',marker=’.’)

plt.title('Teacher Salary')

plt.xlabel('Teacher Name')

plt.ylabel('Salary')

plt.show()

Q2. SQL Queries


Prepare a database in MySQL named IP_Exam2 and create a following table EMP by [3]
inserting data and also write SQL command for the following questions.
(i) Empno
Display detailEname
of Employees inJob
descendingSalary
order of their Salary.
Join_Date Department [1]
1001 NIRAJ Manager 60000 2010-10-01 Accounts
(ii) Display
1002 average
SANJAY Salary of each
Clerk Department.
33000 2010-01-04 Admin [1]
1003 SURESH Clerk 33000 2009-03-01 Admin
(iii) Increase Salary by 4000/- for Managers. [1]
1004 OM Salesman 43000 2009-04-01 Sales
1005Unique
(iv) Apply TAMANNA Manager
key constraint 60000
to Ename Column. 2008-08-05 Sales [1]
1006 JAYESH Salesman 43000 2008-08-06 Sales
Q3. Practical File RAVI
1007 Clerk 30000 2009-10-10 Accounts [5]
1008 KAILASH Manager 60000 2010-12-01 Admin
Q4. Project Work [5]
1009 VIJAY Clerk 33000 2011-10-01 Accounts
Q5. Viva-voce1010 HARESH Salesman 43000 2009-11-01 Sales [5]
ANSWER:
Create the database:
CREATE DATABASE IP_Exam2;

2. Use the database:


USE IP_Exam2;

3. Create the "EMP" table:


CREATE TABLE EMP (
Empno INT,
Ename VARCHAR(255),
Job VARCHAR(255),
Salary INT,
Join_Date DATE,
Department VARCHAR(255)
);

4. Insert data into the "EMP" table:


insert into EMP values(1001,'NIRAJ', 'Manager', 50000, '2010-10-01', 'Accounts');
insert into EMP values(1002,'SANJAY', 'Clerk', 34000, '2010-01-04', 'Admin');
insert into EMP values(1003,'SURESH', 'Clerk', 32000, '2009-03-01', 'Admin');
insert into EMP values(1004,'OM', 'Salesman', 40000, '2009-04-01', 'Sales');
insert into EMP values(1005,'TAMANNA', 'Manager', 53000, '2008-08-05', 'Sales');
insert into EMP values(1006,'JAYESH', 'Salesman', 43000, '2008-08-06', 'Sales');
insert into EMP values(1007,'RAVI', 'Clerk', 30000, '2009-10-10', 'Accounts');
insert into EMP values(1008,'KAILASH', 'Manager', 50000, '2010-12-01', 'Accounts');
insert into EMP values(1009,'VIJAY', 'Clerk', 32000, '2011-10-01', 'Admin');
insert into EMP values(1010,'HARESH', 'Salesman', 43000, '2009-11-01', 'Sales');

i) To display the details of employees in descending order of their salary:


SELECT * FROM EMP ORDER BY Salary DESC;

(ii) To display the average salary of each department:


SELECT Department, AVG(Salary) AS Average_Salary FROM EMP GROUP BY Department;

(iii) To increase the salary by 4000/- for managers:


UPDATE EMP SET Salary = Salary + 4000 WHERE Job = 'Manager';
(iv) To apply a unique key constraint to the Ename column:
ALTER TABLE EMP ADD CONSTRAINT unique_ename UNIQUE (Ename);

❖

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