0% found this document useful (0 votes)
11 views9 pages

Ilovepdf Merged

The document outlines exam sets for Informatics Practices, detailing tasks related to data manipulation using CSV files and SQL queries. Each set includes two parts: Part I focuses on creating and visualizing data using Python's pandas and matplotlib, while Part II involves SQL operations like creating tables, inserting records, and querying data. Each set is structured to assess skills in both programming and database management, with a total of 30 marks available.

Uploaded by

nipunpatil26236
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)
11 views9 pages

Ilovepdf Merged

The document outlines exam sets for Informatics Practices, detailing tasks related to data manipulation using CSV files and SQL queries. Each set includes two parts: Part I focuses on creating and visualizing data using Python's pandas and matplotlib, while Part II involves SQL operations like creating tables, inserting records, and querying data. Each set is structured to assess skills in both programming and database management, with a total of 30 marks available.

Uploaded by

nipunpatil26236
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/ 9

Set1

Duration: 3Hours Subject: Informatics Practices (065) Total: 30 marks


Date:

Part I-8 marks (8*1=8)


(5 Mark-CSV, 2 Mark –Matplot graph, 1 Mark –Attributes)
1. To plot two or more lines with different styles
Create a csv named ‘sales’, add the values given below
week 1 week 2 week 3 week 4
10000 20000 10000 40000
20000 40000 20000 10000
30000 10000 30000 30000
2. Import values of csv to dataframe and display
3. Depict the sales for 4 weeks using line chart
4. Chart title – Sales Report
5. Xlabel – Weekly Sales
6. Ylabel – Values
7. Line colour – red for line1, green for line2
8. Line style – line1 – dotted, line2 – dashed
9. Marker – circle
10. Add Legend

Part II-7 marks (7*1=7)

1. i. Create above tables - "learner" and “student” with appropriate constraints


ii. Insert the records into the given two tables respectively.
2. Display maximum and minimum marks of students.
3. Display number of students from commerce stream.
4. Display all the details of students from learner and student whose stream is Science.
5. Modify the Admission no 10103 to 10301 from learner table
6. Display all the learners whose gender is female candidates.
7. Display total marks stream wise.

Record: 5 Marks Project file: 5 Marks Viva: 5 Marks


Set 2

Duration: 3Hour Subject: Informatics Practices (065) Total: 30


Marks Date:

Part I-8 marks (8*1=8)


(5 Mark-CSV, 2 Mark –Matplot graph, 1 Mark –Attributes)

1. Create a dataframe named ‘marks’, add the values given below

2. Export values of dataframe to csv and display


3. Depict the marks for 4 terms using bar chart
4. Chart title – Mark Analysis
5. Xlabel – Comparative Status
6. Ylabel – Marks obtained

Part II-7 marks (7*1=7)

1. i. Create above tables - "Admin" and “Employee” with appropriate constraints


ii. Insert the records into the given two tables respectively.
2. Display name and doj whose salary is in the range of 60000 to 70000.
3. Display unique department details in the employee table. .
4. Display all the details from the admin whose salary is NULL.
5. Delete the record name called Devesh.
6. Display dayname and year of date of joining from the employee table.
7. Display the details of employees whose dept begins from M.

Record: 5 Marks Project file: 5 Marks Viva: 5 Marks


Set 3

Duration: 3Hour Subject: Informatics Practices (065) Total: 30


Marks Date:

Part I-8 marks (8*1=8)


(5 Mark-CSV, 2 Mark –Matplot graph, 1 Mark –Attributes)
1. Create a csv named ‘computers’, add the values given below

2. import values of csv to dataframe and display


3. Depict the marks for 2 students using bar chart
4. Chart title – Mark Analysis
5. Xlabel – Subject
6. Ylabel – Academic performance

Part II-7 marks (7*1=7)

1. i. Create above tables - "Admin" and “Dealer” with appropriate constraints


ii. Insert the records into the given two tables respectively.
2. Modify the date of manufacturing data type from varchar(10) to date.
3. Display pcode and first 2 characters of the company.
4. Display all the details of products from admin and dealer whose price is above 100.
5. Display the pcode and date of manufacturing of product in the descending order of price.
6. Display the company name whose total company name appeared more than once.
7. Display upper of company, length of product details.
Record: 5 Marks Project file: 5 Marks Viva: 5 Marks
Set 4

Duration: 3Hour Subject: Informatics Practices (065) Total: 30


