PB 1 IP Answer Key 2024
PB 1 IP Answer Key 2024
together? 1
3 Which among the following devices cannot connect dissimilar networks
Ans: d)Bridge
specific 1
4 Which among the following clauses can be used to sort the result based on
columns of a database table?
Ans: d)Order By
1
5 Identify the SQL command to change the data in a table
Ans: c)UPDATE
6 Plagiarism refers to
Ans:b)The act of using someone else's work without proper attribution
acolumn 1
7 Which of the following python statements can be used to delete/remove
named grade' of the DataFrame, 'student"?
Ans: a)del student[grade']
1
Which among the following can be used to create a scatter chart?
Ans:c)both a and b
1
State whether the following is True or False
"In SQL, WHERE clause cannot apply conditions on a group of records"
Ans: True
1
10 CSV stands for
Ans: b)Comma Separated Values
11 To find the cardinality of the database table, student, we can use
Ans: b)Select count( * ) from student;
1
12 Which among the following is called an intelligent hub?
Ans: d)Switch
13 The data Frame Df has 10 rows. How many rows will be displaycd if the following
statement is executed ?
Statement: Df.head( )
Ans: c)5
1
J4
12PB2A1P0 info
Ty
Bulk enuail by an identified or unidentified source is
Ans: a)Spam
15 Which among thefollowing can be uscd to crcatca Dalal'rane?
Ans: )AIl (he above 28
J6 Match the lollowing SQL funclions/clauses with thcir
Ans: b)P-2, )-3, R-4, S-I descriplions:
24 ID SELECT
IISELECT SUBSTRING(' Informatics Practices', 3, 5): 2
UPPER(RIGHT(Informatics Practiccs',5);
25 a) Smart Homes, Wearable Technology, In
manufacturing, Healthcare etc 2
b)managing and directing data traffic within a local area network (LAN), Traffic
Management, segment a network into smaller, managcable parts, Switches
maintain a MACaddress table, which maps MAC addresses to the ports
26 Redundancy often occurs when the same piece of data is stored in multiple places,
Jcading to inconsistencies and difficultics in data management. Can be
reduced using
constraints(primary Key, Forcign Key)
27 Data privacy refers to the proper handling, proccssing, and storage of personal
information by organisations, cnsuring that individuals' rights to control their own
data are respected, Organizations must implement measures to protect personal
2
24P01Me information from unauthorizcd acccss, brcaches, and misuse.
Types of lnformation Collected by Websites: Personal, Account details, browsing
pattern and bchaviour, Device information, location, ctc
12PB24|P01MS
28 a) Corrected code: 2
import pandas as pd
data = { John ':{'Age': 28, 'City': 'New York', 'Salary': 50000},\
'Anna':{'Age': 24, 'City': 'London', 'Salary': 60000}, \
'Mike' :('Age': 32, 'City': 'San Fran cisco', 'Salary': 70000; }
df = pd.DataFrame(data).T
print(df)
b)Code:
import pandas as pd
data =[ ['Alice', 85, 90], ['Bob', 78, 88], [Charlie', 92, 95], [David, 65, 70]]
SECTION C
30 a) 3
import pandas as pd
data = {
'English': pd.Series([85, 78, 92, 65], index-['Alice', 'Bob', Charlie', "David']),
'Maths': pd.Series([90, 88,95, 70], index-['Alice, 'Bob, 'Charlie', 'David'])
student pd.DataFrame(data)
print(student)
OR
b) import pandas as pd import numpy as np
scores = np.array([85, 90, 78, 88, 92])
3
p
31
CREATE TABLE Nations (
Sno VARCHAR(5) PRIMARY KEY,
name VARCHAR(10) NOT NULL.
Capital VARCHAR(4),
Currency DECIMAL DEFAULT 10.50,
population NUMERIC
):
32 1)
a)Select Customerld, sum(OrderAmount) from Orders 3
b)Select CustomerlD, OrderAmount from orders order group by customerlD;
by OrderAmount;
c)Select CustomerName, OrderDate from Customers, Orders where
Orders.CustomerlD; Customers.CustomerlD=
a) Select AVGPrice) from products group by
b)Select Distinct(category) fronm Products; category;
c)select name, qty from product, sales where product.pid-sales.pid and
sdate-2024-10-10:
Section-D (2 x 4= 8 Marks)
33 import matplotlib.pyplot as plt #Statement 1
companies =[A, 'B, C, D, E]
turnover =[1500, 2000, 2500, 3000, 3500]
colors [blue', 'orange, 'green', 'red', 'purple']
pli.bar(companies, turnover , color=colors, width=.20 #statement 2
plt.xlabel(Companies') #Statement 3
plt.ylabel("Turnover (in Lakhs)
plt.title('Performance in 2024')# statement 4
plt.legend(companies, title=Companies', loc='upper let')
4
12PB24/P01MS
plt.show()
34
a)Select LOWER(Ename) from Emp;
b)Select MAX(Salary) From Emp;
c)Select Ename, Job from Emp order by Salary desc;
d)Select * from emp where salary IS NULL;
OR
MID(Ename, 1,3)
Foo
Kho
ii)
UPPER(CONCAT(Ename, Snake))
FOOTBALLCSN STADIUM
BASKETBALL KLR STADIUM
KHO-KHOVSR STADIUM
ii)
Teams Date
Eid Ename Sname
2024-11-16
10 Football CSN Stadium 6
2024-11-16
Basketball KLR Stadium 4
11
iv)
SUM(Teams)
18
5
12PB24IP01MS
Section-E (3 x 5 = 15 Marks)
5
35
i) Block C, 80-20 Rule
ii) asuitablc layout to interconncct all the blocks
iii)Betwccn A to C, D to B, B lo C
iv) In AIlthe blocks
v) STAR
5
36
)Result.index gives the index of all rows.
ii)Result.iloc[1:4]
ii)Result.drop(columns-[Roll], inplace-True)
iv)Result.dtype
v) Result.to_csv('Result.csv')
37 a) Write suitable SQL query for the following(column name and table name are specified):
i)SELECT COUNT(*) FROM Exams;
i) SELECT now( ):
ii)SELECT LOWER(SUBSTRING(hello world', 1, 3);
iii)SELECT instr('Informatics Practices', Practices):
iv)SELECT CONCAT(Hello', ", "World'):
v) SELECT YEAR (now);