12 Information Practices Text Book Preeti Arora
12 Information Practices Text Book Preeti Arora
12 Information Practices Text Book Preeti Arora
For example,
import pandas as pd
data1 = {'Name': ['Rahul', 'Hiten', 'Yuvan'],
'Age': [30, 18, 21], 'City': ['New York', 'Los Angeles',
'Chicago']}
df1 = pd.DataFrame(data1)
print("Using iterrows():")
for index, row in df1.iterrows():
print("Index:", index, "Name:", row['Name'], "Age:", row['Age'],
"City:", row['City'])
data2 = {'Name': ['Rahul', 'Hiten', 'Yuvan'], 'Age': [30, 18, 21],
'City': ['New York', 'Los Angeles', 'Chicago']}
df2 = pd.DataFrame(data2)
print("\nUsing a for loop:")
for column_name in df2:
print("Column Name:",column_name)
for index, value in df2[column_name].items():
print("Index:", index, "Value:", value)
print()
Ans 9. (a) seal.empty- returns True if series object ‘seal’ is empty.
(b) seal.index- returns index of the series, seal.
(c) seal.dtype- returns the data type of series object ‘seal’.
(d) seal.hasnans- returns True if ‘seal’ is having any NaN value.
Ans 10. fillna() method is used to fill all missing (NA/NaN) values.
Its syntax is – DataFrameObject.fillna(value which is to be filled)
For example- df.fillna(0), here 0 replaces NaN values of a dataframe, df.
Ans 11. (a) import pandas as pd
data={'Item_ID':['PC01','LC05','PC03', 'PC06','LC03'],
'ItemName':['Personal Computer','Laptop', 'PersonalComputer',
'Personal Computer', 'Laptop'],
'Manufacturer':['HCL India', 'HP USA','Dell USA','Zenith
USA','Dell USA'], 'Price':[42000,55000,32000,37000,57000]}
dfl=pd.DataFrame(data)
print(dfl)
(b) import pandas as pd
data={'Item_ID':['LC03','PC03','PC06','LC03','PC01'],
'CustomerName':['N Roy','H Singh', 'R Pandey','C Sharma',
'K Agarwal'], 'City':['Delhi','Mumbai', 'Delhi', 'Chennai',
'Bengaluru']}
dfC=pd.DataFrame(data)
print(dfC)
(c) merged_df = pd.merge(dfl, dfC, on='Item_ID')
(d) df_left_join = pd.merge(dfl, dfC, how='left', left_on="Item_
ID", right_on="Item_ID")
(e) df_right_join = pd.merge(dfl, dfC, how='right', left_on="Item_
ID", right_on="Item_ID")
Book-XII 3
(b) pencils 37
dtype: int64
(c) pencils 37
notebooks 46
dtype: int64
(d) pencils_12
notebooks 12
scales 83
erasers 42
dtype: int64
(e) Index(['pencils', 'notebooks', 'scales', 'erasers']
dtype='object'
(f) [12 12 83 42]
Ans 15. import pandas as pd
weather_data={'day':['01/01/2018','01/02/2018','01/03/2018',
'01/04/2018','01/05/2018','01/01/2018'],'temperature':
[42,41,43,42,41,40],'windspeed':[6,7,2,4,7,2],
'event':['Sunny','Rain','Sunny','Sunny', 'Rain', 'Sunny']}
df=pd.DataFrame(weather_data)
print(df)
for column in df.columns[0:3]:
print(df[column])
Ans 16. import pandas as pd
weather_data={'day':['01/01/2018','01/02/2018','01/03/2018',
'01/04/2018','01/05/2018','01/01/2018'], 'temperature':
[42,41,43,42,41,40], 'windspeed':[6,7,2,4,7,2],
'event':['Sunny','Rain','Sunny','Sunny', 'Rain', 'Sunny']}
df=pd.DataFrame(weather_data)
print(df)
for index, row in df.iterrows():
print(index,row)
Ans 17. (a) The underlined codes result in error.
s2=pd.Series([101,102,1-2,104)]
print(s2.index)
s2.index=[0.1.2.3,4,5]
s2[5]=220
print(s2)
(i) closing parenthesis ‘)’ does not match opening parenthesis ‘[’.
(ii) The values of index are wrong and Length mismatch: Expected axis has
4 elements, new values have 6 elements and they must be separated by
comma (,) instead of dot (.).
Corrected code is –
import pandas as pd
S2=pd.Series([101,102,112,104])
print(S2.index)
S2.index=[0,1,2,3]
S2[5]=220
print(S2)
Book-XII 5
Ans 26. We will use the names attribute to specify our own column names to read data
from csv file.
Ans 27. header=None attribute ensures that the top/first row’s data is used as data and
not as column headers.
Ans 28. nrows argument is given to read_csv() if we want to read the top 10 rows of
data.
Ans 29. (i) Project.loc[4]=["Mohit",'XII','A',"NumPy"]
Project.at[5,:]=["Ashu",'XII','B',"Python"]
(ii) Project['Grade'] = [ 'A', 'B', 'A', 'B', 'C']
(iii) Project [['Name', 'Section']]
(iv) Project.loc[[101,102]]
(v) Project.insert(2, 'School Name', ['ABC School', 'AMC School',
'BPB School', 'DAVV School', 'SCS School'])
(vi) Project.loc[[1,2]]
(vii) Project.at[3, 'Class'] = ['XI']
Project.at[3, 'Grade'] = [''A'']
(viii) Project = Project.drop(['Project Name', 'Grade'], axis=1)
Ans 30. import pandas as pd
D1 = {'ID':[100,110,120,130],
'State':['Delhi','Mumbai','Chennai','Surat'],
'Cases':[3000,4000,5000,4500]}
df=pd.DataFrame(D1)
print(df)
(a) df['Recovery']=[2300, 3300, 4800, 4300]
(b) df = df.assign(NoOfDeaths=[20,55,70,66])
print(df)
(c) df.loc[len(df.index)]=[140,'Rajasthan',6000, 5400,70]
(d) df.insert(3, "Percentage",[76.6,82.5,96.0,96.0,90.0])
(e) del df['Percentage']
(f) df.pop('NoOfDeaths')
(g) df.iloc[0]=[90,'Uttar Pradesh',8000,6800]
(h) df.drop('State', axis=1, inplace=True)
df.drop('Cases', axis=1, inplace=True)
Ans 31. import pandas as pd
name_grade =
pd.Series(['B','A','B+','C','B'],index=["Jai","Jia","Pooja",
"Mani","Shourya"])
name_marks = pd.Series([80,94,86,78,88],
index=["Jai","Jia","Pooja","Mani","Shourya"])
s1 =pd.concat([name_grade,name_marks],axis=1)
student=pd.DataFrame(s1)
print(student)
(a) print(student.head(3))
(b) print(student.tail(2))
Book-XII 7
(b) df['Salary']=df['Salary']+5000
df2['Salary']=df2['Salary']+5000
print(df)
print(df2)
Name Salary
0 Jai 25000
1 Jia 35000
2 Sapna 40000
3 Meeta 45000
4 Sarita 50000
Name Salary
0 Neha 45000
1 Priya 65000
2 Kush 75000
3 Diya 60000
4 Parul 50000
Ans 34. (a) import pandas as pd
import numpy as np
data=[[10,11,12,13,14],[23,34,45,32,65],[55,60,65,70,75]]
df=pd.DataFrame(data)
print(df)
0 1 2 3 4
0 10 11 12 13 14
1 23 34 45 32 65
2 55 60 65 70 75
(b) df.loc[3]=[1,2,3,4,5]
print(df)
0 1 2 3 4
0 10 11 12 13 14
1 23 34 45 32 65
2 55 60 65 70 75
3 1 2 3 4 5
(c) df.fillna({0:-1,1:-2,2:-3,3:-4})
print(df)
(d) df.fillna(method='ffill', inplace=True)
print(df)
0 1 2 3
0 23 25.0 NaN NaN
1 34 25.0 NaN NaN
2 43 44.0 45.0 46.0
Output:
A True
B False
C False
dtype:bool
print(df.any())
Output:
A True
B True
C False
dtype:bool
Ans 40. inplace=True statement allows you to modify the data in an already existing
object instead of creating a new object. When inplace=True is used, the function
modifies the original object and returns None. Without inplace=True, the function
returns a new DataFrame or Series with the modifications applied, leaving the
original object unchanged.
Ans 41. del statement will simply delete the entire column and its contents from the
dataframe (in-place).
We can delete an element from a series using drop() method by passing the index
of the element to be deleted as the argument to it.
In case of a dataframe, drop() method will delete the values of dataframe.
The values can be of either row or column.
The pop() function will delete the column from a dataframe by providing the
name of the column as an argument. It will return the deleted column along with
its values.
CHAPTER 2: Data Visualization
Unsolved Questions
Ans 1. import matplotlib.pyplot as plt
year=[2018,2019,2020,2021,2022]
population=[135.26, 136.64,138.0,139.34,139.89]
plt.plot(year,population)
plt.title("My Title")
plt.xlabel("Year")
plt.ylabel("Population")
plt.xticks(year)
plt.yticks()
plt.show()
Ans 2. Matplotlib is an open-source 2D plotting library that helps in visualizing figures.
Matplotlib is used in Python as it is a robust, free and easy library for data
visualization. It is easy to learn and understand. Matplotlib library is used for
creating static, animated and interactive 2D-plots or figures in Python.
Ans 3. Pyplot provides an interface to the plotting library in Matplotlib. It means that
figures and axes are implicitly and automatically created to achieve the desired
plot. For example, calling plot() function from pyplot module will automatically
create the necessary figure and axes to achieve the desired plot.
Ans 4. There are many types of visualizations (graphs) that can be plotted using pyplot.
Some of the most famous are: line plot, scatter plot, histogram, box plot, bar chart
and pie chart.
Ans 5. show() function is used to show the graph.
For example plt.show()
Ans 6. Figure: It represents the entire window or page where the plot appears.
A Figure can contain one or more Axes.
We can compare Figure as a canvas where we create and draw plots.
It can include multiple subplots or different types of plots.
12 Informatics Practices with Python—Teacher’s Manual
Axes: The Axes is the area where data is plotted or we can say that it is the
region of the Figure where data is visualized.
Each Axes has an x-axis and a y-axis, and may contain additional elements such
as labels, ticks, legends, etc.
A Figure can have multiple Axes, allowing for multiple plots (subplots) to be
displayed together.
We can interact with the Axes to set properties such as titles, labels, and limits,
and to add plot elements such as lines, points or histograms.
Ans 7. The subplot() function is used to create multiple plots within the same figure,
arranged in a grid-like layout. This function allows us to display different aspects
of the data or multiple datasets side by side for comparison. Each subplot can
have its own axes, allowing for independent customization.
The subplot() function takes three integer parameters:
subplot(nrows, ncols, index)
Ans 8. import matplotlib.pyplot as plt
subject=["English","Maths","Physics","Chemistry","IP"]
marks=[85,87,90,93,97]
plt.plot(subject,marks)
plt.title("Scores")
plt.xlabel("Subject")
plt.ylabel("Marks")
plt.show()
Ans 9. import matplotlib.pyplot as plt
Subject=["English","Hindi","Science","French","Maths"]
Mid_term_Exams= [90,87,84,93,95]
plt.plot(Subject,Mid_term_Exams, color='blue',linewidth=3,
label="Mid Term Exams")
Subject=["English","Hindi","Science","French","Maths"]
End_term_Exams= [95,89,87,96,99]
plt.plot(Subject,End_term_Exams,color='red',
linewidth=5,label="End Term Exams")
plt.title("Marks scored in term exams")
plt.xlabel("Subject")
plt.ylabel("Marks")
plt.legend()
plt.show()
Book-XII 13
Ans 10 import matplotlib.pyplot as plt
x1 = [1, 2, 3, 4, 5]
y1 = [2, 4, 6, 8, 10]
x2 = [1, 2, 3, 4, 5]
y2 = [1, 3, 5, 7, 9]
plt.plot(x1, y1, marker='o', label='Line 1')
plt.plot(x2, y2, marker='s', label='Line 2')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Line Plot with Markers')
plt.xticks(range(1, 6))
plt.legend()
plt.show()
Ans 11. import matplotlib.pyplot as plt
clas = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X']
strength = [40, 43, 45, 47, 49, 38, 50, 37, 43, 39]
col = ['blue', 'orange', 'green', 'red', 'purple',
'brown', 'pink', 'gray', 'olive', 'cyan']
plt.bar(clas, strength, align='center',color=col)
plt.xlabel('Classes')
plt.ylabel('Number of Students')
plt.title('Number of Students in Each Class')
plt.show()
14 Informatics Practices with Python—Teacher’s Manual
Ans 12. import matplotlib.pyplot as plt
clas = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X']
strength = [40, 43, 45, 47, 49, 38, 50, 37, 43, 39]
col = ['blue', 'orange', 'green', 'red', 'purple',
'brown', 'pink', 'gray', 'olive', 'cyan']
plt.barh(clas, strength, align='center',color=col)
plt.xlabel('Classes')
plt.ylabel('Number of Students')
plt.title('Number of Students in Each Class')
plt.show()
Ans 13. import matplotlib.pyplot as plt
X = range(-10, 11)
Y_squared = [4 * x for x in X]
plt.plot(X, Y_squared)
plt.xlabel('X')
plt.ylabel('Square of Y')
plt.title('Line Graph: Square of Y = 4*X')
plt.show()
Book-XII 15
Ans 14. import matplotlib.pyplot as plt
X = [i for i in range(-10, 11)]
Y = [x ** 2 for x in X]
plt.plot(X, Y)
plt.xlabel('X')
plt.ylabel('Y = X^2')
plt.title('Plot of y = X^2')
plt.show()
Ans 15. The various methods used with pyplot object are:
• plot(\*args[, scalex, scaley, data])- It creates a plot x versus y as lines and/or
markers.
• bar(x, height[, width, bottom, align, data]) – It creates a bar plot.
• barh(x, height[, width, bottom, align, data]) – It creates a horizontal bar plot.
• hist(x[, bins, range, density, weights, ...]) – It plots a histogram.
Ans 16. (i) show(): This function is used to display the plot.
(ii) legend(): Legends are used to explain different sets of data plotted in
different colors or symbols in the chart.
Ans 17. import numpy as np
import matplotlib.pyplot as plt
num_students = 40
max_marks = 100
marks = np.random.randint(0, max_marks + 1, num_students)
plt.hist(marks, bins=10, range=(0, max_marks), edgecolor='black')
plt.title('Histogram of Class Test Marks')
plt.xlabel('Marks')
plt.ylabel('Frequency')
plt.show()
16 Informatics Practices with Python—Teacher’s Manual
Ans 18. To display the changes in temperature in the last seven days, we should use a
line chart as it will display trends over time.
Ans 19. For this bar plot, first we need to store data—
import pandas as pd
data = {'University': ['Daulat Ram College', 'Mata Sundari Devi',
'Hansraj College'], 'Science Courses': [50, 40, 60], 'Commerce
Courses': [30, 35, 25], 'Humanities Courses': [20, 25, 30]}
df = pd.DataFrame(data)
df.to_csv('university_courses.csv', index=False)
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('university_courses.csv')
df.plot(kind='bar', x='University', stacked=True)
plt.title('Number of Courses by University')
plt.xlabel('University')
plt.ylabel('Number of Courses')
plt.legend(title='Course Type')
plt.show()
vi
e
ge
eg
e
le
iD
ll
ol
o
ar
jC
mC
nd
ra
Ra
Su
ns
at
ta
Ha
ul
Ma
Da
Book-XII 17
Ans 20. A histogram is a statistical tool used to summarize discrete or continuous data. It
provides a visual interpretation of numerical data by showing the number of data
points that fall within a specified range of values called ‘bins’.
To construct a histogram, first divide the range of values into intervals called bins,
and count how many values fall into each bin. The bins are typically consecutive,
non-overlapping intervals,which may or may not be of equal size. To construct
a histogram, you first divide the range of values into intervals, called bins, and
count how many values fall into each bin. The bins are typically consecutive, non-
overlapping intervals, which may or may not be of equal size.
For example,
df.plot(kind='hist',bins=[11,18,25,25,22])
OR
df.plot(kind='hist',bins=20)
OR
df.plot(kind='hist',bins=range(10,35))
OR
plt.hist(x, bins=15)
Ans 21. The different types of plots that can be created using hist() function are: ‘bar’,
‘barstacked’, ‘step’, ‘stepfilled’.
Ans 22. Histograms and bar charts are both used to visualize data distributions, but they
serve different purposes and are suitable for different types of data. Histograms
are typically used when we have continuous data and we want to visualize the
distribution or frequency of values within a range. Bar charts, on the other hand,
are used when we have categorical or discrete data. They are ideal for comparing
the values of different categories or groups.
Ans 23. (i) import matplotlib.pyplot as plt
weights = [78, 72, 69, 81, 63, 67, 65, 79, 74, 71, 83, 71, 79, 80]
plt.hist(weights, bins=5, color='skyblue', edgecolor='black')
plt.xlabel('Weight (grams)')
plt.ylabel('Frequency')
plt.title('Simple Histogram of Muffin Weights')
plt.show()
(ii) import matplotlib.pyplot as plt
weights=[78,72,69,81,63,67,65,79,74,71,83,71,79,80]
plt.hist(weights,orientation='horizontal',color='skyblue',
edgecolor='black')
plt.xlabel('Frequency')
plt.ylabel('Weight(grams)')
plt.title("Histogram Horizontal of Muffin Weights")
plt.show()
18 Informatics Practices with Python—Teacher’s Manual
(iii) import matplotlib.pyplot as plt
weights=[78,72,69,81,63,67,65,79,74,71,83,71,79,80]
plt.hist(weights,histtype='step', edgecolor='black')
plt.xlabel('Weight(grams)')
plt.ylabel('Frequency')
plt.title("Step-Type Histogram of Muffin")
plt.show()
(iv) import matplotlib.pyplot as plt
weights=[78,72,69,81,63,67,65,79,74,71,83,71,79,80]
plt.hist(weights,cumulative=True color='skyblue')
plt.xlabel('Weight (grams)')
plt.ylabel('Cumulative Frequency')
plt.title('Cumulative Histogram of Muffin Weights')
plt.show()
Book-XII 19
Ans 24. The three Python libraries used for data analysis are:
(i) Pandas – Series(), DataFrame(), read_csv(),etc.
(ii) NumPy – arrays(), mean(), median(),etc.
(iii) Matplotlib- pyplot.plot(), xlabel(), ylabel(),etc.
Ans 25. import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
data = pd.read_csv('filepath')
for region in data['Region'].unique():
region_data = data[data['Region'] == region]
plt.scatter(region_data['Population'], region_data['Literacy Rate'],
s=np.sqrt(region_data['Literacy Rate'])*10, marker='d',label=region)
plt.xlabel('Population')
plt.ylabel('Literacy Rate')
plt.title('Population vs. Literacy Rate by Region')
plt.legend()
plt.show()
avg_literacy_by_region = data.groupby('Region')['Literacy Rate'].mean()
avg_literacy_by_region.plot(kind='bar')
plt.ylabel('Average Literacy Rate')
plt.title('Average Literacy Rate by Region')
plt.show()
CHAPTER 3: Review Of Database Concepts & SQL
Unsolved Questions
Ans 1. Data is termed as the raw facts and figures about something which is not organized.
For example, Namrata, 12.
Ans 2. The processed data is known as information or we can say that information is a
meaningful piece of data.
For example, StuName Class
Namrata 12
Now, it conveys the information that Namrata is a student who reads in class 12.
Ans 3.
DATA INFORMATION
1. It is a collection of raw facts and figures. 1. It is the processed or meaningful piece of data.
2. It is not arranged. 2. It is arranged.
3. It is unorganized. 3. It is organized.
4. It does not depend on information. 4. It depends on data.
5. For example, "123456789", "12/31/2023". 5. For example, Name = Shreya, Rollno =16.
(d) It reduces the programming efforts.
(e) It provides data security and privacy.
(f) It provides data backup and recovery mechanisms.
(g) It provides data integrity.
(h) It supports scalability.
Ans 7. (i)
Database File
It is an organized collection of related It is unstructured or semi-structured
data, managed by a DBMS. data stored as a single unit.
It supports complex data relationships It does not support relationships,
and integrity constraints. treated as a single entity.
It provides security, concurrency control, It provides limited security,
scalability, and backup features. scalability, and backup options.
It is efficient for data retrieval, It is efficient for performing basic
manipulation, and analysis. read or write operations.
(ii)
Data File
It is defined as raw facts, figures, or It is a collection of related
observations. information stored together.
It can be text, numbers, dates, etc. It can be text, binary or both.
It can be manipulated, analyzed or It can be read, written, edited and
processed. deleted.
It is often managed within a database or It is managed by file systems or
other data storage systems. database systems.
Ans 8. (i) The most likely key for the primary key is CUST-ID.
(ii) The candidate keys are CUST-ID, CITY, PHONE and the alternate keys
are CITY, PHONE.
Ans 9. (i) Relation: It is a collection of logically related records. It is a combination of
tuples and attributes. We can also say that it is a named collection of data
items which represents a complete unit of information.
(ii) Domain: It defines the kind of data represented by the attribute. It is the
set of all possible values or pool of values that an attribute may contain. For
example, Gender column can have two possible values either ‘M’ or ‘F’.
(iii) Tuple: Each row in a relation is known as a tuple. It can be called as a row
or record. It is also defined as the horizontal subset of a relation.
(iv) Attribute: It is a set of values of a particular type. It is also defined as the
vertical subset of a relation. It is also used to represent a column of a relation.
For example, Student relation has attributes- Rollno, Name, Course, Fees, etc.
(v) Degree: It is defined as the total number of columns or attributes in a
relation. For example, Student relation has 4 columns, so its degree is 4.
(vi) Cardinality: It is defined as the total number of records or tuples in a relation.
For example, Student relation contains 5 records, so its cardinality is 5.
22 Informatics Practices with Python—Teacher’s Manual
Ans 10. The major differences between a relation and a traditional file follows—
Relation (Relational Database) Traditional File
It is organized into relations (tables). It is stored as flat or hierarchical files.
Relations consist of rows and columns. It contains records or data entries.
It supports relationships between It has no inherent relationships between
relations(tables) using keys (primary, files.
foreign).
It enforces data integrity constraints It has limited or no data integrity
(e.g., primary keys, foreign keys). enforcement.
It has querying capabilities using SQL It has limited querying capabilities, often
(Structured Query Language). require custom scripting.
It provides scalability, security, backup It has limited scalability, security, and
or recovery features. backup or recovery options.
Ans 22.
DDL Commands DML Commands
DDL stands for Data Definition DML stands for Data Manipulation
Language. Language.
These commands allow us to perform These commands are used to manipulate
tasks related to data definition, i.e., related data, i.e., records or rows in a table or
to the structure of the database objects. relation.
DDL is not further classified. DML is further classified into two types
such as – Procedural DMLs and Non-
Procedural DMLs.
For example – Create, Alter, Drop, etc. For example, Insert into, Update, Delete,
etc.
Ans 23. (a) Select * from SchoolBus where capacity >70;
(b) Select area_covered from SchoolBus where distance>20 and
charges<4000;
(c) Select * from SchoolBus where Noofstudents <50;
(d) Select rtno, area_covered, charges/Noofstudents as "Average_
Cost" from SchoolBus;
(e) Insert into SchoolBus values(11,"Motibagh",35,32,10,"Kisan
Tours",3500);
Ans 24. (a) Select * from furniture where price >10000;
(b) Select item, price from furniture where discount between 10
and 20;
(c) Delete from furniture where discount = 30;
(d) Select price from furniture where type="Babycot";
(e)
Distinct Type
DoubleBed
BabyCot
OfficeTable
Ans 25. (a) Select name from graduate where rank = 1;
(b) Select name from graduate where average > 65;
(c) Select name from graduate where subject="Computer" and average>60;
(d) Select name from graduate where name like "%a";
(e)
SNO NAME STIPEND SUBJECT AVERAGE RANK
1 KARAN 400 PHYSICS 68 1
2 GAURAV 500 PHYSICS 70 1
3 PUJA 500 PHYSICS 62 1
(f)
DISTINCT RANK
1
2
Book-XII 25
Ans 26. (a) An attribute or a set of attributes of a table which possesses the capabilities of
becoming a primary key is called as candidate key whereas the candidate key
which is not selected as a primary key of the table is known as an alternate
key.
(b) A table having 10 rows and 5 columns, its degree is 5 and cardinality is 10.
(c) (i) Create table STUDENT
(ROLLNO integer(4) Primary Key,
SNAME Varchar(25) Not Null,
GENDER Char(1) Not Null,
DOB Date Not Null,
FEES Integer(4) Not Null,
HOBBY Varchar(15) Null);
(ii) Alter table Student modify sname varchar(30);
(iii) Alter table Student Drop Hobby;
(iv) Insert into Student values (1,"Sahib","M","2014-12-13",
5500,"Drawing");
Ans 27. (i) Select ProductName, Price from Product where Price between 50
and 150;
(ii) Select * from Product where Manufacturer = 'XYZ' or Manufacturer
= 'ABC';
OR
Select * from Product where Manufacturer IN('XYZ', 'ABC');
(iii) Select ProductName, Manufacturer, Price from Product where
Discount IS NULL;
(iv) Select ProductName, Price from Products;
(v) P_ID Column is used as foreign key and CLIENT is the table where it has
been used as foreign key.
Ans 28. (i) Select name from hospital where Dateofadm>"1998-01-15";
(ii) Select name from hospital where Sex='F' and Dapartment='ENT';
(iii) Select name ,Dateofadm from hospital;
(iv) Select name,charges,age from hospital where Sex='F';
CHAPTER 4: Database Query Using SQL
Unsolved Questions
Ans 1. Single Row Functions: Single row functions operate on a single row to return
a single value per row as the output. They can accept one or more arguments but
return only one result per row. These are also known as Scalar functions. When
applied to a table, they return a single result for every row of the queried table.
Multiple Row Functions: These functions are termed as Aggregate Functions
because they summarize the results of a query and return a single value calculated
from all the values present in a column instead of providing the listing of all the
rows. Aggregate functions are also termed as Group Functions and are so called
because they operate on a group or aggregate of tuples (records).
Ans 2. The GROUP BY clause can be used in a SELECT statement to collect data across
multiple records and group the results by one or more columns. It groups the rows
on the basis of the values present in one of the columns and then the aggregate
functions are applied on any column of these groups to obtain the result of the query.
Ans 3. WHERE clause works with respect to the whole table but HAVING clause works
on Group only. If WHERE and HAVING both are used, then WHERE will be
executed first. WHERE is used to put a condition on an individual row of a table
whereas HAVING is used to put a condition on an individual group formed by
GROUP BY clause in a SELECT statement.
Ans 4. SELECT SUM(Marks), AVG(Marks), MIN(Marks), MAX(Marks) From
Student;
Ans 5. SELECT STREAM, SUM(Marks), AVG(Marks), MIN(Marks), MAX(Marks)
From Student Group By Stream;
Ans 6. (a)
SUM(Price)
370
(b)
AVG(Price)
74
(c)
MIN(Price)
150
(d)
MAX(Price)
150
(e)
COUNT(Price)
5
(f)
DISTINCT PRICE
50
100
150
20
Book-XII 27
(g)
COUNT (DISTINCT Price)
4
(h)
Iname Price*Quantity
Soap 5000
Powder 5000
Facecream 3750
Pen 10000
Soapbox 2000
Ans 7. A Function can be defined as a predefined set of commands that helps in performing
certain operations to obtain either a single value or a result set.
SQL provides a large collection of in-built functions, also called library functions,
that can be used directly with SQL statements for performing calculations on data.
Ans 8. SELECT SYSDATE();
Ans 9. SELECT MONTHNAME(CURDATE());
Ans 10. SELECT DAYOFWEEK('1999-07-22');
Ans 11. SYSDATE() returns the time at which the function executes whereas NOW() returns
a constant time that indicates the time at which the statement began to execute.
Ans 12. Select YEAR(J_Date()) – YEAR(B_Date()) As 'Age' From Employee;
Ans 13. Select Stream, Count(*) From Student Group By Stream;
Ans 14. (a) Select * from Faculty where Salary > 12000;
(b) Select * from Faculty where Salary between 8000 and 12000;
(c) Select count(distinct F_ID) from Faculty;
(d) Select count(*) from Faculty where Salary = 10000;
(e) Select * from Faculty where F_Name like "S%";
(f) Select * from Faculty order by Hire_date DESC;
(g) Select MAX(Salary), Min (Salary) from Faculty;
(h)
CONCAT(F_Name, L_Name)
AmitMishra
NitinVyas
RakshitSoni
RashmiMalhotra
SulekhaSrivastava
(i)
Month(Hire_date)
10
12
5
9
6
28 Informatics Practices with Python—Teacher’s Manual
Ans 15. (a) Select Min(Sal), Max(Sal), Avg (Sal) from EMP where Designation =
"MANAGER";
(b) Select Count ( * ) from EMP where Designation = "CLERK”";
(c) Select Designation, EmpName, Sal, DOJ, from EMP Group by
Designation ;
(d) Select Count( * ) from EMP Where Comm IS Null ;
(e) Select DeptID, Avg( Sal ) from EMP Group by DeptID having Count(*)
>5;
(f) Select DeptID, Count(*) from EMP Group by DeptID ;
(g) Select DeptID,Max( Sal ) from EMP Group by DeptID ;
(h) Select EmpName , Designation , DeptName from EMP e, DEPT d where
e.DeptID = d.DeptID;
(i) Select Count(*) from DEPT Where DeptName='Accounts' ;
Ans 16. Create table PAYMENT
(
Loan_number integer(4) Primary Key,
Payment_number Varchar(3),
Payment_date Date,
Payment_amount integer(8) Not Null);
)
Ans 17. (a) Select * from PRODUCT where Price Between 40 and 120;
(b) Update PRODUCT set Price = Price+20;
Ans 18. (a) Select Name from RESULT where Division = "FIRST" Order by Name;
(b) Select Name, Subject , Stipend * 12 as "Annual_Stipend" from
RESULT;
(c) Select Count(*) from Result where Subject = "Accounts" or Subject
= "Informatics";
OR
Select Count(*) from Result where Subject IN ("Accounts",
"Informatics");
(d) Insert into Result Values (7, "Mohan", 500, "English", 73,
"Second");
(e)
AVG(STIPEND)
47.5
(f)
COUNT(DISTINCT Subject)
6
(g)
MIN(AVERAGE)
38
Ans 19. (a) Select * from SchoolBus where Capacity > Noofstudents Order
by Rtno;
Book-XII 29
(e) (i)
COUNT (PLEVEL) (PLEVEL)
P1 P001
P2 P002
P2 P003
(ii)
MAX (DOB) MIN (DOJ)
1987-07-12 1983-06-09
Ans 22. (a) Primary Key in Event table—EventId
Primary Key in Celebrity table—CelebrityID
Foreign key in Event Table—CelebrityID
The column NumPerformers contains number of performers in each event and
it cannot be set as a primary key because it can have duplicate values and a
primary key always accepts a unique value.
(b) The number of rows will be 4 * 4 = 16 after the Cartesian product.
(c) (i) Select Eventld, Event, CelebritylD from Event where
NumPerformers > 10 ;
(ii) Select CelebrityID, CelebrityName from Celebrity where
CelebrityName like "%khan%" ;
(iii) Select CelebrityName , FeeCharged from Celebrity where
FeeCharged > 200000 ;
Ans 23. (a) Select Name from Student where Stream = "Science" ;
(b) Select Count(*) from Student where Stream = "Commerce " ;
(c) Select Designation, Count(*)from Teacher group by Designation;
(d) Select Max(Pay) from Teacher Where Subject = "English" ;
(e) Select s.Name from Student s ,Teacher t where s.TeacherID =
t.TeacherID and t.Tname = "Anand Mathur" ;
(f) Select t.Tname , t.Designation from Teacher t, Student s where
t.TeacherID = s.TeacherID and s.Name = "Amit";
(g) Select Tname from Teacher where Pay=(Select Max(Pay) from Teacher);
(h) Select City from Teacher where Subject = "Math" ;
(i) Select Tname from Teacher Where Pay= (Select Min(Pay) from
Teacher) And Designation= "PGT" ;
(j) Select s.Name from Student s , Teacher t Where s.TeacherID=
t.TeacherID and t.Designation= "PGT" ;
Ans 24. (a) Select * From Teacher where category= "PGT" ;
(b) Select Name from Teacher where Gender = "F" and Department =
"Hindi";
(c) Select Name, Department, Hiredate from Teacher Order by Hiredate ;
(d) Select Count(*) from Teacher where Department = "English";
(e) Select Department , Hiredate from Teacher where Gender = "F" and
Salary > 25000 ;
(f) Select * from Teacher Where Name Like "J%" ;
(g)
count(*)
1
Book-XII 31
(h)
AVG(Salary)
24500
22500
Ans 25. (a) Select Name from Sports Where Grade1 = 'A' Or Grade2='A';
(b) Select Count(*) from Student Where Game1 = 'Cricket' or Game2 =
'Cricket';
(c) Select Name from Sports Where Game1 = Game2;
(d) Select Game1 , Game2 from Sports Where Name like "A%";
(e) (i)
COUNT(*)
6
(ii)
DISTINCT CLASS
7
8
9
10
(iii)
MAX(Class)
10
(iv)
Game 1 COUNT(*)
Cricket 2
Tennis 2
Swimming 1
Basketball 1
Ans 26. (a) Select * from Item;
(b) Select Iname, Price from Item;
(c) Select * from Item Where Iname='Soap';
(d) Select * from Item Where Iname Like 's%';
(e) Select Itemno, Iname, Price * Quantity as "TotalPrice" From Item;
(f)
DISTINCT PRICE
50
100
150
20
(g)
COUNT(DISTINCT Price)
4
Ans 27. (a)
POW(2,3)
8
32 Informatics Practices with Python—Teacher’s Manual
(b)
ROUND(123.2345,2) ROUND(342.9234,-1)
123.23 340
(c)
LENGTH("Informatics Practices")
21
(d)
YEAR("1979/11/26") MONTH("1979/11/26") MONTHNAME("1979/11/26" DAY("1979/11/26")
1979 11 November 26
(e)
LEFT("INDIA",3) RIGHT("Computer Science",4)
IND ence
(f)
MID("Informatics",3,4) SUBSTR("Practices",3)
form actices
(g)
CONCAT("You Scored",LENGTH("123"),"rank")
You Scored3rank
(h)
ABS(-67.89)
67.89
(i)
SQRT(625) + ROUND(1234.89,-3)
1025
(j)
mod (56,8)
0
CHAPTER 5: Computer Networks
Unsolved Questions
Ans 1. The Internet is a global network of interconnected computer networks, allowing
computers and other devices to communicate and share resources. It is often
referred to as the 'network of networks.' The Internet facilitates the exchange of
information, data, and services across different types of devices and platforms,
connecting people and organizations worldwide. It is also termed as ‘net’.
Ans 2. A network is defined as a collection of interconnected devices, such as computers,
printers, servers, and other peripherals, that are capable of sharing resources and
information. These devices are linked together through wired or wireless connections,
allowing them to communicate with each other and exchange data.
Ans 3. The various types of topologies are:
• Mesh topology
• Bus topology
• Star topology
• Ring topology
• Tree topology
Ans 4. Bus topology: In this topology, a long cable known as backbone is used to connect
all computers with each other. The data is transmitted through a long cable from
the sender to the receiver. Collision can take place when the data is transmitted
from two or more devices at the same time. If there is a break in a cable, no
transmission takes place.
Star topology: In this topology, a central network device such as hub or switch
is required to connect all devices in a network. The data is transmitted from the
sender to the receiver by passing through the hub or switch. No collision takes
place through transmission of data because each device has its own dedicated
connection to the central hub/switch. If the central hub fails, the entire network
shuts down.
Ans 5. (a) Baud: The number of changes in a signal per second is known as baud. It is
the measuring unit of the data transfer rate.
(b) Communication channel: A channel is a communication path through
which the data is transmitted from the sender device to the receiver device. A
communication channel is also known as communication media or transmission
media. Communication media can be wireless(unguided) or wired(guided).
(c) Hubs: It is a multi-port and unintelligent network device that simply transfers
data from one port of the network to another. A hub is a hardware device used
to connect several computers together with different ports. When the packet
reaches one port or one node, it is copied to all the ports connected to hub.
Hub can be either active or passive.
(d) Repeaters: A repeater is an electronic/network device that receives a signal
before it becomes too weak and regenerates the original signal . It is used
to amplify and restore signals for long-distance transmission. Repeaters are
required for cables running longer than 70 metres. It does not change the
functionality of the network.
Ans 6. Modem: A MODEM (Modulator DEModulator) is an electronic device that enables a
computer to transmit data over telephone lines. It is a device used to convert digital
signals into analog signals and vice versa. There are two types of modems, namely
internal modem and external modem.
34 Informatics Practices with Python—Teacher’s Manual
1. Internal Modem: An internal modem is placed inside a computer. It usually
comes pre-installed in the computer. The best thing about internal modem is that
it operates with the computer’s power supply and does not need an additional
supply to work.
2. External Modem: An external modem is quite similar to an internal modem
where it also allows access to the internet. The external modem is an external
part of the computer. It can be used when a computer is unable to fit an internal
modem inside it. The modem typically connects to the computer via a serial or
USB cable, and it also needs an external power supply to operate.
Ans 7. (a) PPP: Point-to-Point Protocol is used to establish a direct connection between
two nodes.It is used to connect telephone dial-up lines to the internet. It can
provide connection authentication, transmission, encryption and compression
and error detection as well.
(b) POP3: Post Office Protocol is a simple and standard method to access the
mailbox and download messages to the local computers. This protocol manages
authentication of mails and also blocks inboxes during its access which means
that simultaneous access to the same inbox by two users is impossible.
(c) VoIP: Voice Over Internet Protocol is used for transferring voice over internet.
It uses packet switching technology where each packet follows the best route
to reach its destination. It allows both voice and data communications to be
run over a single network due to which infrastructure costs get reduced.
(d) IRC: Internet Relay Chat allows users to chat by sending and receiving text
messages. It uses client server model. The sender sends request to IRC server,
which then forwards this request to another client to communicate with each other
Ans 8. (a) Hubs: It is a multi-port and unintelligent network device that simply transfers
data from one port of the network to another. A hub is a hardware device used
to connect several computers together with different ports. When the packet
reaches one port or one node, it is copied to all the nodes connected to hub.
Hub can be either active or passive.
(b) Repeaters: A repeater is an electronic/network device that receives a signal before
it becomes too weak and regenerates the original signal. It is used to amplify and
restore signals for long-distance transmission. Repeaters are required for cables
running longer than 70 metres. It does not change the functionality of the network.
(c) Routers: A router is a networking device that forwards data packets from the
source machine to the destination machine over a network by using the shortest
path. A router uses IP address to connect a local area network to the internet.
Routers are network devices that can handle different protocols within a network.
A bridge is a device that links two segments of the original network together.
Bridges connect two separate network segments that use the same protocol.
(d) Bridges: A bridge is a device that links two segments of the original network
together. Bridges connect two separate network segments that use the same
protocols.
Book-XII 35
The bridge not only regenerates the signal but also checks the physical address
of the destination and forwards the new copy only to that port. An important
advantage of using a bridge is that it is a smarter hub as it can filter network
traffic on the basis of the MAC addresses.
(e) Gateways: A gateway is a device that connects dissimilar networks. Gateway
provides the necessary translation of data received from the network into a
format or protocol recognized by devices within the internal network. A gateway
is a device that establishes an intelligent connection between a local area
network and external networks with completely different structures.
Ans 9. (a) MODEM (b) Repeaters
Ans 10. (a)
MAN WAN
Covers a larger geographic area, Spans over a vast geographic area,
usually spanning a city or a town. potentially covering multiple cities,
countries, or continents.
Typically owned and operated by a Often consists of multiple
single entity such as a corporation, interconnected networks owned and
university, or government organization. operated by different organizations or
service providers.
Provides high-speed connectivity Offers connectivity over long
within a specific metropolitan area. distances, often utilizing various
telecommunication technologies.
It links resources and users within a It enables communication and data
confined geographic region, like a city transfer over vast distances, linking
or town. resources and users across various
geographical locations.
Examples include Local Area Networks Examples include the internet,
(LANs) within a city, connecting connecting users and resources globally,
different offices of a corporation. regardless of geographical location.
(b)
Website Web Page
It is a collection of related web pages. It is a single document within a website.
It contains multiple webpages, It represents a single HTML document
each offering different content or that displays content on a browser.
functionality.
It has its own domain name and is It is accessed through the website’s
accessible through a specific URL. URL or through hyperlinks on other
webpages.
It consists of various types of content It contains specific information or
such as text, images, videos, and content on a particular topic or purpose.
interactive elements.
It can be dynamic, with content It is static, with content remaining
changing based on user interactions or unchanged unless manually edited or
updates. updated.
Examples include www.example.com, Examples include www.example.com/
www.wikipedia.org, www.amazon.com about-us, www.wikipedia.org/wiki/
History_of_the_Internet, www.amazon.
com/product-page
It is hosted on web servers and It is accessed through web browsers on
accessible globally through the internet. devices connected to the internet.
36 Informatics Practices with Python—Teacher’s Manual
(c)
Router Gateway
A networking device that forwards A device that acts as an entry and exit
data packets between computer point for a network, connecting two
networks. different networks.
Its primary function is to determine Its primary function is to translate
the best path for data packets to reach between different network protocols
their destination. and manage communication between
networks.
It directs traffic based on IP addresses It performs protocol conversion
and routes data to its destination between different network
network. architectures or transmission formats.
It manages multiple network It translates between different
interfaces and makes decisions about communication protocols, allowing
where to send data packets. different types of networks to
communicate.
It can be used within a single network It is typically used to connect a local
or between multiple networks. network to the internet or another
external network.
Examples include home routers, Examples include routers with
enterprise routers, and internet integrated firewall functionality, VPN
backbone routers. gateways, and proxy servers.
(d)
Bus topology Star topology
A long cable known as backbone is A central network device such as hub
used to connect all computers with or switch is required to connect all
each other in a network. devices in a network.
The data is transmitted through a long
The data is transmitted from the
cable from the sender to the receiver.
sender to the receiver by passing
through the hub or switch.
Collision can take place when the No collision takes place through
data is transmitted from two or more transmission of data because
devices at the same time. each device has its own dedicated
connection to the central hub/switch.
If there is a break in a cable, no If the central hub fails, the entire
transmission takes place. network shuts down.
(e)
Static Web Page Dynamic Web Page
It contains fixed content that remains Its content is generated dynamically,
unchanged until manually updated. often in response to user input or
database queries.
It displays the same information to all It can personalize content based on
users regardless of their interactions. user preferences, session data, or
previous interactions.
It is faster to load as the content is pre- It may load slower due to content being
generated and cached. generated on-demand.
It is suitable for websites with It is ideal for websites requiring frequent
relatively static content that rarely updates or user interaction, such as
changes. social media platforms or online stores.
Examples include simple informational Examples include social media feeds,
websites, online brochures, or personal e-commerce websites with product
blogs listings, and web applications with
interactive features.
Book-XII 37
Ans 20. Firewall is responsible for filtering the data and Router can handle different protocols.
Ans 21. When two or more than two devices connected to each other forms a network.
A collection of interconnected computers is called a computer network. Two
computers or devices are said to be interconnected if they are capable of sharing
and exchanging information by following a protocol.
Goals of network are—
(i) Resource Sharing (ii) Improved Communication
(iii) Reduced Communication Cost (iv) Reliability of Data
(v) Central Storage of Data
Applications of network are—
(i) Communication (ii) E-commerce and Online Transactions
(iii) Entertainment and Media (iv) Resources sharing and Collaboration
(v) Distributed computing
Ans 22. A switch (switching hub) is a network device which is used to interconnect computers
or devices on a network. It filters and forwards data packets only to one or more
devices for which the packet is intended across a network. It is also a multi-port
device but with some intelligence and so the data packets received from one port
of the network are refreshed and delivered to the other port of the network.
Ans 23. (a) Repeater: A repeater is an electronic/network device that receives a signal
before it becomes too weak and regenerates the original signal . It is used to
amplify and restore signals for long-distance transmission.Repeaters are required
for cables running longer than 70 metres. It does not change the functionality
of the network.
(b) Router: A router is a networking device that forwards data packets from
the source machine to the destination machine over a network by using the
shortest path. A router uses IP address to connect a local area network to
the internet. Routers are network devices that can handle different protocols
within a network.
(c) Bridge: A bridge is a device that links two segments of the original network
together. Bridges connect two separate network segments that use the same
protocols.
The bridge not only regenerates the signal but also checks the physical address
of the destination and forwards the new copy only to that port. An important
advantage of using a bridge is that it is a smarter hub as it can filter network
traffic on the basis of the MAC addresses.
(d) Gateway: A gateway is a device that connects dissimilar networks. Gateway
provides the necessary translation of data received from the network into a
format or protocol recognized by devices within the internal network. A gateway
is a device that establishes an intelligent connection between a local area
network and external networks with completely different structures.
Ans 24. Error 404 indicates that the specified URL was not found and server was unable
to get the requested webpage. It is usually caused when website content has been
removed or migrated to a different URL without the internal links being adjusted
or restore the deleted webpage.
She can use the following methods to fix this problem:
(i) Retry the web page by pressing F5, clicking/tapping the refresh/reload button,
or trying the URL from the address bar again.
(ii) Check for errors in the URL.
(iii) Move up one directory level at a time in the URL until you find something.
(iv) Search for the page from a popular search engine.
Book-XII 39
Ans 8. A major amendment was made in the IT Act in 2008 which came into force in October
2009. It introduced Section 66A which penalized sending of ‘offensive messages’.
It also introduced Section 69, which gave authorities the power of ‘interception
or monitoring or decryption of any information through any computer resource’.
The Amendments also contained penalties for child pornography, cyberterrorism
and voyeurism.
Ans 9. People unknowingly commit cybercrime in different ways:
(i) By illegal downloading :- Illegal downloads from the internet involve violation
of copyright laws where users download material, such as music, movies, and
other forms of media, without properly purchasing the product or doing so
without proper permission of copyright holders.
(ii) By copying others’ content like photos, videos, blogs etc.
Ans 10. Phishing is an unlawful activity where fake websites or emails that look original
or authentic are presented to the user to fraudulently collect sensitive and personal
details, particularly usernames, passwords, banking and credit card details.
The most common phishing method is through email spoofing where a fake or
forged email address is used that the user presumes to be from an authentic source.
So, you might get an email from an address that looks similar to your bank or
educational institution. It often directs the users to enter personal information at
a fake website, the look and feel of which is identical to the legitimate one, the
only difference being the URL of the website in question.
Ans 11. (a) Some online activities which may help to detect that my friend is being cyber
bullied are:
(i) Checking his Social Media accounts like Facebook, Twitter, WhatsApp, etc.,
for any embarrassing photos or videos.
(ii) Checking his mental and emotional behaviour such as he might be feeling
upset, embarrassed, losing interest, physically tired, etc.
(b) The provisions in the IT Act 2000 to tackle such a situation are as follows:
(i) Section 66(D): This section states that, if a person cheats someone by
portraying their image as someone else on the internet or social media,
he/she shall be punished. The imprisonment may be up to 3 years and/or
a fine of Rs. 1 Lakh.
(ii) Section 66(E): Under this Section one can be punished for capturing
someone’s private pictures intentionally and putting it on the internet or
social media without their consent. The imprisonment may last up to 3
years and/or with a fine of Rs. 3 lakhs.
(iii) Section 67: Under this Section one can be punished if they transfer,
circulate, or upload vulgar or improper material on the internet or social
media. The imprisonment may last up to 5 years and/or with a fine of Rs.
10 Lakhs.
Ans 12. (a) Copyrights: They include literary works such as novels, poems, plays, films,
musical works and artistic works such as drawings, paintings, photographs,
sculptures and architectural designs. Copyright is a legal concept, enacted by
most governments, giving the creator of original work exclusive rights to it,
usually for a limited period.
Patents: They are an exclusive right granted for an invention. In other words,
a patent is an exclusive right to a product or a process that generally provides
a new way of doing something, or offers a new technical solution to a problem.
42 Informatics Practices with Python—Teacher’s Manual
(b) Plagiarism: It refers to copying someone else’s work and then passing it off as
one’s own. It is morally wrong because it is an act of stealing. In other words,
it is copying information and not giving the author credit for it. Plagiarism
includes copying someone else’s work, cutting and pasting blocks of text or
any kind of media (audio, video files or movie clips) from electronic sources
without documenting and at the same time publishing it on the web without
the permission of developers/creators.
Copyright infringement: It means pertains to the violation of someone's
intellectual property (IP). It is another term for piracy or the theft of someone’s
original creation, especially if the one who stole recoups the benefits and not
the creator of the material.
(c) Ethical Hacking: It is also known as penetration testing or white hat hacking,
involves the same tools, tricks and techniques that hackers use, but with one
major difference—they do it for general welfare. Ethical hacking is legal.
Non-ethical Hacking: It refers to the use of advanced technology for exploiting
weaknesses and breaching defences in a computer system. In non-ethical
hacking, the hackers use their skills to make profit, gather information, protest,
or challenge authority. Attacks by such hackers can cause massive loss to the
organizations in terms of finances as well as other resources.
(d) Active Footprints: An active digital footprint is created when a user
intentionally shares personal information either through social media platforms
or websites and apps. Examples of active digital footprints are:
(i) Sharing of personal information on Facebook, Instagram, Twitter and other
social media platforms.
(ii) Working online, such as signing up while logging on to mail accounts to
send or receive emails or text messages.
Passive Footprints: A passive digital footprint is created when information
is collected from a user without their knowledge. Examples of passive digital
footprints are:
(i) Websites that install cookies in a user’s device without their permission.
(ii) Apps and websites that use geo-location to detect a user’s location.
(e) Free Software: Free software means that the users have the freedom to run,
copy, distribute, study, change and improve the software. Thus, ‘free software’
is a matter of liberty, not price. The users may have paid money to get copies
of a free program or obtain copies at no charge.
Free and Open Source Software: Free and open-source software (FOSS)
allows users and programmers to edit, modify or reuse the software's source
code. This gives developers the opportunity to improve program functionality
by modifying it.
Ans 13. The pictures with Creative Commons licenses can be used to create a project
without violating copyrights.
Ans 14. Securing the wireless router is important because anybody within the area of
Wi-Fi signal can connect to it and use it or can also attack your devices and data.
A reasonably strong password consists of at least a lower-case letter, an upper-case
letter, a number and some special characters and must be of atleast 8 characters
in length. We can share our passwords with anyone whom we can trust such as
parents, close friends but we can’t share with our neighbours and home tutors
because they can pose security risks and potentially violate our internet service
provider's terms of service.
Book-XII 43
Ans 15. The precautions that should be taken by people to avoid phishing are:
(i) Always click on trusted website links.
(ii) Install an anti-phishing toolbar that will alert you about a malicious site.
(iii) Never download files from suspicious emails or websites.
(iv) Enable firewalls that will keep track of the activities of your computer and
outside intruders.
(v) Never share your personal or financial details over the internet.
Ans 16. The procedure followed by the police to track cyber crime cases are:
(i) Investigation: For conducting any cybercrime investigation, a certain skill
and scientific tool is required without which the investigation is not possible.
(ii) Process of Search and Arrest: After a complaint is filed, the investigation
cells start with the search and seizure of digital evidences, which is the
intangible data of the virtual world. The main objective of the investigating
officer is to look for a place where the computer or network of computers is
to be found. Advice from technical experts should be referred to whenever
necessary. The investigating officer has to survey the equipment and take
precautionary steps before dismantling the network so that the important
data is not lost.
(iii) The power of the police officer and other officers to enter and search the
investigation is mentioned in the Section 80(1) of the IT Act, which states
that any police officer not below the rank of an Inspector or any other officer
of the Central and State Government authorized by the Central Government
can enter, search and arrest without a warrant, any person who is suspected
to have committed or about to commit the offence under the Act.
Ans 17. The following precautions should be taken so that students do not indulge in
cybercrime unknowingly :
(i) Aware students about the consequences of cyber crime
(ii) Check students’ activities on a daily basis
(iii) Use antivirus and scan computer daily
(iv) Keep computer/system up to date
(v) Do not share sensitive information
(vi) Disconnect from the internet when away
(vii) Be careful with email
(viii) Disable cookies, if possible
Ans 18. Electronic waste, e-Waste or e-Scrap describes the discarded electrical or electronic
devices. ‘Electronic waste’ may also be defined as discarded computers, office
electronic equipment, entertainment device electronics, mobile phones, television
sets and refrigerators. This includes used electronics which are destined for reuse,
resale, salvage, recycling, or disposal. The various methods for effective e-waste
management are as follows:-
(i) Give your Electronic Waste to a Certified E-Waste Recycler.
(ii) Sell off or donate your outdated technology electronic products.
(iii) Give back to your electronic companies or leave at drop-off points.
44 Informatics Practices with Python—Teacher’s Manual
Ans 19.
Proprietary License Open Source License
Owned and controlled by a single entity. Developed collaboratively by a community.
Source code is not freely available. Source code is freely available to view,
modify, and distribute.
Restrictions on usage, modification, and No restrictions on usage, modification,
distribution. and distribution, often governed by
licenses like GPL, MIT, Apache, etc.
Typically involves licensing fees. Generally free to use, may have optional
support or premium versions.
For example,Microsoft Office,Adobe For example, Mozilla Firefox, LINUX
Photoshop,Oracle Database,etc. Kernel, Apache Web Server, etc.
Ans 20. The Internet has turned our existence upside down. It has revolutionized
communications, to the extent that it is now our preferred medium of everyday
communication. We use the Internet for almost every work such as ordering a
pizza, buying anything, sharing a moment with friends, or sending a picture over
instant messaging.
Example of positive aspects of the internet:
• Promote education : The internet has made education more fun and convenient.
Students can now access tons of study materials and video tutorials without
breaking a sweat. People interested in pursuing various careers and e-commerce
are also turning to the internet to apply for jobs, attend online classes, and
make payments remotely.
Example of negative aspects of the internet:
• Cybercrime: The popularity of the internet has also attracted the attention of
bad elements in society. Crimes that take place over and around the internet
are described as cybercrimes. These crimes are often manifested through identity
theft, phishing, fraud, and hacking. With these revelations, the dark web has
become a popular platform to trade stolen data and materials. Other vices
perpetrated over the internet include cyber-bullying, cyber-stalking, internet
predation, child pornography, and spreading hate.
Individual and corporate users also stand a risk of being attacked by computer
viruses and ransomware. All these factors can lead to loss of money, valuable
information, and damage to hardware infrastructure.
Ans 21. The areas where internet addiction is advantageous are:
(i) E-commerce
(ii) Online courses
(iii) Education / Abundant Information
Ans 22. Three emotional symptoms of internet addiction are:
(i) Depression
(ii) Isolation
(iii) Anger issues
Three physical symptoms of internet addiction are:
(i) Impact on bones and joints
(ii) Impact on hearing
(iii) Impact on eyes