Marks Date:

Part I-8 marks (8*1=8)


(5 Mark-CSV, 2 Mark –Matplot graph, 1 Mark –Attributes)
1. Create a csv named ‘histogram’, add the values given below

2. Export values of dataframe to csv and display


3. Depict the students weights using histogram
4. Chart title – No. of. Students having same weight
5. Xlabel – Range of students
6. Ylabel – weight of students

Part II-7 marks

(7*1=7)

1. i. Create above tables - "Admin" and “Dealer” with appropriate constraints


ii. Insert the records into the given two tables respectively.
2. To display the flight number, start station in ascending order of airlines
3. Add a new column Fare to the table flight with the following values:
13450,10450,8900,9400,9876
4. Display all the flight details where ratings more than 7.
5. To display all the flight details whose end station is Bangalore or madras.
6. To display lower of start station and length of end station.
7. Display the airlines whose total airlines appeared more than once.
Record: 5 Marks Project file: 5 Marks Viva: 5 Marks
SET1

'''import pandas as pd

import matplotlib.pyplot as plt

df = pd.read_csv(r"D:\\sample25.csv")

print('Importing all the values from csv')

print(df)

x1=df['week1']

y1=df['week2']

x2=df['week3']

y2=df['week4']

plt.plot(x1,y1, color='red', linewidth = 5, label = 'line1', linestyle='dotted', marker='o',

markerfacecolor='blue', markersize=8)

plt.plot(x2,y2,color='green', linewidth = 3, label = 'line2', linestyle='dashed', marker='o',

markerfacecolor='blue', markersize=8)

plt.title("Sales Report",size=20)

plt.xlabel("Weekly Sales",size=16)

plt.ylabel("Values",size=16)

plt.legend()

plt.show()'''

#set2

'''import pandas as pd

import matplotlib.pyplot as plt

a={"Terms":pd.Series([1,2,3,4]),"Ram":pd.Series([60,58,78,92]),"Sharma":pd.Series([78,65,57,88])}

marks=pd.DataFrame(a)

print(marks)

marks.to_csv(r"D:\\sample26.csv")

print("Data Exported")

marks.plot(kind='bar', x='Terms', color=['orange','magenta'])

plt.title('\nMark Analysis ',fontsize=20)


plt.xlabel('Comaparative Status',fontsize=16)

plt.ylabel('Marks obtained',fontsize=16)

plt.show()'''

#SET3

import pandas as pd import matplotlib.pyplot as plt


#a={"Subject":pd.Series(["IT","CS","IP","AI"]),"Vino":pd.Series([60,37,50,45]),"Santhoshi":pd.Series([
35,56,52,47])}

df = pd.read_csv(r"D:\\sample3.csv")

print('Importing all the values from csv')

print(df)

marks=pd.DataFrame(df)

marks.plot(kind='bar', x='subject', color=['purple','violet'])

plt.title('\nMark Analysis ',fontsize=20)

plt.xlabel('Subject',fontsize=16)

plt.ylabel('Academic Performance',fontsize=16)

plt.show()

#set4

import pandas as pd

import matplotlib.pyplot as plt

# Define the data

nos = [5, 15, 25, 35, 45, 55]

weights = [20, 10, 45, 33, 6, 8]

df = pd.DataFrame({'nos': nos, 'weights': weights})

print(df)

df.to_csv(r"D:\\hist2.csv")

print("Data Exported")
#df.plot(kind='hist', bins=[0, 10, 20, 30, 40, 50, 60], weights=df['weights'], edgecolor="red",
title="Histogram")

plt.hist(nos,bins=[0, 10, 20, 30, 40, 50, 60],weights = [20, 10, 45, 33, 6, 8],edgecolor="red")

plt.show()

SQL

SET-1

1. i.)Create table learner(admno int,rollno int primary key,name varchar(20),gender char(1)


Create table student(rollno intprimary key,stream varchar(20),mark int)
2. ii)insert into learner (admno, rollno, name, gender) values (10103, 1 ,’rohit’,’m’),(10305,
2,‘keerthy’,’f’),(10306, 3, ‘ankitha’,’f’),(10307,4,’pramod’,’m’),(10308,5,’jenny’,’f’) insert into
student (rollno, stream ,mark) values (1 ,science,98),( 2,‘commerce’,85),( 3, ‘humanities’,87),(
4,’commerce ,100),( 5,’science ,66)
3. Select max(mark) min(mark) from student;
4. select count(*) from student where stream=’commerce’;
5. select * from learner,student where learner.rollno=student.rollno and stream=’science’;
6. update learner set admno=10301 where admno=10303;
SELECT * FROM LEARNER;
7. select * from learner where gender =’f’; 7. select stream,sum(mark) from student group by
stream;

SET-2

1. i) create table admin(admno char (2) primary key,name varchar(20),salary int ); create table
employee(admno char(2) primary key,dept varchar(20),doj date ); ii)insert into
admin(admno,name,salary) values(‘e1’,’rakesh’,50000), (‘e2’,’suresh’,60000), (‘e3’,’manesh’,55000),
(‘e4’,’devesh’,72000), (‘e5’,’sankesh’,NULL); insert into employee(admno,dept,doj)
values(‘e1’,’IT’,’2023-01-01’), (‘e2’,’marketing’,’2022-06-06’), (‘e3’,’marketing’,’2023-05-05’),
(‘e4’,’IT’,’2024-01-21’), (‘e5’,’sales’,’2012-01-01’);

2. Select name,doj from admin,employee where admin.admno=employee.admno and salary


between 60000 and 70000;

3. select distinct(dept) from employee;

4. select * from admin where salary is null;

5. delete from admin where admno=e4;

6. select dayname(doj),year(doj) from employee;

7. select * from employee where dept like ‘M%’;

SET-3
1. i)create table admin(pcode varchar (20) primay key,company varchar(20),product
varchar(20));
create table dealer(pcode varchar (20) primary key,price int, dom date);
ii) insert into
admin(pcode,company,product)values(‘p101’,‘dove’,’shampoo’),(‘p102’,’dove’,’conditioner’),(‘
p104’,’maggi’,’pasta’),(‘p105’,’kn oor’,’noodles’);
insert into dealer(pcode,price,dom) values(‘p101’, 299,’2023-1-2’),(‘p102’,199,’2023 10-
10’),(‘p104’,80 ,’2024-1-10’),(‘p105’,100,’2023-12-12’);
2. alter table dealer modify dom date; .
3. select pcode,left(company,2) from admin;
4. select product from admin,dealer where admin.pcode=dealer.pcode and price>100;
5. select pcode,dom from dealer order by price desc;
6. select company,count(company) from admin group by company having count(company)>1;
7. select upper(company),length(product) from admin ;

SET-4

1.

create table flight(fl_no varchar(5), start varchar(35), end varchar(25), airlines varchar(45));

create table ratings(fl_no varchar(5), ratings int);

insert into flight values("AM501","DELHI", "TRIVANDRUM", "JET AIRWAYS");

insert into flight values("AM812","KANPUR", "BANGALORE", "JET AIRWAYS");

insert into flight values("IC301","MUMBAI", "DELHI", "INDIAN AIRLINES");

insert into flight values("MU499","MUMBAI", "MADRAS", "SAHARA");

insert into flight values("IC377","BANGALORE", "DELHI", "INDIAN AIRLINES");

INSERT INTO RATINGS VALUES("AM501",9);

INSERT INTO RATINGS VALUES("AM812",8);

INSERT INTO RATINGS VALUES("IC301",10);

INSERT INTO RATINGS VALUES("MU499",7);

INSERT INTO RATINGS VALUES("IC377",7);

SELECT * FROM FLIGHT;

SELECT * FROM RATINGS;

2. SELECT FL_NO, START FROM FLIGHT ORDER BY AIRLINES ASC;

3. ALTER TABLE FLIGHT ADD FARE INT;

UPDATE FLIGHT SET FARE=13450 WHERE FL_NO="AM501";

UPDATE FLIGHT SET FARE=10450 WHERE FL_NO="AM812";


UPDATE FLIGHT SET FARE=8900 WHERE FL_NO="IC301";

UPDATE FLIGHT SET FARE=9400 WHERE FL_NO="MU499";

UPDATE FLIGHT SET FARE=9876 WHERE FL_NO="IC377";

SELECT * FROM FLIGHT;

4. SELECT * FROM FLIGHT F, RATINGS R WHERE F.FL_NO=R.FL_NO AND RATINGS>7;

5. select * from flight where end="bangalore" or end="madras";

6. select lcase(start), length(end) from flight;

7. select airlines,count(*) from flight group by airlines having count(airlines)>1;

You might also like