IP Notes Class 12th 2024-25
IP Notes Class 12th 2024-25
HST- 2024-2025
BHOPAL
OFFICE
REGIONAL
VIENOSNGATNK
ANDO
AC
BRAR
Date
INFORMTICS PRACTICES
212HD Patrons
Dr. R.
Senthil Kumar, Deputy Commissioner
KVS Regional Office, Bhopal
CONTENT TEAM
BAIRAGARH HEMANT SONI
BARWANI Abha Jain
BETUL YASHDEV HADA
BHOPAL No.2 Shikha Chourasia
BHOPAL No.3 Sabra Khan
BINA Mr Rajesh Babu Kushwaha
SEONI MALWA Mrs. Kirti Asrekar
UJJAIN RAHUL NAMDEO
3 Introduction to Computer 10 12 12
Networks
4 Societal Impacts 10 14 14
Project 7 7
Practical 30
Data Visualization
Purpose of plotting, drawing and saving following types of plots using Matplotlib -line plot,
bar graph, histogram Customizing plots: adding label, title, and legend in plots.
Unit 2: Database Query using SQL
Revision of database concepts and SQL
XIMath functions: POWER (0.
commands covered in class
ROUND (). MOD (0.
Text functions UCASE (0/UPPER (). LCASE
()/LOWER 0. MID ()/SUBSTRING
(0/SUBSTR ),LENGTH 0, LEFT (). RIGHT (),
Date Functions: NOW (), DATE (). MONTH INSTR 0, LTRIM 0, RTRIM (), TRIM )
DAYNAME ().
MONTHNAME ), 0. YEAR 0. DAY ().
Aggregate Functions: MAX (). MIN (), AVG ().
SUM(). COUNT (). using COUNT (*)
Querying and manipulating data using
Group by, Having,Order by
Working with two tables
using equi-join
Unit 3:
Introduction to Computer
Networks
introduction to networks, Types of network: PAN, LAN, MAN,
WAN. Network Devices:
modem, hub, switch, repeater, router, gateway Network
Introduction to Internet, URL, WWW,
Topologies: Star, Bus, Tree, Mesh.
and its applications- Web, email, Chat, VolP.
Website: Introduction, difference between a website
page, web server and hosting a and webpage, static vs dynamic web
of website.
Web Browsers: Introduction, commonly used browsers,
and plug-ins, browser settings, add-ons
cookies.
5.2 Visualization
1.Given the school result data, analyses the performance of the students on
different parameters, e.g subject wise or class wise.
2. For the Data frames created above, analyze, and plot appropriate charts with title
and
legend.
3. Take data of your interest from an open source (e.g. data.gov.in),
aggregate
and summarize it. Then plot it using different plotting functions of the Matplotlib library.
5.3 Data Management
1. Create a student table with the student id, name, and marks as attributes where
the student id is the primary key.
2. Insert the details of a new student in the above table.
3. Delete the details of a student in the above table.
4. Use the select command to get the details of the students with marks more than 80.
5. Find the min, max, sum, and average of the marks in a student marks table.
6. Find the total number of customers from each country in the table (customer
ID, customer Name, country) using group by.
7. Write a SQL query to order the (student ID, marks) table in descending order of
the marks.
STUDY MATERIAL
Pandas Series
like one-dimensional array capable of holding data of any type (integer, string, Tioat, Python
tis
objects, etc.). Series can be created using constructor.
Syntax pandas.Series( data, index, dtype, copy)
Creation of Series is also possible from -ndarray, dictionary, scalar value.
Series can be created using
1. Array
2. Dict
3. Scalar value or constant
Create an Empty Series
e.g.
import pandas as pseries
S=pseries. Series()
print(s)
Output
Series([),dtype: float64)
a
Create Series from ndarray without index
e.g.
import pandas as pd1
import numpy as np1
=
data np1.array(['a','b','c, d'])
S= pdl.Series(data)
print(s)
Output
1a
2 b
3c
4d
dtype: object
:
Note default index is starting from 0 with index position
e.g.
import pandas as p1
import numpy as np1
data = np1.array(['a','b', 'c','d')
s= p1.Series(data, index=[100,101,102, 103))
print(s)
Output
100 a
101 b
102 c
103d dtype:
object
Note :index is starting from 100
Create a Series from dict
Eg. 1(without index)
import pandas as pdl
import numpy as np1
data = (a' :0., 'b' :1,, 'c' :2.)
s= pd1.Series(data)
print(s)
Output
a 0.0
b1.0
c2.0
dtype: float64
b. 2
c. 3
dtype: int64
Return first 3 elements
tail function
e.g
import pandas as pdl
S= pd1.Series([1,2,3,4,5], index =
['a',b';c,'d',' e'])
print (s.tail(3)
Output
c3
d. 4
e. 5
dtype: int64
Return last 3 elements
dtype: int64 c3
d. 4
e. 5
dtype: int64
Retrieve Data Using Label as (Index)
e.g.
import pandas as pd1
=
s= pd1.Series([1,2,3,4,5], index ('a', 'b',' c',' d',' e'])
print (s['c,' d'])
Output c
3
d4
dtype: int64
Retrieve Data from selection
There are three methods for data selection:
*
loc gets rows (or columns) with particular labels from
the index.
iloc gets rows (or columns) at particular positions in
the index (so it only takes integers).
ix usually tries to behave like loc but falls back to
QUESTIONS MLL
1. **What is a Series in Python's pandas library?**
-
Answer: A Series is a one-dimensional array-like object in pandas that can hold any data type
(integers, strings, floating-point numbers, etc.). It is similar to a column in an Excel sheet.
2. **How do you import the pandas library in Python?**
Answer: import pandas as pd
3. **Write a code snippet to create a Series from a list [10, 20, 30, 40, 50].**
-Answer:
'import pandas as pd; s = pd.Series([10, 20, 30, 40, 50))
4. **How can you create a Series with custom indices ['a', 'b','c, 'd', 'e'] from the list [10, 20, 30, 40,
50]?**
Answer: 's = pd.Series([10, 20, 30, 40, 50), index=['a', 'b', 'c, 'd', 'e'])
5.**What function is used to create a Series froma dictionary ('a': 1, 'b': 2, 'c': 3)2**
Answer: pd.Series(f'a': 1, "b': 2, 'c': 3)'
-
6. **How can you access the value at index 'b' in the Series created from the dictionary (a': 1, 'b': 2,
'c': 3)2**
Answer: 's= pd.Series([l'a': 1, 'b': 2, 'c': 3}); value = s[b']
-
7. **Write a code to create a Series from a NumPy array 'np.array([1, 2, 3, 4, 5]) .**
-
Answer: import numpy as np; import pandas as pd; arr = np.array([1, 2, 3, 4, 5); s =
pd.Serieslarr)"
8. **What attribute of a Series object can be used to view the index labels of the Series?**
-
Answer: s.index
9. **How do you change the index of a Series to ['w', 'x, 'y', 'z] fora Series with 4 elements2**
-Answer:
's.index = ['w, '*,'y', z]
10. **What is the output of 's[1]' if = pd.Series([5, 10, 15, 20, 25))' ?**
's
Answer: 10
11 "How can you check if the index 'a' exists in the Series 's *
Answera' in s
12. **Write a code to create a Series with default indices from a tuple (10, 20, 30, 40),**
Answer:'s= pd Series((10, 20, 30, 4O))
13**what is
the method to retrieve the first 3 elements of a Series s
?,
Answer: s.head(3)
14 *Write a code to create an empty Series
and assipgn it to the variable s.
Answer:'s= pd.Series)
15.**Explain how to convert a Series to a list.
Answer: Use the tolist() method. Example:
's.tolist()
These questions should help Class 12th CBSE students get a good grasp of
the basics of creating and
manipulating Series in Python using the pandas library.
Assertion reasoning
Topic: Creation of Series from ndarray, dictionary,
1. ""Assertion:* A
scalar value
Pandas Series can be created from a Num Py ndarray.
Reasoning:** Because a Series is essentially a one-dimensional labeled array capable of holding
any data type.
(A) Both assertion and reasoning are true, and the reasoning is
the correct explanation far the
assertion.
(B)Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
(C) The assertion is true, but the reasoning is false.
(D) Both assertion and reasoning are false.
Answer: A**
2
Assertion: When creating a Series from a dictionary, the keys become the index.
Reasoning:** This is because a Series can automatically use the keys of a dictionary as index labels
for the corresponding values.
(A) Both assertion and reasoning are true, and the reasoning is the correct explanation far the
assertion.
(B) Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
(C) The assertion is true, but the reasoning is false.
(D) Both assertion and reasoning are false.
Answer: A
3. Assertion: A Series created from a scalar value will have the same value for all elements
Reasoning: Because when a scalar value is used, Pandas creates a Series of the specified length
where each elermnent is the scalar value.
(A)Both assertion and reasoning are true,and the reasoning is the correct explanation for the
assertion.
(B)Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
(C) The assertion is true, but the reasoning is false.
(D) Both assertion and reasoning are false.
Answer: A
4. Assertion: If no index is provided, Pandas will generate a default integer index starting from 1
**Answer: D**
**Answer: A**
**Answer: D**
3.**Assertion:** 'head()' and 'tail()' functions can only be used with Series and not with
DataFrames.
**Reasoning:** Because these functions are designed to work with one-dimensional data
structures.
-(A) Both assertion and reasoning are true, and the reasoning is the correct explanation for
the
assertion.
-(B)Both assertion and reasoning are true, but the reasoning is not the correct explanation for
the
assertion.
-
(C) The assertion is true, but the reasoning is false.
-
(D) Both assertion and reasoning are false.
**Answer: D**
4.*Assertion** The head(n=3) function cal returns the first three elements of a Series.
*Reasoning** Because the n' parameter specifies the number of rows to return from the start.
(A) Both assertion and reasoning are true, and the reasoning is the correct explanation for the
assertion.
(B)Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
(C) The assertion is true, but the reasoning is false.
(D) Both assertion and reasoning are false.
**Answer: A**
S.**Assertion:** The tail(n=S)' function call returns the last five elements of a Series.
**Reasoning:** This function call is useful for inspecting the last few elements of a Series.
(A) Both assertion and reasoning are true, and the reasoning is the correct explanation for the
assertion.
(B) Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
-(C) The assertion is true, but the reasoning is false.
-
(D) Both assertion and reasoning are false.
**Answer: A**
1. **Assertion:** You can select a single element from a Series using its index label.
** Reasoning:** Because a Series is indexed and elements can be accessed using
these labels.
-(A) Both assertion and reasoning are true, and the reasoning is
the correct explanation for the
assertion.
-(B)
Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
- (C)
The assertion is true, but the reasoning is false.
-
(D) Both assertion and reasoning are false.
**Answer: A**
2. **Assertion:** Slicing a Series using 'Series[start:stop]' includes the element at the stop
position.
**Reasoning:** This follows the standard Python slicing convention where the stop index is
inclusive.
-
(A)Both assertion and reasoning are true, and the reasoning is the correct explanation for the
assertion.
(B) Both assertion and reasoning are true, but the reasoning is not the correct explanation for the
assertion.
-
(C) The assertion is true, but the reasoning is false.
-
(D)Both assertion and reasoning are false.
**Answer: C**
3.*Assertion:** Indexing a Series with a list of indices returns a Series containing only the specifed
indices.
*Reasoning:** This allows for selecting multiple elements at once.
-
**Answer: A**
**Answer: D**
5. **Assertion:*** The method `iloc is used for integer-location based indexing in a Series.
** Reasoning:** iloc allows selecting elements based on their integer index
positions, not the
index labels.
-
(A) Both assertion and reasoning are true, and the reasoning is the correct explanation
for the
assertion.
-
(B) Both assertion and reasoning are true, but the reasoning is not the correct explanation for
the
assertion.
-
(C)The assertion is true, but the reasoning is false.
-
(D)Both assertion and reasoning are false.
**Answer: A**
These questions should help in understanding various aspects of creating and manipulating Pandas
Series.
MCQs
1, **Which of the following is a correct way to create a Series froma NumPy ndarray?**
-
(A)`pd.Series(ndarray)"
-
(B) 'pd.Series(array)'
-(C) `pd.Series(ndarray, index=ndarray)'
-
(D) `pd.Series(index=ndarray)
**Answer: A**
dictionary?**
a
2. **What becomes the index when a Series is created from
(A) The values of the dictionary
(B) The keys of the dictionary
-
3. **Creating a Series from a scalar value requires specifying which additional parameter?**
-(A) dtype
-(B)
index
-(C) name
-(D)
`columns
**Answer: B**
**Answer: A**
5. **if no index is provided, what index will a Series created from a list have ?**
- (A) The values of listthe
- (B)
The length of the list
- (C)
Sequential integers starting from 0
- (D) Sequential integers starting from 1
**Answer: C**
**Answver: A**
**Answer: C**
**Answer: D**
indices2**
result of series1 series2 if seriesl" and series2 have the same
4.
What will
be the
(A)Elemnent-wise multiplication of
the Series
(B) Seriesl values replaced by
Series2 values
(C)Series with the sum of corresponding
values
(D) Series with the product
of the indices
**Answer: A**
Answer:A*
**Answer:C**
**Answer: B**
Answer: A**
4. 1f series = pd.Series([10, 20, 30, 40, 50]), what does 'series.tail(2) return?**
-(A) 340 4 50 dtype: int64
-(B) O 10 1 20 dtype: int64
-(C)
- (D) 1
4 50 dtype: int64
20 2 30 dtype: int64
*Answer: A**
**Answer: B*
1. **How can you access the element at index '2 in a Series 'series ?*
-(A) 'series[2]
(B) 'series.loc[2]'
-(C)'series.iloc[2]
-
(D) Allof the above
**Answer: D**
**Answer: A**
**Answer: B**
a
4. **How can you select multiple non-contiguous elements in Series?**
-(A) Using a list of indices
-
(B) Using a slice
- (C) Using a boolean array
-
(D) Both A and C
**Answer: D**
**Answer: A**
CBT
python
series = pd.Series(5, index=['x, 'y, 'z])
print(series)
5*Task* Create a Series from the dictionary data = ('a': 1, 'b: 2} and assign it to a variable
series. Then, print the data type of the values in the Series.
**Question;** Write the code to create the Series and print the data type.
python
data = (a': 1, 'b': 2}
series = pd.Series(data)
print(series.dtype)
python
seriesl a pd. Series([L. 2, 3)
series2 pd. Series(l4.5, 6)
result = series1 + series2
print(result)
python
series = pd Series([10, 20, 30))
=
result series 2
print(result)
python
seriesl = pd.Series([1, 2, 3])
series2 = pd.Series([1, 2])
-
result = series1 series2
print(result)
4. **Task:**Create a Series 'series = pd.Series([1, 2, 3, 4]). Calculate the square of each element.
Question:** Write the code to square each element and print the result.
python
series pd.Series([1, 2, 3, 4))
result series **2
print(result)
= = pd.
5. **Task:** Given 'series1 pd.Series([10, 20, 30])' and 'series2 Series([1, 2, 3). perform
element-wise division.
**Question:** Write the code to divide 'seriesl' by 'series2 and print the result.
'python
series1 = pd.Series([10, 20, 30))
series2 = pd.Series([1, 2, 3)
result series1 / series2
print(result)
python
series = pd Series(range(10)
result = series.head(3)
print(result)
.
Create a Series 'series = pd.Seriesrange(20)) Use the tail function to get the last 5
2.lask:
elements.
**Question:** Write the code to get and print the last 5 elements.
python
series = pd.Series(range(20))
result = series.tail(5)
print(result)
3.**Task:** Create a Series 'series = pd.Series([100, 200, 300, 400, 500)). Use the 'head' function
without any parameters.
**Question:** Write the code and print the result. How many elements are returned?
python
series = pd.Series([100, 200, 300, 400, 500)
result = series.head()
print(result)
4, **Task:** Create a Series 'series = pd.Series(range(1, 11))'. Use the 'tail function with parameter
0
**Question:** Write the code and print the result. What is returned?
'python
series = pd.Series(range(1, 11)
result = series.tail(0)
print(result)
s *Task:** Create a Series 'series pd.Series(range(5, 15)). Use both 'head' and 'tail' functione to
get the first 2 and last 2 elements.
w*Question:** Write the code to get and print both results.
python
= pd.Series(range(5, 15))
series
head result = series.head{2)
tail result = series.tail(2)
print("Head:", head_result)
print("Tail:", tail_result)
1. *Task:** Create a Series 'series = pd.Series([10, 20, 30, 40, 50), index=['a', 'b', 'c', 'd', 'e'])'. Select
the element at index'c'.
**Question:** Write the code to select and print the element.
'python
series = pd.Series([10, 20, 30, 40, 50], index=['a', 'b', 'c, 'd', 'e'])
result = series['c']
print(result)
2. **Task:** Create a Series 'series = pd.Series(range(10))' . Use slicing to get the elements from
index 2 to 5.
**Question:** Write the code to slice and print the result.
'python
series = pd.Series(range(10))
result = series[2:6)
print(resuit)
3. **Task:** Create a Series 'series =pd.Series([1, 2, 3, 4, 5, 6,7, 8, 9, 10) . Select the elements at
positions 1, 3, and 5 using integer indexing.
**Question:** Write the code to select and print the elements.
python
series = pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
result = series.iloc[1, 3, 5]]
print(result)
4. **Task:** Create a Series 'series = pd.Series([100, 200, 300, 400, 500], index=['a', 'b', 'c, 'd', 'e'|).
Use boolean indexing to select elements greater than 300.
**Question:** Write the code to select and print the elements.
'python
series = pd.Series([100, 200, 300, 400, 500), index=['a', 'b', 'c, 'd', 'e'])
result = series[series > 300]
print(result)
5. **Task:** Create a Series'series =pd.Series(range(1, 6), index=['a', 'b', 'c', 'd', 'e'])'. Select
elements at indices 'b' and 'd' using label-based indexing.
**Question:** Write the code to select and print the elements.
python
=
series pd.Series(range(1, 6), index=['a', 'b', 'C, 'd','e'])
=
result series.loc[['b,'d']]
print(result)
Case Based
1Case
of
Study:* A
data scientist is working on a machine learning project and has a NumPy array
feature values for a dataset.
**Question:** How canthe data scientist convert the following
NumPy array features
np.array([0.1, 0.2, 0.3, 0.4, 0.5])' intoa Pandas Series? Write the code
and explain why this step
useful.
python
import numpy as np
import pandas as pd
'python
stock prices = (2024-01-01': 150, '2024-01-02': 152, '2024-01-03': 148)
series = pd.Series(stock_prices)
print(series)
3. **Case Study:** An engineer needs to initialize a Series with a constant value to represent a
baseline measurement for multiple sensors.
**Ouestion:** How can the engineer create a Series with a
scalar value baseline = 10` sensors
indexed as f'sensor1, 'sensor2', 'sensor3'] ? WNrite the code and discuss the significance for
of
initializing with a scalar value.
'python
baseline = 10
series = pd.Series(baseline, index=('sensor1', 'sensor2','sensor3')
print(series)
python
temperatures = [22, 21, 23, 22, 20]
series = pd.Series(temperatures)
print(series)
**Explanation:** The index will be automatically assigned as sequential integers starting from 0.
'python
scores = ('Alice': 85, 'Bob': 90, 'Charlie': 78)
series = pd.Series(scores)
print(series)
**Explanation:** This Series can be used to calculate statistics like mean, median, and standard
deviation of the scores.
1. **Case Study:** A data analyst has two Series representing sales data for two quarters. They need
to calculate the total sales.
**Question;** How can the analyst add the Series 'sales_q1 = pd.Series([200, 250, 300])' and
'sales q2 = pd.Series([220, 270, 320])'? Write the code and explain the result.
python
sales_q1 = pd.Series([200, 250, 300])
sales_q2 = pd.Series([220, 270, 320])
=
total_sales sales_q1+ sales_q2
print(total_sales)
**Explanation:** The result is the element-wise addition of the two Series, giving total sales for
each corresponding period.
2, **Case Study:** A scientist has a Series representing experimental data. They need to normalize
this data by subtracting the mean.
**Question: ** How can the scientist normalize the Series 'data = pd.Series([10, 20, 30, 40, 50])| ?
Write the code and explain the steps.
python
data = pd.Series([10, 20, 30, 40, 50])
-
normalized data = data data.mean()
print(normalized _data)
txplanation:* Subtracting the mean centers thedata aeosnd 0.
which is useful Tor Turnet
statistical analysis.
4.Case Study:** An economist needs to adjust prices in a Series by multiplying them with a factor
of 1.05 to account for inflation.
**Question:** How can the economist adjust the Series
'prices = pd.Series([100, 200, 300]) ?
Write the code and explain the importance
of such adjustments.
python
prices = pd.Series([100, 200, 300])
adjusted_prices = prices* 1.05
print(adjusted_prices)
python
scores = pd.Series([70, 80, 90])
curved scores = SCores +5
print(curved_scores)
python
time_series = pd.Series(range(50))
last_three = time series.tail(3)
print(last_three)
**Explanation:** The tail' function allows for quick inspection of the most recent data, which is
often critical in time series analysis.
3.**Case Study:** A data scientist needs to verify the initial values in a Series to ensure data
integrity before further processing.
**Question:** How can the data scientist use the head' function on data = pd.Series([5, 10, 15,
20,25, 30])' to check the first 2 elements? Write the code and explain the benefits.
'python
data = pd.Series([5, 10, 15, 20, 25, 30])
first_two = data.head(2)
print(first_two)
**Explanation:* * Checking initial values helps in validating data before applying any
transformations or analysis.
4. **Case Study:** A teacher has a Series of student scores and wants to see how the last few
students performed.
**Question;** How can the teacher use the 'tail' function on 'scores = pd.Series([80, 85, 90, 75,
95, 88]) toget the last 4 scores? Write the code and discuss the importance.
python
Scores =pd.Series( [80, 85, 90, 75, 95, 88])
last_four = scores.tail(4)
print(last_four)
**Explanation:** This allows the teacher to focus on the recent performance of students, which
can be helpful for identifying trends or
issues.
5. **Case Study:** An inventory manager needs to check the most recent additions to the stock.
**Question;** How can the manager use the tail function on inventory = pd.Series(range(100,
110)) to get the last element? Write the code and explain its usefulness.
python
inventory = pd.Series(range(100, 1 10))
last item inventory.tail( 1)
=
print(last_iten)
*Explanation:** Checking the most recent
addition helps in verifving the latest stock upaates
ensuring accurate inventory management. ae
### Topic: Selection, Indexing,
and Slicing
1. "*Case Study:** A data analyst has a Series with sales data indexed
access the sales by months and wants to
data for March.
Question:** Howcan the analyst
select the element at index 'March' in
pd.Series([200, 250, 300, 400], index-[January', the Series sales
explain the importance. 'February', 'March', 'April']) ? Write the code ana
python
sales = pd.Series([200, 250, 300, 400), index=('lanuary',
march sales = sales['March'] 'February', 'March, 'April])
print(march _sales)
python
measurements = pd.Series(range(10, 20)
sliced data = measurements[2:5]
print(sliced_data)
python
gdp = pd.Series([1000, 1500, 2000, 2500], index=['Q1, 'Q2', 'Q3, 'Q4])
first_quarter =gdp.iloc[0]
last_quarter = gdp.loc['Q4']
print(first_quarter, last_quarter)
**Explanation:** Integer indexing ('iloc) is used for positional access, while label-based indeying
('loc) is used for accessing data by label.
4 **Case Study:** A teacher has a Series of student names and scores. They need to get scores for
students whose names are 'Alice' and 'Charlie'.
**Question:** How can the teacher use label-based indexing on 'scores = pd.Series(90. R5 QgI
index=[Alice','Bob', 'Charlie'])' to get the scores for 'Alice' and 'Charlie'? Write the code and
the process.
python
scores = pd Series([90, 85, 95], index=['Alice', 'Bob, 'Charlie'])
selected scores = scores. loc[[|'Alice', 'Charlie'])
print(selected_scores)
**Explanation:** Label-based indexing allows for precise selection of data based on the index
labels, useful in named datasets.
5.Case Study:** A project manager has a Series of task durations and needs to find the tasks that
took more than 5 days
*Question:** How can the manager use boolean indexing on durations = pd.Series([2, 5, 8, 6, 3).
index=[Task1', Task2', Task3', Taska', Task5'])' to get tasks taking more than 5 days? Write the code
and discuss the benefits.
python
durations = pd.Series([2,5, 8, 6, 3], index=['Task1', "Task2, Task3, Task4', TaskS'])
long_tasks = durations(duratians > 5]
print(long_tasks)
**Explanation:** Boolean indexing filters data based on conditions, enabling easy identification of
specific data points that meet certain criteria.
M.LL. :QUESTIONS
1. What is series?
2. Write a program to create a series to print scalar value "5" four times
4. Define DataFrame?
5. What are the different ways Data Frame is created?
6. Write a Python code to create a DataFrame stock with appropriate column headings from
the list given below:
[[101,'Geeta',98], [102, 'Raju',95], [103, 'Seema',96], (104, Yash',88]]
7. How are Dataframe related to series?
11. What difference do we see in deleting with del and pop methods?
12. Which attribute is used to check if the series object contains NaN values?
13. What is a CSV files?
14. Which Pandas method is used to send content to a dataframe to CSV file?
QUESTIONS:
another.
Reason (R): itertuples () returns the iterator yielding each index value along with a series
containing the data in each row.
3. Assertion (A): Indexing can also be known as sub selection.
Reason (R): Pandas DataFrame. loc attribute access group of rows and columns by label(s) or
a boolean array in the given DataFrame.
4. Assertion (A): To delete a column from Panda Data Frame,drop() method is used.
Reason (R): Columns are deleted by dropping columns with index label.
5. Assertion (A): Rows can also be selected by passing integer location.
Answers
1. Option (C) is correct.
single iteration, and the outcome of each iteration is then the starting point of the next
iteration.
iterrows() returns the iterator yielding each index value along with a series containing the
data in each row.
3. Option (D) is correct.
Explanation: Indexing can also
be known as subse selection.
Ioc takes two single/ist/range operator separated by7. The first one
indicates the row at
the second one indicates columns.
4. Option (C) is correct.
Explanation: To delete a column from Pandas DataFrame, drop() method is used. Columns
are deleted by dropping
columns with column names.
5. Option (B) is correct.
Explanation: To retrieve rows from a DataFrame, a specialmethod is used named
DataFrame.loc[). Rows can also be selected by passing integer location to iloc[] method.
6. Option (C) is correct.
Explanation: head() function returns first n rows from the object based on position. It IS
useful for quickly verifying data. for example,after sorting Syntax, Data Frame.head(n = 5)
Here, n is the selected number of rows whose default value is 5.
7. Option (C) is correct.
Explanation: List of dictionary can be passed to form a DataFrame. Keys of dictionary are
taken
8. Option (D) is correct.
Explanation: Indexing can also be known as subse selection.loc takes two single/list/range
operator separated by 7. The first one indicates the row and the second one indicates
columns.
9. Option (A) is correct.
Explanation: A CSV file stores data, both numbers and text in a plain text. All fields are
separated by commas while allrecords are separated by an elaborate line of characters. A
spreadsheet program sorts the data in a CSV file systematicaly via columns. This helps to
filter all the contents in the file.
10. Option (C) is correct.
Mulitple Choice Questions
S1.Head() b. S1Tail(5)
C. S1.Head(5) d. S1.tail()
3. Todisplay top five rows of a series object 'S', you may write:
S.head) b. S.Tail(5)
C. S.Head(5) d. S.tail()
4. Which method in Pandas can be used to change the index of rows and columns of a Series or
DataFrame:
rename() (ü) reindex() (i) reframe() (iv) none of the above
5. In a Dataframe, axis = 0 is for:
a. Columns b. Rows
11. Pandas is a:
a. Package b. Language
c. Library d. Software
b. S=pd.Series(State, Monument)
c. S=pd.Series(Monument, index=State)
d. S=pd.series(Mon ument, index=State)
17. Difference between loc() and iloc().:
a. Both are Label indexed based functions.
b. Both are Integer position-based functions.
c. loc() is label-based function and iloc() integer position-based function.
d. loc() is integer position-based function and iloc() index position-based function.
PRACTICE PROGRAMS
8. Read the Student_result.csv' to create data frame and do the fallowing operation:
9. Read the Student_result.csv to create data frame and do the following operation:
10. Read the 'Student_result.csv to create data frame and do the following
operation:
To createa duplicate file for 'student_result.csv containing Adm No, Name and
Percentage.
Write the statenent in Pandas to find the highest percentage and also pr
SOLUTIONS OF PROGRAMS
#
create a dictionary
dictionary = ('X 10, "Y':20,:
'Z' :30) # create a series
series = pd.Series(dictionary)
print(series)
4# Write a Pandas program to select the rows where the percentage greater than 70.
import pandas as pd
import numpy as np
exam_data = ('name': ['Aman', 'Kamal', 'Amjad', 'Rohan', 'Amit', 'Sumit', 'Matthew', 'Kartik',
"Kavita', 'Pooja'],
'perc': [79.5, 29, 90.5, np.nan, 32, 65, 56, np.nan, 29, 89],
'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']}
labels = ['A', 'B', 'C, 'B', 'E', 'F", 'G', 'H, ", "]
,
df = pd.Data Frame(exam_data index=labels)
print("Number of student whoes percentage more than 70:")
print(df[df['perc'] > 70])
5# Write a Pandas program to select the rows the percentage is between 70 and 90
(inclusive)
import pandas as pd
import numpy as np
=
exam_data ('name': ['Aman'", 'Kamal', 'Amjad', 'Rohan', 'Amit', 'Sumit','Matthew', "Kartik',
"Kavita', 'Pooja'],
'perc': [79.5, 29, 90.5, np.nan, 32, 65, 56, np.nan, 29, 89],
'qualify': ('yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes'])
labels =
['A', 'B', 'C, 'B', 'E', 'F', 'G', 'H, '', "]
,
df pd.Data Frame(exam_data index=labels)
=
import pandas as pd
import cSV
#Reading the Data
= pd.read_csv("student_result.csv")
df
# Display Name of Columns
print(df.columns)
#
Display no of rows and column
print(df.shape)
# Display Column Names and their types
print(df.info()
a following operation:
9# Read the 'Student_ result.csv' to create data frame and do the
B To display Adm No, Gender and Percentage from 'student_result.csv
file.
# To display the first 5 and last S records from 'student result.csv file.
import pandas as pd
import csv
RTodisplay Adm_ No,
Gender and Percentage from 'student_result.csv file.
= ['ADM NO, GENDER', PERCENTAGE|)
df = pd.read_csv("student_result.csv",usecols
print(" To display Adm_No, Gender and Percentage from 'student_result.csv file.")
print(df)
#To display first 5 and last 5 records from 'student_result.csv' file.
dfl = pd.read_csv("student_result.csv")
print(dfl.head()
print[df1.tail()
10# Read the 'Student_result.csv' to create a data frame and do the following operation:
#To display Student_result file with new column names.
#To modify the Percentage of student below 40 with NaN value in dataframe.
import pandas as pd
import numpy as np
import csv
df = pd.read_csv("student_result.csv")
print(df)
names.
#To display Student_resuit file with new column
1,
dfi = pd. read_csv("student_result.csv",skiprows
names ('Adno', 'Sex','Name''Eng', 'Hin',
Maths','Sc.'SSt', San', IT,' Perc'])
print("To display Student result file with new column names")
print(df1)
# Tomdify the Percentage of student below 40 with NaN value.
= pd.read_csv("student_result.csv")
df2
print(df2)
print("To modify the Percentage of student below 40 with NaN value.")
df2.loc[(df2('PERCENTAGE'] <40, 'PERCENTAGE')}) = np.nan
print(df2)
IMPORTING/EXPORTING DATA BETWEEN DATAFRAME
AND CSV FILE
1. The dataof any CSV file can be shown in which of
the following software
(a) MS Word (b) Notepad (c) Spreadsheet
(d) All of the above
2. Tabular data that saved as plain text where datavalues are
separated by comte
a. Dataframe b. CSV c MySQL d. All of the above
3. Look at this image and identify the file type
a. MySQL
b. Dataframe
C. CSV
d. Excel
a. Attributes, 2. Rows
b. Columns, 2. Data
c. Degree, 2. Record
d. Header, 2. Record
b. Human readable
c. Easyto parse
d Test and numeric data are distinct
10. Defauit delimeter in CSV is
a. ;
b.:
c. I
d.,
11. A CSV ile can take as delimeter
a. ;
b. |
c.
\t
d. @
e. All of the above
12. To read data from CSV file in pandas dataframe method is used.
a. read csv()
b. to_csv()
C. reader()
d. writer()
14. Rama want to make a dataframe 'saledata' based on data of sale.csv which is stored in folder
'Python' in C: drive. What code she should write for it?
a. Saledata = pd.read_csv("'sale.csv") |
b.Saledata = pd.read_csv("C:/Python/sa le. csv")
c. Saledata = pd.to_csv("C:/ Python/sale.csv")
d. All of the above
15. If you want to read top 20 rows of data from CSV file, which argument would you give to
read_csv()?
a. Rows
b. NrowS
c. Header
d. Head
1. Assertion (A): - The acronym CSV is a short form for Comma Separated Values, which refers
to a tabular data saved as plain text where data values are separated by commas. Data can
be imported to a Dataframe from csv file.
ReasoninB (R):- If we have the data in a CSv file. we can import the data. But, Pytnon 3
Pandas library must be imported to the program.
Assertion(A) :All the columns of CSV file can be separated by comma,or other
3.
Reasoning (R) : CSV is a short form for Comma Separated Values, which reters to a
oee
teuua
data saved as plain text where data values are separated by commas oniy.
5. Assertion. The read csv() function of Python Pandas can read data of a csv file
into any of
pandas data structures.
file.
10. Assertion (A): CSV (Comma Separated Values) is a file format for
data
storage which looks like a text file.
Reason (R): The information is organized with one record on each line
and each field is separated by comnma.
11. Assertion(A) :We can read specific rows from the csv files.
Reasoning( R):The nrows attribute is used to
read specitic rowws from the Csy Fos
12. Assertion(A) :Pandas is a library of python.
Reasoning(R) We import pandas and import and export data between dataframe and csv
:
files.
13. Assertion (A):- CSV (Comma Separated Values) is a file format for data
is read_csv().The function used to fetch data from an SQL table into a DataFrame
is read_sql().
15. Assertion(A) : CSV stands for comma separated value file.
MCO
5. To read specific number of rows from a CSV file, which argument is to be given in
read csv( )?
rows = <n>
(a)
(b) nrows = <n>
(c)n_rows <n> -
7. Toskip 1st, 3rd and 5th rows of CSV file, which areument
will you give in read_csVI )
(a) skiprows = 11315
(b) skiprows - (1, 3, 5]
(c) skiprows = [1, 5, 1]
(d)Any of these
8. While reading from a CSV file, to use a column's values as index labels, argumnent
given in read_CSV() is :
(a) index
(b) index_col
(c) index_ values
(d) index label
11. Raju want to make a dataframe 'saledata' based on data of sale.csv which is stored in folder
'Python' in C: drive. What code he should write for it?
a. Saledata =
pd.read_csv("sale.csv") |
b. Saledata = pd.read csv("C:/Python/sale.csv")
c. Saledata = pd.to_csv("C:/Python/sale.csv")
12. (i) attribute used with read_csv() to import selective records/rows in dataframe
(i) attribute used with read_csv() to specify the number of row whose values are to
be used as column names.
13. Attribute used to specify the separator character for values being imported in dataframe
using read_csv()
a. Sepatator
b. Sep
c. Sepies
d. Space
.
14. Write code to read data from CSV file student.cSV stored in C: in dataframe 'std' including
exculsive columns rollno, name, percent where all values are separated by semicolon
a. Nrows = 10
b. Rows= 10
c. Skiprows = 10
d. Head= 10
16. You need to import CSV package in order to store a Data Frame in a CSV file.
a) True b) False
17. Write command to store data of DataFrame mdf into a CSV file Mydata.csv, with separator
character as'@
19. The data of any CSV file can be shown in which of the following software?
(a) MS Word (b) Notepad (c) Spreadsheet (d) All of the above
Once we have the DataFrame, we can persist it in CSV on the local disk.
Lets first create CSV file using data that is currently present in the DataFrame, we Can store Ce
of this DataFrame in CSV format using API called
to_CSV (..) of Pandas.
Pandas read csv()function is used to import a CSV file to Data Frame format.
Here,
header allows you to specify which row will be used as column names for your DataFrame. Expected
int value or a list of int values.
If your file does not have a header, then simply set header=None.
To export a Pandas Data Frame to a CSV file, use to_csv function. This saves a DataFrame as a CSV
file.
Syntax: to_csv(parameters)
2. Modify the above code and write the data in d:\software folder.
Ans.
import pandas aspd
Dic=('empno':(101, 102, 103,104),'name':('a','b',c', d'),
'salary':(3000,5000,8000,9000)}
df=pd.Data Frame(Dic)
df.to csv(r"D:\software\a.csv") #t or df.to_csv("D:\\software\\a.csv")
Read CSV File as Pandas Using the read_csv() function from the pandas
package, youcan import tabular data from CSV files into pandas Dataframe:
A a Seve As
Excel Macro-Enabled Termplate
1 Ths PC Lecal Disk (D)
sktop Excel 97-2003 Template
roll name marks Tet (Tab delimited)
Curnents
2 1
aleeza 55 New folder
|Uricode Text
wnloads XML Spresdsheet 2003
3 2 ananya 34 Muc Nae Microsoft Excel SD/95 Werkbook
Pctures SVGoma delumited)
4 3 rajesh 90 2
tures Fomatted Tet (Space delimited)
Videos
backup Text (Mscintosh)
5 4 amar 23 Local Disk () efrbackup-HCB Seos Text (MS-DOS)
Step 3: Select drive and folder name where you want to save csv file
Step 4: Click on save as type option and select csv option from list.
Step 5: Click on save button
sep:
It stands for separator, default is ,
df = pd.read_csv('sanple.csv', sep=':)
names: We can exclusively specify column names using the parameter names while creating the
DataFrame using the read_csv() function.
import pandas as pd
m = pd.read_csv("data.csv", sep=",", header=0, narnes-('Rno', 'S_Name', 's_Class', 'Section '])
print(m)
usecols
Retrieves only selected columns from the CSV file.
df = pd.read_csv('people.csv',
header=0,
usecols=("First Name", "Sex", "Email"])
index col
This is to allow you to set which columns to be used as the index of the dataframe. If None, there
are no index numbers displayed along with records.
df = pd.read csv("'people.csv',
header=0, index col=["Id", "Job Title"),
usecols=["Id", "Job Title", "Email"], nrows=3)
10 QUESTIONS CBT
1. To create dataframe T from following csv file temp.csv stored in c drive, which of the following
code is correct?
state matemp mintemp
mp 26 2
up 24
jk 12 -4
a. T= pd.read csv("c:\temp.csv")
b. T= pd.read csv("c:\temp.csv",sep ="")
c.T= pd.read csv("c:\temp.csv", sep=\n")
d. T= pd.read csv("c:\temp.csv', sep =Mt")
2. Select appropriate code toexport all data of dataframe df to csv file temp.csv located in c drive
excluding row labels.
a. df.to_csv("C:\temp.csv")
b. df.to_csv("C:\temp.csv", index = False)
C. df.to_csv("C:\temp.csv",
header = False)
d. None of the above
3. In order to work with CSV files from panda, you need to import ,other than
pandas.
1. .csV
2. pandas.io
3. neWCsV
4. no extra package required
4. The correct statement to read from a CSV file in a Data Frame is:
1. <DF>.read_csv(<file>)
2. <File>. read_csv( )(<DF>)
3. <DF>= pandas.read(<file>)
=
4. <DE> pandas.read csv(<files>)
5. To suppress first row as header, which of the following arguments is to be given in read csv() ?
= True
1. noheader
2.. = None
header
3. skipheader = True
= Null
4. header
6. Identify the function which can save dataframe df into csv file.
(i) dfwrite_csv() (ii)df.store_csv() (i) df.to_csv() (iv) df.create_csv()
7. To skip first 5 rows of CsV file, which argument will you give in read_csv() ?
1. skiprows = 5
2. skip_rows =5
3. skip=5
4, noread = 5
8. To skip 1st, 3rd and 5th row of CSV file, which argument will you
give in read_
1. skiprows =1| 13|5
2. skiprows =
[1, 5, 1]
3. skiprows = [1, 3, 5]
4. any of these
1. Write a programto read allcontent of "student.csv" in a dataframe and display records of only
those students who scored more than 80 marks. Records stored in students is in format : Rollno,
Name, Marks
0 1 2 3 4
0 1 Ram kumar 45 78 89
1 3 Jai Shankar 45 80 66
2 4 Sulekha rani 67 43 56
1 B2 C Kanitkar 180
Write a program to create csv file lib.csv with columns bname and price.
5. Ms Priya is working on an application made in python. She wrote the command tp customize the
column header but getting an error. Provide her the solution for the same and also give the
explanation.
6.Mr Prakash has created a csv file to store the students details with header rows. While reading
data from csv file into the dataframe he wants to hide the header from the csv file. He has written
the following code but getting an error.:
Df- pd.read_csv("d://adm.csv",header="no")
Provide him the solution for the same and also give the explanation.
7. Ms Smita wants to write the following data in similar pattern in csv file (separated each by * and
ignore default index). Help her to do the same.
2 Manish 300 3
3 Saurabh 250 4
8. Write a program toread data from a CSV file where separator character is '@'. Make sure that:
9. Ms. Payal wants to create a CSV file from another CSV file. The file contains 5 columns EmpName,
Empld, Salary, Designation, DOB. Payal wants to read first three rows from the file. She has found
the code to do the task she wants, but one line of code is missing. Help her to complete the code.
import pandas as pd
df = pd.read_csv("E:|\Data\\Employee.csv")
df.to_csv("E:\\Data\\Emp.csv",
10. Write a program that reads from aCSV files where the separator character is '#.Read only first
5 rows in your dataframe.
i.Give column headings as EmpName, Designation, Salary.
ii. Make sure to read first row as data and not as column headers.
11.Write a program to show the detail of the student who scored the highest marks. Rama stored
in "Data.csv" in given below
:
student of class 12th is trying to write program to search the record from "data.csy!
a
12. Amit, a
is
according to the admission number input from the user. Structure of record saved "data.csy"
in
Marks.
Adm_no, Name, Class, Section,
1, AKSHAY, XII,A
2, ABHISHEK, XII,A
3, ARVIND, XII, A
4, RAVI, XIl, A
5, ASHISH, XIl, A
Write the code to export this dataframe into the csv file Marks.csv.
MLL
1.
Pip installmatplotlib is a command to
install Matplotlib in your system.
2. In order to be able to use Python's Data Visualisation library, we
need to import the pyplot
module from Matplotlib library
3. mp.show) is used to display the figure, if matplotlib.pyplot as mp
is imported.
4. Write the function name to draw
line chart of two variables.plt.plot(X,y)
5. plt.savefig) function is
used to save the plot.
Q1:
import pandas as pd
data={'city':('Delhi', Bangalaru',' Chennai, Mumbai']),' MaxTemp': (40,31,35,29),
MinTemp':|32,25,2
7,21],'Rainfall':(24.1,36.2,40.8,35.2])
df=pd.Data Frame(data)
print(df) Temperature Analysis
Max
df['difference' ]=df['MaxTemp') 40.0
Min
Rain
37.5
df('MinTemp']
35.0
#print(df)
32.5
df.loc[4]=[('Gujrat',30,27, 25.8,5]
30.0
##print(df)
27.5
#print(df.head(3))
25.0
df.to_csv('climate.csv')
22.5
#print(df.drop(1)
Delhi Bangalaru Chennal Mumbat Gujrat
#print(df) Cities
plt.plot(df['city'], df['MinTemp'],'g',label='Min')
plt.plot(df['city'], d f['Rainfall],'b',label='Rain')
plt.legend()
plt.title('Temperature Analysis')
plt.xlabel('Cities')
plt.ylabel('Temp')
plt.show()
Q2:
import pandas as pd
data=('BookiD':['B001, B002', BO03','BO04'],'Subject':('CS,'CS,'CA', IP), BookTitle':[NCERT
CS,'Move with IP','Sample papers, NCERT IP])
df=pd.DataFrame(data)
print(df)
print(df.drop(3))
Books published yearwise
df.to_csv('Book.csv')
200
print(dfT)
175
print(df.head (3)
150
2 125
year=[2019,2020,2021,2022,2023]
50
Q3
import pandas as pd
data=('Name':('Ritesh' Mana' Harshal, Parth', 'Srishti'],' English':(67,78,89, 99,88],'Hindi':(76,87,9
8,99,70], Maths':[54,56,57,67,66], 'Science':[78,88,77,99,89])
df-pd.Data Frame(data)
print(df) Result Analysis
100
Eng
df['Grade']=('A1', A2', 'A1,'B1',' A2'] Hn
Math
print(df) 90 SC
df.to_csv('studentinfo.csv')
print(df.T)
70
plt.plot(df['Name'],df['English'], r,label='Eng')
plt.plot(df('Name'),df[|Hindi']).'g'abel'Hin')
plt.plot(df['Name'],df[fMaths'],"'b',label-'Math)
plt.plot(df['Name'],df('Science'],'m',label'Sci')
plt.legend)
plt.title(Result Analysis')
plt.xlabel('Student Name')
plt.ylabel('Marks')
plt.show()
Q4
import pandas as pd
data=('Name':['Anand', 'Manish', 'Rohit', 'Suresh",'Mahesh'], Year':(2020,2020,202 1,2021,2020), To
tal Score':[410,350, 150,380,400],'Result':["'Pass',' Pass', Fail',
'Pass', Pass'])
df=pd.Data Frame(data)
print(df)
print(df['Year']) 300
print(df.shape) 250
200
plt.title('Student Analysis')
Anand Manish Pohit Suresh Mahesh
plt.xlabel('Name of Students') Name of Students
plt.ylabel('Total Score')
plt.show()
Assertion Reasoning based
Assertion (A):
information and data using visual
Data visualization refers to the graphical representation of
elements like charts, graphs and maps etc.
Reason (R):
Assertion (A): Two sequences being plotted using plot function of matplotlib library do not produce
any result and gives error.
Reasoning(R) Two sequences being plotted do not match in their shape.
:
Assertion :While plotting chart using matplotlib, the coordinate postion of x axis andy axis is always
set to 0,0 and any data beyond this cannot be displayed
Reasoning :by using function pf pyplot we can limits for x-axís and y-axis.
A.
Both A and R are true and R is the correct explanation of A
B. Both A
and R are true but R is not the correct explanation of A
C.A is true but R s fase
D. A
is false but R is true
E. Both A
and R are false
Marks
Term1 45
index
Term2 65
Term3 24
Term4 89
Write a program in Python Pandas to create the series similar to creating a Datafrarme.
2. Consider the Dataframe
Humanoid
H1
H_2
H_3
i.
Write a command to display the records of the dataframe which have amount greater
i. How will you change the index from H_1,H_2,H_3 to101,102, 103
SName Amount
Alexa 7000
Cortana 5000
B. plt.Title("Title")
C. plt.title("Title")
D. plt.set title("Title")
D. plt.bar(x. y)
3. What is the standard way to import matplotlib's pyplot library in python
A. import matplot as plt
B. import matplotlib,pyplot as plt
C. from matplotlib inport pyplot as plt
D. import matplotlib pyplot as plt
4. Given a Pandas series called p_series, the command which will display the last 4 rows is
A. print(p_series.Tail(4))
B. print (p_series.Tails(4))
C. print (p_series.tail(4))
D. print(p_series.Tails(4))
5. Using Python Matplotlib histograms can be used to count how many values fall into each
C. Histogram
D. Both A and B
E. Allof the above
8. In histogram it describes the no. of that fall within a given value of data range
A. bins
B. bins
C. range
D. range)
Data Visualization with Pandasis the presentation of data a
in oranhicalformat. It heips peope
understand the significance ofdata bysummarizing and prosenting a huge amount of data in a
simple and easy to-understand format and helps communicate information clearly and
erectuvey
Datavisualization is a general term that describes any
effort to help people understanu t
Significance of data by placing it ina visual context. In simple words., Data
visualization 5 the
process of displaying data/information
ingraphical charts,figures and bars.
SIgniticance :- Patterns, trends and correlations that might oo undected in text based data can be
exposed and recognized easier with data visualization techniaues or tools such as line chart, bar
cart,histogram etc, Thus the data visualization tools, information can be
processed in eiciemt
manner and hence better decisions can
be made.
Python Supports data visualizations by providing some useful
libraries for visualization. IMMost
Types of chart
1. Line chart - A line chart or line graph is a type of chart which displays information as a series
of data points called markers connected by straight line segments. The pyplot interace offers
plot() function for creating a line graph.
2. Bar chart - It is a graphical display of data using bars of different heights. A bar chart can be
drawn vertically or horizontally. Pyplot offers bar function to create a bar chart.
3. Histogram - A histogram is a statistical tool used to summarize discrete or continuous data. It
provides a visual representation of numerical data by showing the number of data points that
fallwithin a specified range of values called bins.
LINE CHART
BAR CHART
P.LUsage
10
yel[140, 16,140, 180,10|, |130, 209, 180, 150, 160},[128, 130,150, 208,130), |190, 200, 178, 129,
1||
X=np.arange(5)
plt.bar (x+0.00,y[0], color-'b' ,width-0.30,label='1AN')
plt.bar(x+8.28,y[1], color='r',width-8.30, label='FEB')
plt.bar (x+6.48,y[2], color-'k',width-8.30,label-'MAR')
plt.bar(x+8.68,y[3], color='g',width-8.30,label= 'APR')
plt.ylabel('Rainfall in mn')
plt.xlabel('Directions')
plt.title("'Data of rainfall for 4 months')
plt.xticks (x, a)
plt. legend(1oc='upper right')
plt. show)
Data of rainfall for 4 months
200 JAN
FEB
175 MAR
150 APR
125
100
75
50
25
Displaymarker
8
y-axis
54
1
1 2 4 5 6 7 8
X-axis
o:Write a Python program to plot a bar chart, showing the No. of Books published in respective year using
the following data.
No. of Books = [160,170,185, 150,200]
Explain Matplotlib.
Write the names of various types of plots offered by matplotlib library.
Write the name of the attribute to specify the style of the line as dashed in line chart.
Section B-2 Marks each
What is the purpose of a legend?
Name any 4 methods used in pyplot.
Differentiate between bar chart and histogram.
What types of graphs can be plotted using matplotlib?
How to change the thickness of line, line style, line color, and marker properties of a
chart?
Define histogram.
2. Plot a histogram for marks of 10 students obtained in atest out of 100. Adjust bins as per
suitability. What is the affect on histogram on changing value of bins. Draw the histograrn so produced.
Also display title, xlabel, ylabel.
2. Give output forthe following program:
plt.legend()
plt.show()
3. Ramesh is an IP student. He is working on Data Visualization. His teacher has assigned hirrn a task
to create a line chart to show rainfallin Jaipur from 2001 to 2005. His code produced the following
output:
Rainfall in Jaipur
350
300
mm
in
Rainfall
250
200
150
CBT QUestions
1. Consider the following graph (Figure 26). ldentify
the code to plot it.
a. import matplotlib.pyplot as plt plt.plot
(2,7],[1,6]) !6). ldentify the code to plot it.
plt.show()
a. import matplotlib.pyplot as plt plt.plot([1,6],(2,7)
plt.show( )
plt.show( )
d. import matplotlib.pyplot as plt plt.plot([1,3], [4,1])
Figure for Questlon 26
)
plt.show(
2. For the given histogram number of bins are
Chem
2
60 BO 100
3. In the following line chart, the command to plot is
Open
782
High
Low
780 Cose
778
776
774
772
rinketplutprry
770
O3 O4 O6
2016
trin ket_plot. png
A. plt.plot(x,y, color='g, label= low')
, )
plt.plot(x,y, color='r' label=close
plt.plot(x,y,color="b', label='open')
,
plt.plot(x.y, color='y' label='high)
plt.legend(0
B. plt.plot(x.y, colour='g, label='low')
plt.plot(x,y,colour='r, label= close')
plt.plot(x.y,colour-'b', label='open' )
plt.plot(x.y,colour-'y' ,label='high')
plt.legend0
C. plt.plot(x,y,linecolorr'g,label=low')
plt.plot(x,y. linecolor-'r label=' close')
plt.plot(x,y,lineco lor-b',label='open')
plt.plot(x,y, linecolor='y', label="high')
plt.legend(0
4. For the following code the line chart printed will be of which shape
x=np.array([-5,-4,-3,-2,-1,0, 1,2,3,4,5])
y-x**2+16
plt.plot(x,y)
plt.show()
A. B
5. pltlegend() is not printing legend in the the graph, the reason could be
A. Label attribute is not set
while plotting.
B. Legend is not plotted.
C. Legend color is not set.
D. Legend is not positioned properly.
6. While ploting multiple graph, the bars gets overlapped and some data is not shown, the way
to print multiple bar is
A. Setting thickness of bar
B. Setting starting position of bars on x axis for multiple data ranges.
C. Choosing different colors for different bars
D. Seting x label
7. What type of chart is this figure
B. Bar chart
C. Histogram
D. Frequency polygon
Boys
Girls
30
25
Students
20
of
No.
2 15
10
XA XIl A XIIB
XB XI A XIB
Classes
She has written the following code but not getting the desired output. Help her by correcting her
code.
no_of_boys=[23,22,20,26,33,30]
no_of girls=[17, 10,20,12,5,8]
plt.show()
i) What will be the correct code for Statement 1
and Statement 2?
ii) What is the correct function name for Statement 3 and Statement 4?
tl Name the parameter and values used to apply the marker as given in the output.
vÌ Name the parameter and values Used to apply line style as given in the utet
vi)How to apply the line colours as given in the figure?
Consider the Data Frame below and answerthe questions that follow.
A_ 4
Prakash 70 145
dataframe?
Piyush 60
Prem 40
Prakash 70
i. df_data[df_data['Name']=='Piyush']
ii. df _data [df_data.Name=='Piyush']
iv. df_data['Name']==Piyush'
c.
What output of the command
>>> df_data.max()
3. Draw a bar chart as below representing the number of students in each class. Display title of
Student Strength
30
20
10
4. 3 Marks
5. Mr. Vijay is working in the mobile app development industry and he was comparing the given
chart on the basis of the rating of the various apps available on the play store.
App Rating
3
Rating
plt.xlabel("Apps")
plt.. ("Rating") #Statement 4
plt. #Statement 5
plt.
#Statement 6
i)Write the appropriate statement for #state ment 1 to import the module.
i) Write the function name and label name as displayed in the output for #statement 2 and
#statement 3 respectively.
iii) Which word should be used for #statement 4?
iv) Write appropriate method names for #Statement 5 to display legends and #Statement 6 to
open the figure.
v) Mr. Vijay wants to change the chart type to a line chart. Which statement should be updated
Introduction to Database
a
The of interrelated data is called database, and database system is fundamentally
colle ction
one particular
Computer based record keeping System. Database, contains information about
enterprise, especially for decision-making in management of the organization.
common and control approach is adopted for adding., modifying and retrieving data from database.
A
as
The importance of database is that the same collection of data serves as many applications possible.
Database is repository of information and it answers to the queries for planning purposes.
A database should be repository of all types of data. Data should be accurate, private and protected
from damage. Database should be well-organized so that data may be used in diverse applications.
Different application programmers and end users should have different views of data, as per their
need and use. Database should be valuable in the sense that it may be utilized in constantly and rapidly
changing conditions and in new conditions. Database should not have duplicate data. Database should
contain standardized data.
DATABASE MANAGEMENT SYSTEM (DBMS) DBMS is a software that controls the organization, storage,
retrieval, security and integrity of data in a database. DBMS accepts request from application and
instructs the operating system to transfer the appropriate data. DBMS makes use of traditional
programming languages such as COBL, C, C++ etc, or it may include its own programming language for
application development.
ADVANTAGED/CHARACTERISTICS OF GOOD DBMS
DBMS Controls Data Consistency When the redundancy is not controlled, there may be
occasions on which the two entries about the same data do not agree. This situation called
inconsistency. Inconsistence results in incorrect and conflicting information.DBMS controlled this
inconsistency by controll ing redundancy or by propagation updates (retaining redundancy due to
some technical reasons, without inconsistency is called propagation update).
DBMS Facilitates Data Sharing Accessing the same piece of data to different user for different uses
iscalled sharing of data. DBMS ensures this facility.
DBMS Enforces Standards DBMS enforces standards which are set by the company or
organization. This is done so that desired data may be interchanged or migrated between
different systems.
DBMS Ensures Data Security The information stored insidesthe database is of great value
and organization or corporation. Therefore DBMS ensures data security and privacy of data
ensuring that access to database can be made through proper channel.
DBMS Maintains Integrated Database Unification of severaldistinct data with any redundancy
eliminated is called integrated database DBMS ensures integrated database against hardware
failures and various types of accidents occurring occasionally, through updating and se
procedure defined by DBMS.
End UserAn end user isa person who is not a computer trained person but used the databa5e to
retrieve some information. E.g. In a railway /airways reservation system, a Customer retneves
details of train/flight details.
Application System Analyst A person who is concerned about the database at logical level, without
considering the physical implementation details is called application system analyst.
Physical Storage System Analyst Physical storage system analyst is a person who is concerned witn
the physical implementation details of the database.
DATABASE ABSTRACTION A database system provides the users only that much information that is
required by them. The complexities and details are hidden form users. This is called database
abstraction.
VARIOUS LEVESL OF DATABASE ABSTRACTION/IMPLEMENTATION
It
or
Internal Level Physical Level This is the lowest level of abstraction. It describes how the data are
actually stored on the storage media. At this level, complex, low level data structures are described
in details.
Conceptual Level It describes about the actual storage in database and relationship among existing
data. Data-structure is very important at this level.
External Level or View Level This is closest to the users. It is concerned with the way
and style
of display of data for users. The interrelationship of the three levels has been given in the following
figure:
EXTERNAL LEVEL
View1 View-2 View-3
CONCEPTUAL LEVEL
CONCEPTUAL LEVEL
DATA INDEPENDENCE The ability to modify a scheme definition in one level without affecting a
scheme definition in the higher level is called data independence.
THE RELATIONAL DATA MODEL This data model was propounded by E., F, Codd of lBM, and accepted
in DBMS technology. This model is also used in CAD and other environment.
Entity An entity is an object which can be distinctly identified. E.g. a car with no. MP-136667.
student's
Roll No. 47 are entities.
Relation A relation is a table consisting of rows and columns. The programmer views a relation
as file in database. The column's name is called attribute. A structure of
relation name Procuct hae
been shown below:
Produc Headin
t
Attribut
PID Name Company Price (in Rs.)
NO01 -POD JXD 15000.00
NO02 LAPTOP LG 28000.00
Data
Domain The domain is a set of possible values that an attribute can have.
Tuple A row in a relation is called a tuple. A tuple having a set of n numbers of attributes is
termed as n-typle. The number of tuples in a relation may vary with time because on demand of users
of some tuples can be added or deleted.
Attributes The columns of relation are generally called attributes.
Degree A relation having n attributes is said to be a relation of degree n.
Just like any other programming language, the facility of defining data of various types is available in
SQL also. Following are the most common data types of SQL.
1) NUMBER
2) CHAR
3) VARCHAR / VARCHAR2
4) DATE
5) LONG
6) RAW/LONG RAW
1. NUMBER/DECIMAL
Used to store a numeric value in a field/column. It may be decimal, integer or a real value.
General syntax is Number(n,d)
Where n specifies the number of digits and d specifies the number of digits to the right of the
decimal point.
e.g marks number(3) declares marks to be of type number with maximum value 999.
pct number(5,2) declares pct to be of type number of 5 digits with two digits to the right
of decimal point.
2. CHAR
Used to store character type data in a column. General syntax is
Char (size)
where size represents the maximum number of characters ina column. The CHAR type data can hold
at most 255 characters.
e.g name char(25) declares a data item name of type character of upto 25 size long.
3 VARCHAR/VARCHAR2
This data type is used to store variable length alphanumeric data. General syntax is
varchar(size) /varchar2(size)
where size represents the maximum number of characters in a column. The maximum allowed size
in this data type is 2000 characters.
e.g address varchar(50); address is of type varchar of upto 50 characters long.
4 DATE
Date data type is used to store dates in columns. SQL supports the various date formats other that
the standard DD-MON-YYYY.
e.g dob date; declares dob to be of type date.
5 LONG
This data type is used to store variable length strings of upto 2
GB size.
SQL Commands
CREATE TABLE Command:
Create table command is used to create a table in SQL It is a DDL type of command. The general
syntax of creating a table is
Creating Tables
The syntax for creating a table is
create table <table> (
<column 1> <data type> [not nul] [unique) [<column constraint>]
For each column, a name and a data type must be specified and the column name must be unique
within the table definition. Column definitions are separated by comma. Uppercase and lowercase
letters makes no difference in column names, the only place where upper and lower case letters
matter are strings comparisons. A not null Constraint means that the column cannot have null value
that is a value needs to be supplied for that column. The keyword unique specifies that no two tuples
can have the same attribute value for this column.
Operators in SQL:
The following are the commonly used operators in SQL
1. Arithmetic Operators
2.. Relational Operators
3. Logical Operators OR, AND, NOT
Arithmetic operators are used to perform simple arithmetic operations.
Relational Operators are used when two values are to be compared and
Logical operators are used to connect search conditions in the WHERE Clause in SQL
Constraints:
Constraints are the conditions that can be enforced on the attributes of a relation. The constraints
come in play when ever we try to insert, delete or update a record in a relation.
1. NOT NULL
2. UNIQUE
3. PRIMARY KEY
4. FOREIGN KEY
5. CHECK
6. DEFAULT
Not null ensures that we cannot leave a column as null. That is a value has to
be supplied for that
column.
e.g name varchar(25) not null:
Uniaue constraint means that the values under that column are always unique.
e.g Roll_no number(3) unique;
Primarv key constraint means that a column can not have duplicate
values and not even a null value.
Roll no number(3)
e.g. primary key;
The main difference between unique and primary key
constraint is that a column specified as unique
may have nullvalue but primary key
constraint does not allow null values in the column.
Coreign key is used to enforce referential integrity
and is declared as a primary key in some other
table.
e.g cust id varchar(5) references master(cust id):
it declarescust_id column as a foreign key that refers to cCust id feld of table master. nat mea
cannot insert that value in cust_id filed whose corresponding value is not present in cust_id neld o
master table.
Check constraint limits the values that can be inserted into a column of a table.
e.g marks number(3) check(marks>=0);
The above statement declares marks to be of type number and while inserting or updating the vaiue
in marks it is ensured that its value is always greater
than or equal to zero.
Default constraint is used to specify a default value to a column of a table automatically. This default
value will be used when user does not enter any value for that column.
e.g balance number(5) default = 0;
CREATE TABLE student
Roll_no number(3) primary key,
Name varchar(25) not null,
Class varchar(10),
Marks number(3) check(marks>0),
City varchar(25) );
Data Modifications in SQL
After a table has been created using the create table command, tuples can be inserted into the table,
or tuples can be deleted or modified.
INSERT Statement
The simplest way to insert a tuple into a table is to use the insert statement
insert into <table> [(<column i,
. . . ,
column j>)] values (<value i,
... , value j>);
INSERT INTO student VALUES(101, Rohan', XI'400,'Jammu');
While inserting the record it should be checked that the values passed are of same data types as the
one which is specified for that particular column.
For inserting a row interactively (from keyboard) & operator can be used.
e.g INSERT INTO student VALUES(&Roll_no,&Name, &Class''&Marks'' City' ): &
In the above command the values for all the columns are read from keyboard and inserted into the
table student.
NOTE:- In SQL we can repeat or re-execute the last command typed at SQL prompt by typing "/" key
and pressing enter.
Roll_no Name Class Marks City
DISTINCT keyword is used to restrict the duplicate rows from the results of a SELECT statement.
e.g. SELECT DISTINCT name FROM student;
The above command returns
Name
Rohan
Aneeta Chopra
Pawan Kumar
Adding a column
The syntax to add a column is:
ALTER TABLE
table name
ADD column name datatype;
e.g ALTER TABLE student ADD(Address
varchar(30);
The above command adda column Address to the table atudent.
If we give command
SELECT * FROM student;
Note that we have just added a column and there will be no data under this attribute. UPDATE
command can be used to supply values / data to this column.
Rernoving a column
ALTER TABLE table_name
DROP COLUMN column_name;
e.g ALTER TABLE Student
DROP COLUMN Address;
The column Address will be removed from the table student.
(a) BETWEN
(b) LIKE
(c) IN
(d) NOT
?
13. In SQL, which command(s) is/are used to change table's structure/characteristics
a
in DECIMAL(5,2)?
15. What is the maximum value that can be stored
(a) 9999.99
(b) 99.9999
(c) 99.99
(d) 9.99
MCQ
an error ?
1. Which of the following queries contains
(a) Select from emp where empid=10003;
empid=10006;
(b) Select empid from emp where
(c) Select empid from emp;
lastname= 'GUPTA;
(d) Select empid where empid=10009 and
2. A Table can have
(a) Many primary keys and many unique keys.
(b) One primary key and one unique key
(c) One primary key and many unique keys.
(d) Many primary keys and one unique key.
17. What is the correct SQLstatement to create a foreign key in the "MYOrders" table that
references the "Customers" table's primary key?
la) CREATE FOREIGN KEY (CustomerlD) REFERENCES Customers(CustomerlD);
(b) ALTER TABLE MYOrders ADD CONSTRAINT fk customer FOREIGN KEY
(CustomeriD) REFERENCES Customers(CustomerlD);
(c) ALTER TABLE MYOrders ADD FOREIGN KEY (CustomeriD) REFERENCES Customers;
(d) CREATE TABLE MYOrders ADD FOREIGN KEY CustomerlD REFERENCES Customers;
18. What does the term 'cardinality' refer to in the context of databa ses?
a
(a) The uniqueness of data in column
(b) The number of rows in a table
(c) The number of tables in a database
(d) The relationships between tables
19. What is the correct SQL syntax to return only distinct (different) values from the
"Name" column in the "Employees" table?
(a) SELECT DISTINCT Name FROM Employees;
(b) SELECT UNIQUE Name FROM Employees;
(c) SELECT DIFFERENT Name FROM Employees;
(d) SELECT Name FROM Emnployees DISTINCT;
20. To update the "Salary" column in the "Employees" table by increasing all salaries by
10%, which SQL statement is correct?
(a) UPDATE Employees SET Salary = Salary " 1.1
(b) UPDATE Employees INCREASE Salary BY 10%
(c) ALTER TABLE Employees MODIFY Salary = Salary * 1.1
(d) CHANGE Employees SET Salary = Salary + (Salary * 0.1)
Answer:
1-d 2-c, 3-b, 4-c, 5-b, 6-a, 7-d, 8-c, 9-c,10-a, 11-b, 12- a, 13- b,
14-c 15- a,
16-b, 17-b,, 18-b, 19- a, 20-a
for A
(b) Both and R are true and R is not the correct explanation
A
for A
(c) A is True but R is False
(d)A is False but R is True
explanation for A
(c) A is True but R is False
(d) A is False but R is True
fromn the primary
foreign key is an attribute whose value is derived
S.Assertion (A): A
key of another relation. relationship between tables
or
key is used to represent the
Reasoning (R): foreign
A
relations. (a)
explarnation for A
(a) Both A and R are true and is the correct
R
(b) Both and R are true and R is not the correct explanation for A
A
ib) Both A and R are true and is not the correct explanation for A (b)
R
(b) Both A and R are true and R is not the correct explanation for A (b)
(c) A is True but R is False
(d) A is False but R is True
12. Assertion (A): Where clause can also be included with Select Command
Reason (R): Where clause is used to filter the data based on given condition.
(a) Both A and R are true and R is the correct explana tion for A
(b)BothA and R are true and R is not the correct explanation for (b) A
13. Assertion (A): Prirmary key and Alternate Keys are subset of Candidate Keys
Reason (R): Primary Key should be unique and not null.
(a) Both A and R are true and R is the correct explanation forA
(b) Both and R are true and R is not the correct explanation for A b)
A
14. Assertion (A): Candidate key can be any attribute or combination of attributes
that can qualify as unique key in the database
Reason (R): There can be multiple candidate keys in a table
(a) Both A and R are true and R is the correct explanation
for A
(b) Both A and R are true and R is not the correct explanation for A (b)
(c) A is True but R is False
(d) A is False but R is True
Objectives:
1. Understand the purpose and usage of MySQL Date Functions.
2. Learn how to use Aggregate Functions in MysQL.
3. Master the use of COUNT("), Group by, Having, and Order by for querying and
manipulating data.
4. Develop problem-solving skills by answering MCQ, Level Learning, Assertion and Reasoning,
and
Case Study-based questions.
Lesson Structure:
1.
Introduction to Date Functions in MySQL - Brief overview of Date Functions and their significance.
Detailed explanation of NOw (), DATE (), MONTH (), MONTHNAME (), YEAR ), DAY (), DAYNAME (). -
*
Write a query to display
all employees' names and
MONTHNAME) Returns the full SELECT their date of joining
month name (e.g., MONTHNAME(NOW()): (month name only) from an
"May') for a date. Output: May 'Employees' table.
* Write a query to find
the
Extracts the year total number of customers
*YEAR) added each year in the
(YYYY) from a date. SELECT YEAR(NOWO): 'Customers' table (use
Output: 2024 YEAR and COUNT).
* Write a query to display
Extracts the day of allupcoming birthday
* DAY) the month (1-31) records (month and day
from a date. SELECT DAY(NOW));
only) from a 'Students'
Output: 12 table.
Returns the full *Write a query to display
DAYNAME)
weekday name SELECT all ongoing courses with
(e.g., 'Sunday') for DAYNAME(NOW): their start date (day name)
a date. Output: Sunday from a 'Courses' table.
Name of
the Explanation and use MysQL Example with
Function of the Function Output Assignment Questions
cOUNT(*) the number of non SELECT COUNT(*) FROM the number of orders
nullvalues in a customers; Output: placed in each month (use
specific column. Total number of customers COUNT and MONTH).
d) YEAR()
6. What function retrieves the fullweekday name (e.g., 'Monday')?
a) MONTH)
b)DAY()
c) DAYNAME) (Correct Answer)
d) YEAR()
7. Which aggregate function returns the highest value in a column?
o a) AVG()
b) MIN()
o c) MAX() (Correct Answer)
o d) SUM)
8. What aggregate function calculates the average of a numeric column?
a) SUM()
o b) COUNT()
c) AVG() (Correct Answer)
d) MIN)
9. Which aggregate function computes the total sum of a numeric column?
a) MIN()
b) MAX()
c) COUNT()
d) sUM) (Correct Answer)
10. What aggregate function determines the number of rows (including NULL values)?
a) AVG()
b) SUM()
o c) CUNT) (Correct Answer) (can use COUNT(*))
d) MAX()
11. The GROUP BY clause is used to:
a) Sort data in ascending or descending order
o b) Filter rows based on specific criteria
c) Group rows with matching values in one or more columns (Correct Answer)
od) Combine results from multiple tables
12. The HAVING clause is used with GROUP BY to:
a) Apply additional filtering conditions after grouping (Correct Answer)
b) Define the order in which results are retrieved
c)Specify columns to be included in the result set
d) Rename columns in the output
13. The ORDER BY clause is used to:
a) Group rows based on shared values
b) Filter rows based on specific criteria
Answer)
c) Sort data in ascending or descending order (Correct
o
d) Combine results from multiple tables
14. Which of the following is NOT a valid order in the ORDER BY clause?
o a) column_name ASC
o b)column name DESC
o c) column_name
-
o d) column_name Order by expressions are not allowed
+5(Correct Answer)
15. How can you count the number of employees in each department using GROUP BY?
o a) SELECT
COUNT() FROM employees GROUP BY department; (Correct Answer)
o b) SELECT COUNT(department) FROM employees;
c) SELECT department, COUNT(*)FROM employees;
d) SELECT * FROM employees GROUP BY department;
16. Write a query to find the average salary for each department:
17. What is the output of the following query: SELECT YEAR(CURDATE(): (Assuming today's date
is 2024-05-13)
a) 2024 (Correct Answer)
b) 12
c) Friday
d) An error
18. How can you find the number of employees in a department with a salary greater
than 50000?
a) SELECT COUNT(*) FROM employees WHERE department = 'IT'AND salary > 50000;
b) SELECT SUM(salary) FROM employees WHERE department = 'IT' AND salary > 50000;
c) SELECT MAX(salary) FROM employees WHERE department =|T' AND
salary > 50000;
d) SELECT AVG(salary) FROM employees WHERE department ='IT' AND salary > 50000;
Ans: a) SELECT COUNT(*) FROM employees WHERE department = 'IT'AND
salary > 50000;
Date Functions
Answers:
1. SELECTNOW():
2. SELECT DATE(order_date) FROM your_table;
3. SELECT MONTH(hire_date)FROM your_table;
4. SELECT MONTHNAME(birth date) FROM your table;
5. SELECT YEAR(registration _date) FROM your_table;
Aggregate Functions
6. Write a query to find the maximum value in a numeric column named 'salary'.
7. Write a query to find the minimum value in a numeric column named 'age!.
8. Write a query to calculate the average value in a numeric column named 'price'.
9. Write a query to calculate the total sum of a numeric column named 'quantity'.
10. Write a query to count the number of rows in a table named 'customers'.
Answers:
11. Write a query to display the number of orders placed in each month (grouped by month).
12. Write a query to display the total number of orders with an order amount greater than Rs.
1000 (use HAVING clause).
13. Write a query to display the product names and their average price, ordered by price in
descending orde.
14. Write a query to calculate the average age of employees in the 'employees' table (assuming
the table has a 'dob' column).
15. Write aquery to select the top 10 highest-earning employees (based on salary) from a table
named 'employees'.
Answers:
BY
11. SELECT MONTHNAME(order date), COUNT(*)AS order count FROM orders GROUP
MONTH(order_date);
12. SELECT COUNT(") AS order count FROM orders HAVING order_amount > 1000;
3. SELECT product_name, AVG(price) AS average_price FROM products GROUP BY
name
product ORDER BY average price DESC;
14. SELECT AVG(YEAR(CURDATE))- YEAR(dob) AS average_age FROM employees;
15. SELECT FROM employees ORDER BY salary DESC LIMIT 10;
Instructions: Solve the following Assertion (A) and Reasoning (R) questions. Choose the most
appropriate option.
1. Assertion (A): The DATE)function in MySQL returns the current date and time. Reasoning (R):
The NOW) function is used to retrieve the current date and
time.
Answer: (b) Both A
and R
are true, but R is not the correct explanation of A.
Explanation: The DATE) function extracts the date part from a datetime or timestamp value. The
NOW())function returns the current date and
time including timestamp.
2. Assertion (A): The MONTHNAME() function returns the abbreviated month name (e.g., Jan' for
January). Reasoning (R): The MONTH() function returns the numeric value of the month (1 for
January).
Answer: (a) Both A and R are true, and R is the correct explanation of A.
3. Assertion (A): The YEAR() function can be used to filter data for a specific year. Reasoning (R):
The
result of the YEAR() function can be used in a WHERE clause.
Answer: (a) Both A and Rare true, and R is the correct explanation of A.
4. Assertion (A): The DAYNAME() function returns the weekday name (e.g., 'Sunday'). Reasoning (R):
The DAY) function returns the numeric value of the day within the week (1 for Sunday).
Answer: (a) Both A and R are true, and R is the correct explanation of A.
5. Assertion (A): The MAX() function returns the highest value in a column.
Answer: (a) Both A and R are true, and R is the correct explanation of A.
E Assertion (A): The MIN) function can be used to find the minimum salary in an
emolovee table.
Reasoning (R): The MIN() function works with numeric data types.
Answer: (a) Both A and R are true, and R is the correct explanation of A
7. Assertion (A): The AVG) funchon calculates the average of a column's values. Reasoning (R):
Aggregate functhons are used for summarized data calculations.
8. Assertion (A): The SUM) function adds all the values in a selected column. Reasoning (R): The
SUM)function can be used for various data types like integers and decimals.
9. Assertion (A): The CoUNT(") function returns the total number of rows in a table. Reasoning (R):
The asterisk () wildcard symbol represents all columns in the table.
Answer: (a) Both A and R are true, and R is the correct explanation of A.
1Assertion(A): The GROUP BY clause is used to categorize data before applying aggregate functions.
Reasoning (R): The HAVING clause filters grouped data based on aggregate function resuits.
Answer: (a) Both A and Rare true, and R is the correct explanation of A.
11. Assertion (A): The ORDER BY clause sorts the results of a query in ascending or descending
order. Reasoning (R): The ORDER BY clause can be used with multiple columns for sorting.
Answer: (a) Both A and R are true, and R is the correct explanation of A.
12. Assertion (A): You can use aggregate functions with the SELECT clause to retrieve summarized
data.Reasoning (R): Aggregate functions perform calculations on entire columns or groups of rows.
13. Assertion (A): The HAVING clause is used after the GROUP BY clause to filter grouped data.
Reasoning (R):The HAVING clause uses conditions based on aggregate function results.
Answer: (a) Both A and R are true, and R is the correct explanation of A.
14. Assertion (A): The GROUP BY clause is used to group rows based on one or more columns.
Reason (R): The HAVING clause is used to filter grouped data based on aggregate function results.
Answer: (a) Both A and R are true, and R is the correct explanation of A.
rows in a table.
15. Assertion (A): The COUNT() function returns the total number of
are null.
Answer: (b) Both A and R are true, but R is the correct explanation of A.
CREATE TABLE CUstomers ( customer id INT PRIMARY KEY, name VARCHAR(SO), email
VARCHAR(100), registration_date DATE):
Scenario: This table stores information about customers, including their ID, name, email address,
and registration date.
Date Functions:
Aggregate Functions:
5. Write a query to find the total number of customers registered. (Use COUNT(")
6. Write a query to find the customer ID with the earliest registration date. (Use
MIN(registration date))
7. Write a query to find the average numberof days a customer has been registered (consider
today's date).
8. Write a query to find the total nufmbétof customers ragistered in each month (use
MONTH(registration_date))
iBRAR
ACC
N
Data Manipulation:
oat
9. Write a query to display the names of customørs registered in the last 30 days. 1 (Hint: Use
CURDATE() and DATE_SUB(CURDATE,. NPERVAL 30 DAY)
10. Write a query to display the customer details (ID, name, email) grouped by month of
registration.
HOTS:
11. Write a query to find the customer with the most recent registration.
12. Write a query to display the number of customers registered on each day of
the week. (Use
DAYNAME(registration_date)
13. Write a query to find the months with more than 10 customer registrations.
(Use HAVING)
14. Write a query to display the customer details sorted by registration
date (ascending).
15. Write a query to display the customer details sorted by registration
date (descending) and
then by name (ascending).
Answers:
1. SELECT NOW):
2. SELECT YEAR(registration_date), MONTH(registration_date), DAY(registration
date) FROM
customers WHERE customer_id = customer_ id;
3 SELECT MONTHNAME(registration_date) AS
month_name FROM customers;
4. SELECT DAYNAME(registration_date) AS day of week FROM CUstomers WHERE CUstomer_id
=
customer id;
5. SELECT COUNT(") AS customers FROM customers;
total
6. SELECT customer id FROM customers WHERE registration date = (SELECT
MIN(registration date) FROM customers);
7. SELECT AVG(DATEDIFF(CURDATE(), registration date) AS avg_registration_days FROM
customers;
8. SELECTMONTH(registration date) AS month, COUNT()AS customer_count FROM
customers GROUP BY MONTH(registration_date);
9. SELECT name FROM customers WHERE registration date >= DATE SUB(CURDATE(), INTERVAL
30 DAY);
10. SELECT MONTHNAME(registration date) AS month, name, email FROM customers GROU DT
MONTH(registration_date);
HOTS Answers:
11. SELECT * FROM customers WHERE registration date = (SELECT MAX(registration_date) FROM
customers);
12. SELECT DAYNAME(registration_date) AS day, cOUNT(") AS customer_count FROM customers
GROUP BY DAYNAME(registration_date);
13. SELECT MONTHNAME(registration_date) AS month, COUNT(*) AS Customer_count FROM
customers GROUP BY MONTH(registration_date) HAVING cOUNT(") > 10;
14. SELECT* FROM customers ORDER BY registration _date ASC;
15. SELECT * FROM customers ORDER BY registration date DESC, name ASC;
-
Sr. No. -2 Case Base Study
Write commands in SQL for (i) to (ii) and output for (iv) and (v)
MAX(SalesAmt)<60000;
Ans. ) SELECT Name SalesAmt FROM Store WHERE City= Mumbai;
Min(Date Open)
2015-02-06
()
Count(Storeid) NoOfEmp
1 10
11
1 5
-
Sr. No.-3 Case Base Study
Consider the following tables ACTIVITY and COACH and Write SQL commands for the statements (iO)
to (iv) and give the outputs for the SQL queries (v) to (vii)
Table - ACTIVITY
Table: COACH
PCode Name ACode
1 Ahmed Hussain 1001
2 Ranvinder 1008
3 Janila 1001
Naaz 1003
() To display the name of all activities with their Acodes in descending order.
Ans. SELECT ActivityName, Acode FROM activity ORDER BY Acode DESC;
(ü) To display sum of prizemoney for each of the number of participants groupings (as shown in
column ParticipantsNum 10,12,16)
Ans.: SELECT SUM(PrizeMoney), ParticipantsNum FROM activity GROUP BY ParticipantsNum;
(i) To display the coach's name and ACodes in acending order of ACode from the table COACH.
(iv) To display the content of the Activity table whose ScheduleDate is earlier than 01/01/2004 in
ascending order of ParticipantsNum
Ans: SELECT * FROM activity WHERE ScheduleDate<{01/01/2004) ORDER BY ParticipantsNum;
Points To Remember:
Date functions like NOW() return the current date and time, while DATE() extracts just the date part.
MONTH) gives the numeric month (1-12), MONTHNAME() spells it out (January).
YEAR) isolates the year, and DAY() and DAYNAME) handle day of month and its name.
Aggregate functions summarize data.
MAX() finds the highest value, MIN() the lowest, and AVG() calculates the average.
sUM)adds all values in a column, and COUNT() tells you how many rows exist.
COUNT() counts all rows, regardless of NULL values.
or more columns
GROUP BY: Groups rows based on shared values in one
HAVING: Filters grouped data based on a condition applied to aggregate results.
ORDER BY sorts data based on a chosen column, ascending or descending.
share information. It can be a local network within a home or office or a global or world
>Ethernet cables, often categorized as twisted-pair cables, are commonly used in local area
networks (LANS). They offer reliability and high-speed data transnission over short
distances.
Optical fiber is an advanced networking medium that uses light signals to transmit data. It
provides high bandwidth and is immune to electromagnetic interference, making it
suitable for long-distan ce communication.
Microwave communication relies on radio waves in the microwave frequency range. It is
frequently used for point-to-point links, such as connecting two buildings in a city.
Radio wave communication utilizes radio frequency waves for wireless data transmission.
This is common in Wi-Finetworks and mobile communication.
ececd
As lydog
Charge dtn ad oos h ach uher A
can be
ehargig data paclets Srlches
hadae deios ht monage phypicl
neots sotba-hased ita eices
ar
Introd.cton to
ComoLter hetwork
Anpociar is a nhot deice hat
etarsnis a caed sgnd wth
nad
baty
sal a tgreaty
bagengaohic asah
outay han a be tate
tng ah, scoc, or bióng
A group of two or more similar things or people interconnected with each other is called
network
A computer network is an
interconnection among two or more computers or computing
devices which allows computers to share data and resources among each other.
Apart from computers, networks include networking devices like switch, router, modem, etc.
Networking devices are used to connect multiple computers in different settings.
Advantages of Networks:
Enhancement of Communication and Information Availability
Convenient Sharing of Resources
Easy File/Data Sharing
Highly Flexible
Affordable
Increases Cost Efficiency
Networking Boosts Storage Capacity
Enhanced Security and Data Protection
Disadvantages of Networks:
Security vulnerabilities.
Potential for data breaches
Network congestion
Reliability issues.
Types of Networks
Various types of computer networks ranging from network of handheld devices (like mobile phones
or tablets) connected through Wi-Fi or Bluetooth within a single room to the milions of computers
Private Communication
Example: Bluetooth, Infrared
The geographicalarea covered by a LAN can range from a single room, a floor, an office having
LLN CABLE
Wi-Fi
LAN CALLE LANCALE
Connects computers and others and MANs, which are spread across different
LANS
Network Devices:
To communicate data through different transmission
media and to configure networks with different
functionality, we require different devices like Modem, Hub, Switch,
Repeater, Router, Gateway, etc.
Modem:
Stands for 'MOdulator DEMolulator'
Device used for conversion between analog signals
and digital bits.
Modems connected to both the source and destination nodes
The modem at the sender's end acts as a modulator that converts the digital data into analog signals.
The modem at the receiver's end acts as a demodulator that converts the analog signals into digital
data for the destination node.
n
Modulate Demodulate
digital signals
wwe
analog signals
Telephone
Modem Network
Modem
Ethernet Card:
Also known as Network Interface Card (NIC) is a
network Gigabit Ethernet NiC
adaptor used to set up a wired network.
Interface between computer and the network
Circuit board mounted on the motherboard of a
PCI connectian
computer
Ethernet port
Ethernet cable connects the computer to the
Tachtorsm
network through NIC.
Data transfer between 10Mbps to 1 Gbps
Each NIChas a MACaddress, which helps in uniquely identifying
the computer on the network.
Repeater Repeater
Hub
An Ethernet hub is a network device used to connect
different devicesthrough wires/cables.
Data arriving on any of the lines are sent out on all the others.
The limitation of hub is that if data from two devices come at the same time, they will collide.
Hub Data
[ETTEIIEL toall isforwarded
sentby connected
Data node nodes
one
Types of Hub:
Passive Hub: This type of does not amplify or boost the signal.It does not
manipulate or view the
traffic that crosses it.
Active Hub: It
amplifies the incoming signal before passing it to the other ports.
Switch
Like a hub, a network switch is used to connect multiple computers or communicating devices.
When data arrives, the switch extracts the destination address from the data packet and looks it up in
a table to see where to send the packet. Thus, it sends signals to only selected devices instead of
sending to all.
Can forward multiple packets at the same time.
Switch Data
onlyisforwarded
sentby destination
tothe
Data node
one node
all the other ports whereas switch keeps a record of the MAC addresses of the devices attached to it
and forwards data packets onto the ports for which it is addressed across a network. Hence, switch is
an intelligent Hub.
Router
A
network device that can receive the data, analyse it and transmit it to other networks.
as it can analyse the data being
Compared to a hub or a switch, a router has advanced capabilities
it to another network of a different
carried over a network, decide or alter how it is packaged, and send
type.
• A
router can be wired or wireless.
access to
•A wireless router can provide Wi-Fi
ROUTER smartphones and other devices.
HUB SWITCH • Wi-Fi routers perform the dual task of
a router
Sitesb
and a modem/switch.
ISP
• connects to incoming broadband Iines, from
It
PCL
to
(Internet Service Provider) and converts them
digital data for computing devices to process.
Gateway
A
gateway is a device that connects dissimilar networks (Networks with different software and
hardware configurations and with different transmission protocol).
Gateway serves as the entry and exit point of a network, as all data coming in or going out of
a
network must first pass through the gateway in order to use routing paths.
Also maintain information about the host network's internal connection paths and the
identified paths of other remote networks.
It can be implemented as software, hardware, or a combination of both because network
gateway is placed at the edge of a network and the firewall is usually integrated with it.
What is Gateway
A Gateway is a device Sorver
that acts as an entry
point botween different
Swilch /Oafooy
networks. helps
facilitate communication
and data transfer
PC2
between networks with
differont protocols,
Network Topologies
The arrangement of computers and other peripherals in a network is called its topology. The topology
as
is normally be applied in localarea network. Some common topologies are follows:
1. Bus Topology
a transmission / communication medium, known as bus
tach communicating device connects to
backbone.
Bus Topology
Advantages:
Data transmitted in both directions
Disadvantages:
Less secure
Less reliable
2. Star Topology
Each communicating device is connected to a central node, which is a networking device like a hub or
a switch.
Advantages:
Easy to install and manage.
Easy to troubleshoot
Very effective, efficient and fast HUB
Disadvantaqes:
Difficult to expand. Longer cable is required.
The cost of the hub and the longer cables makes it expensive over others.
In case hub fails, the entire network stop working.
Dependent on the central hub; if it fails, the entire network can go down.
Requires more cabling compared to some other topologies.
3. Ring Topology
In a ring topology, devices are connected in a closed loop, where data circulates in one direction.
Advantages:
Each node is connected to two other devices, one
each on
either side
Ring Topology
The link in a ring topology is unidirectional.
Equal access to the network for all devices.
4. Mesh Topology
In this type of topology each and every computer or workstation is directly connected to each other
in the network, creating redundant paths.
Advantages:
Can handle large amounts of traffic since multiple nodes can MESH TOPOLOCY
Disadvantaqes:
Wiring / Cabling is complex and cabling cost is high in creating such networks
15 Questions MLL
Ans. Advantages:
1. Sharing of resources.
2. Data protection.
3. Improved speed of communication.
Disadvantages:
Security concerns, server dependence, high setup costs, maintenance needs.
3. What is server and client?
Ans. Server is a computer or repository which facilitates networking tasks such as sharing of files,
resources and communicating among hosts (clients) in a network.
Cient is a node or workstation that requests for a service from a server. It is just like a consumer in
that network.
4. Define Communication channel?
Ans. Communication channel is a medium by which hosts in a network interact with each other hosts
and server(s).
5. Write different types of Communication channels?
Ans: Wired: When host(s) and server(s) are connected with one another through guided media. Such
as: co-axial cables, twisted paired cables, fibre optic cables.
Wireless: When host(s) and server(s) are connected with one another through unguided media. Such
as: radio wave, micro wave, satellites, infrared, Bluetooth, laser etc.
other.
7. Expand followings:a) TCP /1P b) OSI c) mbps d) Mbps
9. Define Gateway?
Ans: Gateway is a key access point that acts as a "gate" between an organisation's network and the
outside world of the Internet. Gateway serves as the entry and exit point of a network, as alldata
coming in or going out of a
network must first pass through the gateway in order to use routing
paths.
10. Write about Router in brief?
Ans: A router is a network device that can receive the data, analyse it and transmit it to other
networks. A router connects a local area network to the internet. A router can be wired or
wireless. A wireless router can provide Wi-Fi access to smartphones and other devices.
11. Arjun, a student of Class XIl, is little confused about hub and switch. Help him stating any one
advantage of switch over hub?
Ans:A hub receives data from one node/ server and sends / forwards the data to all other connected
devicesthat network. On the other hand, a switch extracts the destination address from the
in
data packet and looks it up in a table to see where to send the packet.
Thus it sends signals to only selected devices instead of sending to all. It can also forward multiple
packets at the same time.
12. Name any 04 major components of a network?
Ans: Active hub works as a repeater which amplifies signals and forward data, whereas passive sub
just forward the data without any amplification.
14. Comment the sentence as a network administrator: "By using resource sharing,
network cost
can be reduced."
Ans: In networking, resource sharing means sharing of costly resource (Hardware,
software or both)
can be implemented easily. Installation of these resources can
be in one node (server) and other
nodes (clients) can use these resources with some permissions without installation in
their
workstations.
15. Do you think, "Switch is an intelligent hub"?
Ans: Yes, a switch is an intelligent hub, because hub just
forward the data packets to all other
destinations / workstations. But switch checks IP address and sends
data to particular destination
only.
20 Questions MCQs
1. What is a stand-alone computer?
a)a computer that is not connected to a network
b) a computer that is being used as a server
2. Hub is a:
7. computer in a network that cannot be accessed outside of the local network without giving
A
Ans: a) Intranet
Ans: a) Hub
9. is a
device which seeks information on a network from server.
a) Client b) Networking c) Workstation d) Allof these
Ans: a) Client
10. Which one of the following network devices is the routing device?
Ans: b) Router
11. Which one of the following network devices is used to connect different networks?
Ans: b) Router
12. Which one of the following network devices not provides security measures to protect the
network?
a) Hub b) Router c) Gateway d) Bridge
Ans: b) Hub
13. Which one of the following network devices is the broadcast device?
Ans: a) Hub
14. Which one of the following network devices is used to create a network?
a) Hub b) Repeater c) Router d) Switch
Ans: d) Switch
15. Which one of the following network devices can work with similar networks?
Reason (R): A computer having the capabilities to serve the requests of other network nodes is a
server.
Ans: a) Both (A) and (R) are true and (R) is the correct explanation of (A)
5. Assertion (A): A router is more powerful and intelligent than hub or switch.
Reason (R): It has advance capabilities as it can analyse the data and decide the data is packed and
send to other network.
Ans:a) Both (A) and (R) are true and (R) is the correct explanation of (A)
6. Assertion (A): A repeater is a device that amplifies the data.
Reason (R): A hub isa device which is used to connect more than one device in a network.
Ans: b) Both (A) and (R) are true but (R) is not the correct explanation of (A)
7. Assertion (A): A gateway connects dissimilar networks.
Reason (R): Gateway establishes a connection between local and external networks.
Ans: a) Both (A) and (R) are true and (R) is the correct explanation of (A)
a) Google Chorome
b) Mozilla FirefoxX
c) Opera
d) MS word
a) Adobe Photoshop
b) Corel Draw
c) Apple Safari
d) MS word
13.Which of the following was the first web browser developed by the National Centre for
Supercomputing Application (NCSA)?
a) Google Chrome
b) Mosaic
c) Mozilla Firefox
d) Opera
14.Which of the following button allows to move to the next page you visited by pressing back
button?
a) Forward
b) Next
c) Advanced
d) Ahead
15.The allows to save the web browser address for future use with just a click.
a) Bookmark
b) Sync
c) Privacy and Security
d) Search
16.A is acomplete program or software that help to extend and modify the
functionality of the browser.
a)plug-in
b)Add-on
c)Extension
d) Cookies
a)Add-on
b)Plug-in
c)Browser
d)Extension
18.Which of the following is peace of information stored in a form of a text file and that helps in
customizing the displayed information, login, showing data based on user's interests from the
web site?
a) Extension
b) Cookies
c) Login
d) Session
a) Passwords
b) Payment methods
c) Addresses
d) All of these
Ans. A web browser is a software application used to retrieve data from webpages, whereas, Search
Engine is kind of a website where a user can search for information and the results based on the
same are displayed on the screen.
Ans. Given below are the examples of the most commonly used web browsers:
Google Chrome
Internet Explorer
Mozilla Firefox
Opera
There were web browsers like Netscape Navigator and WorldWideWeb, which were used before the
above-mentioned browsers.
Q6. When was the first web browser released?
Ans. The first web browser which gained public attention was the WorldWideWeb, which was
launched in 1990.
a7. Ruhaniwants to edit some privacy settings of her browser. How can she accomplish her task?
Ans. Steps to edit privacy settings of browser (Mozilla Fire fox)
1. Open Mozilla Firefox and click on menu button(right top corner of window)
2. Click on Options.
2. Click on Settings.
4. Click on Plugins.
Web browser -A browser, short for web browser, is the software application that is used to search
for, reach and explore websites. The primary function of a web browser is to render HTML code (the
code used to design or "mark up" webpages). Each time a web browser loads a web page received
from web server, it processes the HTML, which may include text, links, and references to images and
other items, such as cascading style sheets and JavaScript functions. The browser processes these
items, then renders them in the browser window.
Commonly Used web browsers -
Google Chrome Google Inc. has developed google chrome web browser. It is an open and free
source. It runs on different operating systems, like Microsoft Windows, Mac OS X, Chrome OS, Linux,
Android and iOS. It was launched in 2008 and since then it has become the most popular web
browser in the world market. Google Chrome is very strong in its application performance and
JavaScript processing speeds. It allows users to create local desktop shortcuts which will open the
desired web page quickly and easily.
Mozilla Firefox This web browser is free and open, developed by the Mozilla Corporation and the
Mozilla Foundation in 2002. It works on Microsoft Windows, Mac OS and Linux operating systems.
Firefox features a pop-up blocker, antiphishing and anti-malware warnings, making it easy to validate
a website before we enter.
Apple Safari This web browser is free and closed source, developed by Apple Inc. It works on OS X,
iOS, and Microsoft Windows operating systems. Its market launch in 2003. Works on webkit to
render graphics and run javasript Safari is faster and more energy efficient than other browsers
Internet Explorer This web browser was developed by Microsoft Corporation, integrated into the
Microsoft Windows operating system in al its versions, It was launched in 1995 and was the most
poDular web browser until it was moved by Google Chrome in 2011.It supports ad ons, improved
security and power saving features.
Opera Opera is a web browser developed by the company Opera Software. It is compatibie Witn
Microsoft WindowS and Mac OS X operating systems mainly.
Although it also works, in oide
versions, on Linux. It was launched in 1995. It provide integrated adblocker,faster with opera
turbo,sidebar extension for multitask
Web Browser Settings
• Home Panel: This panel contains
options to set the home page of the browser, browser window
and tab settings.
• Search Panel: This panel contains
options to edit the settings of the search engine used by Firerox.
• Privacy and Security Panel: This panel
contains options to secure the browser and data. It includes
the following: enhanced tracking protection forms and passwords ) history and address bar
cookies and site data permission to view pop ups windows and
install addons
•Sync Panel: This panel contains options to set up and manage a Firefox account which is needed to
access allservices given by Mozilla. Make the desired
settings and close the browser settingS
window. The changes made in the browser settings will
be applied
Add-ons/Extensions :Add-ons are tools which integrate into our browser. They're similar to
regular
apps or programs, but only run when the browser runs. Addons can allow
the viewing of certain
types of Web content, such as Microsoft's Silverlight necessary for Netflix movies. How Add-ons Are
-
Installed There are two key ways in which add-ons become installed through an external installer
and through the browser's own add-on service. The add-on service is the most reliable way of
installing an add-on, with the browser service providing a relative "vetting" process for the general
safety of the add-on. Outside programs can also install add-ons in web browser as part of its
separate installation process. Microsoft Office, for example, may place an add-on which speeds up
the in browser opening of office documents.
There are two key ways in which add-ons become installed - through an external installer and
through the browser's own add-on service. The add-on service is the most reliable way of installing
an add-on, with the browser service providing a relative "vetting" process for
the general safety of
the addon. Outside programs can also install add-ons in wer browser as part of its separate
installation process. Microsoft Office, for example, may place an add-on which speeds up the in
browser opening of office documents.
Add-ons manager in
•Google chrome - /more tools,/extensions
• Mozilla firefox -/add-ons option or ctrl+shift+A
• Internet explorer - /tools/manage add-ons
• Opera - https://addons.opera.com/en/extensions/
A plugin is a piece of software that acts as an add-on to a web browser and gives the browser
additional functionality. Plugins can allow a web browser to display additional content it was not
originally designed to display. An example of a plugin is the free Macromedia Flash Player, a plugin
that allows the web browser to display animations using the Flash format. Most plugins are available
as free downloads. To install the plugin, we visit the website of the plugin's developer and click on a
link that willdownload the installer for the plugin we have selected. we can save the installer to an
easy to find location such as the Desktop or a specific folder we have created to organize all of our
downloads. Once we have downloaded the installer, we can open it and follow the prompts to install
the plugin on our system.
Difference between add ons and plugins: Plug-in is a complete program and add-on is not a program.
For example Flash is a plug-in made by adobe is required to play a video in flash player. Also Java is a
plug-in made by Sun Microsystem which is used to run programs based on Java. Plugin is not
bounded for browsers only. Flash can be installed in computers to play flash files. Similarly Java can
be installed to run Java files. On the other hand add-on is not a complete program. It is used to add a
particular functionality to a browser. If we suppose to install add-on on other work environment, say.
wer operating system, we can't do it. It means, add-ons are limited to a certain boundary.
Cookies - are small bits of data stored as text files ona browser. Websites use those small bits of data
to keep track of users and enable user-specific What's in a Cookie? Each cookie is effectively a small
Iookup table containing pairs of (key, data) values.
Once the cookie has been read by the code on
Server orclient computer, the data can be retrieved the
and used to customise the web page
appropriately. features. Suppose we want to have a counter
for a webpage to access it three times
Only,thisvalue can be stored over userscomputer at
first attempt it will be 1 then 2 and then 3 on
next time server willnot allow to access page.
that
When are Cookies Created? Writing data to a cookie is
usually done when a new webpage is loaded
with code to create cookies. Why are Cookies Used?
Cookies are a easiest way tocarry information
from one session on a website to another, or between
sessions on related websites, without having
to burden a server machine with massive amounts of
data storage. Storing the data on the server
without using cookies would also be problematic because it would
be difficult to retrieve a particular
user's information without requiring a login on
each visit to the website.
The time of expiry of a cookie can be set through
using server site scripting language ,when
Cookie is created. By default the cookie is destroye d the
when the current browser window isclosed, but
it can be made to persist for an arbitrary length
of time after that.
Cookies are not a threat to privacy, since they can only
be used to store information that the user
has volunteered or that the web server already
has.
Some commercial websites may include embedded advertising
material which is served from a third
party sites, and it is possible to store a cookie for that third-party
site, containing information fed to
it from the containing site- such information might include
the name of the site, particular products
being viewed etc.Then third party can advertise you in future with
the help of tracking cookies. Are
Cookies Enabled in my Browser? When a webpage with
cookies is opened a popup appears to
enable cookies ,if browser setting is disabled for cookies. We can also check it
through browsers
setting options
Assertion Reasoning
-
1.Assertion (A): Cookies are plain text files.
Reasoning (R): - Cookies are not automatically created.
2.Assertion(A): Incognito browsing opens up a versionof the browser that willtrack your activity
Reasoning(R): Incognito browsing is useful when entering sensitive data
3.Assertion (A): Cookies are a type of malicious software used to hack websites.
Doason (R):Cookies are small pieces of data stored on a user's computer by websites for
various
purposes.
5.Assertion(A)Cookies received from various websites are stored by web browser.
Reasoning(R)A web browser is the same thing as a search engine.
6. Assertion (A): Cookies are small text files, stored locally by the client's web browser to remember
the "name-value pair" that identifies the client.
Reason (R): Cookies are primarily used to track users' physical locations
7. Assertion (A): A web browser acts as an interface between a user and the World Wide Web.
Reason (R): A user can navigate files, folders, and websites using links on the web pages created
with HTML.
8.Assertion(A): A plugin is a piece of software that acts as an add-on to a web browser and gives the
browser additional functionality.
Reasoning(R): Plugin is not bounded for browsers only.
9.Assertion(A): add-on is not a complete program.
Reasoning(R) :It is used to add a particular functionality to a browser.
10.Assertion(A): Cookies are not a threat to privacy.
Reasoning(R): Cookies can only be used to store information that the user has volunteered or that
the web server already has.
DATA PROTECTION: Data protection is the process of protecting sensitive information from damage,
loss, or corruption. The terms Data protection and Data privacy are often used interchangeably, but
there is an important difference between the two. Data privacy defines who has access to data, while
data protection provides tools and policies to actually restrict access to the data.
Data protection principles help protect data and make it available under any circumstances. It covers
operationaldata backup and business continuity/disaster recovery (BCDR) and involves implementing
aspects of data management and data availability.
How can we protect our Data Online:
1) Create strong passwords
2) Don't overshare on social media
3) Use free wi-fi with caution
4) Watch out for links and attachments
The cost factor is also involved with the creation or production of information. This type of
information is property of creator/producer or called intellectual property(1P).
The creator/producer of the information is the real owner of the information. And the owner has
every right to protect his/her intellectual property.
Intellectual property rights (IPR) are the rights of the owner of Information to decide how much
information is to be exchanged, shared or distributed. Also it gives the owner a right to decide the
price for doing (exchanging sharing/distributing) so.
Toprotect one's intellectual property rights one can get information copyrighted or patented or use
trademarks.
1) Copyright: A copyright is a collection of rights automatically inherit to someone who has
created an original work. The copyright owner has the authority to keep or to transfer the
rights to use/distribute, individually to one or more people, or to transfer them collectively to
one or more people.
When someone uses a copyrighted material without permission, it is called copyright infringement.
2) patent: A patent is a grant of exclusive right to the inventor by the government. Patents give
the holder a right to exclude others from making, selling, using or importing a particular
product or service.
3) Trademark: A trademark is a word,phrase, symbol, sound, colour and/or design that identifies
and distinguishes the products and goods of one party from those of others.
PLAGIARISM:
Plagiarism is stealing someone else's intellectual work (can be an idea, literary work or academic work
etc.) and representing it as your own work without giving credit to creator or without citing the source
of information.
Any of the following acts would be termed as Plagiarism:
Using some other author's work without giving credit to the author.
Using someone else's work in incorrect form than intended originally by the author/creator.
Licenses are the permissions given to use a product or someone's creation by the copyright holder.
cOPYRIGHT:
A copyright is a legal term to describe the rights of the creator of an original creative work such as a
literary work, an artistic work, a design, song, movie or software etc.
It is a software that can be classified as both free software and open-source software .That is ,anyone is
treely licensed to use ,copy, study, and change the software in any way and the source code is openly
shared so that people are encouraged to voluntarily improve the design of the software.
CYBER CRIME:
Criminal activities or offences carried out in a digital environment can be considered as an cyber-crime.
In such crimes, either the computer/digital device itself is the target or the computer/digital device is
country, with the intent to directly or indirectly cause physical harm, financial loss or mental
harassment. A cyber-criminal attack a computer or a network to reach other computers in order to
disable or damage data or services.
a cybercriminal may spread viruses and other malwares in order to steal private and confidential data for
HACKING: Hacking is the act of unauthorized access to a computer, computer network or any digital
system. Hackers usually have technical expertise of the hardware and software.
Hacking, when done with a positive intent is called ETHICAL HACKING. Such ethical hackers are known as
WHITE HAT HACKERS. They are specialists in exploring any vulnerability or loophole during testing of
the software. Thus, they help in improving the security of a software. An ethical hacker may exploit a
website in order to discover its security loopholes or vulnerabilities. He then reports his findings to
the website owner. Thus, ethical hacking is actually preparing the owner against any cyber-attack.
A NON-ETHICAL HACKER is the one who tries to gain unauthorized access to computers or networks
in order to steal sensitive data with the intent to damage or bring down systems. They are called BLACK
HAT HACKERS, OR CRACKERS. Their primary focus is on security cracking and data stealing.
or e-mails that
PHISHING AND FRAUD E-MAILS: Phishing is an unlawful activity where fake websites
presumes it to be from an authentic source. So you might get an e-mail from an address that looks
if you look carefully
similar to your bank or educational institution, asking for your information, but
you will see their URL address is fake. They will often use logos of the original website, making them
difficult to recognize ifit is real or fake. Fraud phone calls or text messages are also common these
days.
IDENTITY THEFT: ldentity thieves increasingly use personal information stolen from computers or
computer networks, to commit fraud by using the data gained unlawfuly. A user's identifiable
personal data like demographic details, e-mail ld, banking credentials, passport, PAN, Aadhaar number
and various such personal data are stolen and misused by the hacker on behalf of the victim.
FINANCIAL IDENTITY THEFT: When the stolen identity is used for financial gain.
CRIMINAL IDENTITY THEFT: Criminals use a victim's stolen identity to avoid detection of their true
identity.
MEDICAL IDENTITY THEFT: Criminals can seek medical drugs or treatment using a stolen identity.
RANSOMWARE: This is another kind of cybercrime where the attacker gains access to the computer
and blocks the user from_accessing, usually by encrypting the data. The attacker blackmails the victim
to pay for getting access to the data or sometimes threaten to publish personal and sensitive
information or photographs unless a ransom is paid.
Ransomware can get downloaded when the user visit any malicious or unsecure websites or download
software from doubtful repositories. Some ransomware are sent as an e-mail attachments in spam
mails. It can also reach our system when we click on a malicious advertisement on the Internet.
CYBER BULLYING: Cyberbullying or bullying
that takes place over digital devices like cell phones.
computers and tablets.Cyberbullying can occur through SMS, text and apps or online in social media.
forums or gaming where people can view, participate or share content.
Cyberbullying includes sending, posting or sharing negative, harmful, false or mean content
about
someone else. It can include sharing personal or private information someone about else causing
embarrassment or humiliation. Some cyberbullying crosses the line into unlawfulor criminal behavior.
Social media such as Facebook Instagram, Snapchat The most common
places where cyberbullying
OcCurS.
CYBER LAW: These are the laws that apply to the Internet and Internet related technologies.
Cyber
law is one of the newest areas_of the legal system. This is because Internet
technology develops at a
ranid pace.Cyber law provides legal protecthons to people using the Internet. This
includes both
businesses and everyday, citizens. Understanding cyber law is of the utmost importance to anyone
wha uses the Internet.Cyber law has also been referred to as the "law of the lnternet
Importance of Cyber law:
It covers all transactions over Internet.
It keeps eyes on all activities over Internet.
It touches every action and every reaction in cyberspace.
With an increase in the dependency on the use of technologV. the need for cyber law was necessary.
Much like every coin has two sides, therefore, the dependency on technology has its pros and cons.
The rise of the 21" century marked the evolution of cyberlaw in India with the lnformation Technology
Act, 2000 (popularly known as IT Act).
With the growth of Internet, many cases of cybercrimes, frauds, cyber-attacks and cyber bullying are
reported. The nature of fraudulent activities and crimes keeps changing. To deal with such menace,
many countries have come up with legal measures for protection of sensitive personal data and to
MLL QUESTION
Active Protection
Use Anti-Virus and Anti-Spyware software.
restricts one or more rights to copy, distribute and make derivative works of the software.
SHAREWARE is usually offered as a trial version with certain features only available after the license is
purchased, or as a full version, but for a trial period. Once the trial period has passed, the program
may stop running untila license is purchased. Shareware is often offered without support, updates,
or help menus, which only become available with the purchase of a license. The words "free trial" or
legal entity status, violating its owner's right is a legally punishable offence.
Q.8What can be done to reduce the risk of identity theft? Write any two ways.
Ans: (i) Use unique ids to Protect your devices and accounts.
(ü) Using bio-metric protection
Q.9: Write names of any two common types of Intellectual Property Rights which are protected by the
law.
ANS
Who am 1?
ANS: Cookies.
information.
Q.15: Describe the Phishing security issue and suggest a way of protecting against it.
Ans: In phishing ,creator sends legitimate looking(fake) email in the hope of gaining personal
/financial
Method of protection:
ISPs can filter/block out phishing emails.
User should be aware of opening link of emails.
Question MLL
exposure to blue light can disrupt sleep patterns and cause eye strain.
Q:2 How does eXcessive screen time affect mental health?
A:Excessive screen time can contribute to anxiety, depression, and social isolation, especially in
mental health.
O:5 How does electromagnetic radiation from devices affect health?
A- While research is ongoing, some studies suggest that long-term exposure to electromagnetic
radiation from devices like cell phones may increase the risk of certain health issues, thougn more
evidence is needed.
Q:6 Can technology affect physical fitness?
A:Yes, excessive screen time can lead to a sedentary lifestyle, which is linked to various health
problems like obesity, cardiovascular issues, and muscle weakness.
Q:7 How can one mitigate the negative health effects of technology usage?
A:Setting limits on screen time, practicing digital detox, incorporating physical activity, and
maintaininga balanced lifestyle can help mitigate the negative health effects of technology usage.
Q:8 What is blue light?
A:High-energy visible light emitted by screens, which can disrupt sleep and cause eye strain.
Q:9 Can excessive screen time imnpact mental health?
A: Yes,
contributing to anxiety, depression, and social isolation.
Q:10 How can one reduce strain from technology usage?
A: Adjust brightness, take breaks, and maintain good posture.
Q:11 Does technology addiction affect well-being?
A: Yes, leading to sleep issues, productivity problems, and mental health challenges.
Q:12 Can electromagnetic radiation from devices pose health risks?
A: Studies suggest potential risks, but more research is needed.
Q:13 How does technology affect physical fitness?
A: Excessive screen time can lead to a sedentary lifestyle, impacting fitness negatively.
Q:14What can one do to minimize health risks from technology?
A:Set screen time limits, practice digital detox, and stay active.
() Both (A) and (R) are true and (R) is the correct explanation for (A).
() Both (A) and (R) are true and (R) is not the correct explanation for (A).
(1) (A)is true and (R) is false.
Q. 1.
Act, 1980, anyone causing the pollution will
Assertion (A): According to Environmental Protection
pay for the damage caused.
(DIT) issued a comprehensive technical guide
Reason (R): The Department of Information Technology
on "Environmental Management for Information Technology Industry in India."
Q.3
Assertion: Sedentary behavior associated with technology use contributes to obesity.
Reasoning: Engaging in prolonged sitting or lying down while using technology reduces physical
activity levels, which can lead to weight gain and an increased risk of obesity.
Ans. Option (i) is correct.
Q.4
Assertion: Excessive use of smartphones can cause sleep disturbances.
Reasoning: The blue light emitted by smartphone screens can interfere with the production of
melatonin, a hormone that regulates sleep, leading to difficulty falling asleep and disrupted sleep
patterns.
Ans. Option (i) is correct.
Q.5
Assertion: Text neck is a health issue caused by the use of mobile devices.
Reasoning: Holding mobile devices at a downward angle for extended periods puts strain on the
neck and upper spine, leading to pain, muscle imbalances, and postural issues.
Ans. Option (i) is correct.
Q.6
Assertion: The overuse of social media can't negatively impact nental health.
Reasoning: Constant exposure to curated and idealized represerntations of others' lives on social
media platforms can contribute to feelings of inadequacy, anxiety, depression, and social isolation.
Ans. Option (iv) is correct.
Q.7
Q.8
Assertion: Prolonged use of handheld devices can lead to repetitive strain injuries.
Reasoning: The repetitive motions involved in typing, swiping, and scrolling on handheld devices can
strain the muscles, tendons, and nerves in the hands, wrists, and fingers, leading to conditions like
carpal tunnel syndrome.
Ans. Option (i) is correct.
Q.9
Q.10
Assertion: The use of headphones or earphones at high volumes can't cause hearing loss.
Reasoning: Listening to music or other audio content at high volumes through
headphones or
earphones can damage the delicate structures in the ears, leading to permanent hearing loss or
tinnitus.
Ans. Option (iv) is correct.
Q.11
Assertion: Blue light emitted by screens can disrupt the circadian rhythm.
Reasoning:Exposure to blue light, especially in the evening and nighttime hours, can suppress
the
production of melatonin, disrupt the body's internal clock, and interfere with
sleep quality and
overall circadian rhythm.
Ans.Option (i) is correct.
Q.12
Assertion: Excessive use of social media can contribute to feelings of low self-esteem and body
image dissatisfaction.
Reasoning:The anonymous and pervasive nature of cyberbullying, facilitated by technology, can
result in emotional distress, anxiety, depression, and even suicidal thoughts or behaviors among the
victims.
Ans. Option (ii) is correct.
Q.13
Q.14
Assertion: Excessive use of smartphones can lead to decreased attention span.
Reasoning: Constant exposure to notifications, multitasking, and frequent switching between apps
and tasks on smartphones can contribute to a decrease in sustained attention and difficulty focusing
on one task for an extended period.
Ans. Option (i) is correct.
Q.15
MCQs
1. When a person can't find a balance between their time online and their time offline is a
condition called as
A. Net Neutrality.
B. Internet Addiction Disorder
C. Hacking
D. Echo Chamber
2. Which of the following is not a health concern in usage of technology.
a) Smartphones
b) Computers
c) Internet
d) FM Radio
4. With the outset of Covid-19 schools started Vonline classes but due to continuous online classes
students health issues also started. Health practitioner advised the parents to followa few health
tips. Which of the following health tips should not be suggested?
(A) The sitting posture should be correct.
(B) Breaks should be taken in between the online classes.
(C)To protect the eyes the gadgets be placed above eye level.
(D) Wash the eyes regularly
5. Which of the following health concerns is associated with excessive use of smartphones?
A) Digital eye strain
B) Increased attention span
c) Improved posture
D) Reduced risk of obesity
Answer:
A) Digital eye strain
Explanation:
Excessive use of smartphones, especially for prolonged periods, can lead to digital eye strain. Staring
at screens for extended periods can cause eye discomfort, dryness, blurred vision, and headaches
due to reduced blinking and increased exposure to blue light. Therefore, option A is the correct
answer.
It's important to note that while technology has numerous benefits, it is crucial to be aware of the
potential health concerns and take appropriate measures to mitigate them, such as practicing
healthy screen habits, ensuring ergonomic setups, and taking regular breaks from technology use.
6. Which of the following health concerns is commonly associated with excessive screen time?
a) Carpal tunnel syndrome
b) Sleep disturbances
c) Asthma
d) Vitamin D deficiency
7. Which of the following is a potential health concern associated with prolonged smartphone
usage?
a) Hearing loss
b) Migraine headaches
c) Osteoporosis
d) Hypertension
8. Which of the folowing is a potential risk of improper ergonomic setup while using computers?
a) Seasonal allergies
b)Skin rashes
c) Eye strain
d) Diabetes
9. Which of the following health concerns is associated with excessive use of headphones or
earphones?
a) Tinnitus
b) Cataracts
c) Gout
d) Allergic reactions
10. Which of the following is a potential health concern related to sedentary behavior associated
with technology use?
a) Iron deficiency anemia
b) Motion sickness
c) Varicose veins
d) Motion sensor synd rome
11.Which of the following health concerns is NOT commonly associated with excessive technology
use?
A. Eye strain
B. Neck and back pain
C. Anxiety and depression
D, Improved physical fitness
Answer:
D.
Improved physical fitness
12. Excessive use of smartphones and tablets can lead to which of the following health problems?
A) Improved posture
B) Reduced neck and shoulder pain
c) Decreased risk of carpal tunnel syndrome
D) Neck and shoulder pain
Answer: D) Neck and shoulder pain
13. Which of these mental health concerns has research linked to excessive social media use?
A) Increased self-esteem
B) Reduced anxiety
C) Improved mood
D) Depression
Answer: D) Depression
14. Which of the following is NOT a potential health benefit of using itness tracking devices?
A) Increased physical activity
B) Improved sleep quality
C) Better time management
D) Decreased motivation to exercise
Answer: D) Decreased motivation to exercise
15.Prolonged sitting while using technology can increase the risk of developing which of these
health conditions?
A) Improved cardiovascular health
B) Reduced risk of obesity
C) Decreased risk of type 2 diabetes
D)Sedentary behavior-related health issues
Answer: D) Sedentary behavior-related health issues
16. Which of the following isa common side effect of prolonged use of smartphones and tablets?
A) Improved hand-eye coordination
B) Reduced neck and shoulder strain
C) Decreased risk of headaches
D) Neck and shoulder pain
Answer: D) Neck and shoulder pain
17. Excessive use of social media has been linked to an increased risk of which mental health
condition?
A) Improved self-esteem
B) Reduced stress levels
c) Increased socialconnection
D) Anxiety and depression
Answer: D) Anxiety and depression
18 The blue lght emitted by digtal screens can have which efect on the body's natural sleep-wake
Cyclet
A) improves sleep quality
B)tncreases melatoninproduction
Disrupts the circadian rhythm
D)Enhances daytime alertness
Answer: ) Disrupts the circadian thythmn
19, Which of the following health benefits is NOT typically associated with
the use of fitness tracking
devices?
A) Increased physical activity
B) Improved sleep quality
) Better time management
D) Reduced motivation to exercise
Answer: D) Reduced motivation to exercise
20.Prolonged sitting and sedentary behavior due to technology use can
increase the risk of
developing which of these health conditions?
A) lmproved cardiovascular health
B) Reduced risk of type 2 diabetes
C) Decreased risk of obesity
D)Sedentary behavior-related health issues
Answer: D)Sedentary behavior-related health issues
ideation, particularly teenagers. Researchers make that correlation by highlighting how platforms
in
like Facebook, Instagram and Twitter place higher social pressures on young people and adults that
can lead to instances of cyberbullying, increased need for approval and general feelings of discontent.
2.Sleep disturbances : The use of technology before bedtime can disrupt sleep patterns. The blue light
emitted by screens can interfere with the production of melatonin, a hormone that regulates sleep.
This can result in difficulties falling asleep, reduced sleep quality, and daytime drowsiness. Establishing
a technology-free bedtime routine and limiting screen time before sleep can help promote better
sleep.
3. Sedentary lifestyle: Engaging in prolonged screen time often involves sitting or lying down for
extended periods, leading to a sedentary lifestyle. Lack of physical activity can increase the risk of
obesity, cardiovascular diseases, and other health problems. It is important to balance screen time
with regular physical activity, such as exercise or outdoor activities.
4. Digital eye strain: Staring at screens for long durations can cause digital eye strain, also known as
computer vision syndrome. Symptoms may include eye fatigue, dryness, irritation, blurred vision, and
neadaches. To reduce the risk, it is recommended to follow the 20-20-20 rule: every 20 minutes, look
away from the screen and focus on an object at least 20feet away for 20 seconds.
6. Repetitive strain injuries: Repetitive motions associated with technology use, such as typing or using
a mouse, can lead to repetitive strain injuries (RSIs) like carpal tunnel syndrome. It is essential to
practice proper ergonomics, use ergonomic accessories, and take regular breaks to prevent these
injuries.
7. Hearing problems: Listening to music or audio content at high volumes through headphones or
earphones can lead to hearing loss or tinnitus. It is advisable to keep the volume at a safe level and
take breaks from using headphones or earphones to protect hearing health.
These health concerns highlight the importanc of maintaining a balanced approach to technology
usage and adopting healthy habits tomitigatè the potential risks associated with excessive screen time
Here's some more information about health concerns réated to the usage of technology:
1. Blue light exposure: Screens emit blue lightwhich an affect sleep patterns and disrupt the body's
circadian rhythm. Exposure to blue light in the evening and nighttime hours can suppress the
production of melatonin, making it harder to fall asleep and negatively impacting sleep quality. Some
devices now offer features like night mode or blue light filters to reduce the amount of blue light
emitted.
2.Cyberbulying: The rise of technology and social media has also led to an increase in cyberbulying.
Cyberbulying involves the use of technology to harass, intimidate, or humiliate others. It can have
severe psychological consequences on victims, including anxiety, depression, and even suicidal
thoughts or behaviors. It is important to promote safe and respectful online behavior and educate
individuals about cyberbullying prevention and intervention.
3. Digital addiction: Excessive use of technology, especially smartphones and social media, can
lead to
digital addiction. People may experience a compulsive need to constantly check their devices,
leading
to neglect of personal relationships, reduced productivity, social isolation,
and anxiety. Developing
healthy digital habits, setting boundaries, and taking regular breaks from
technology can help prevent
digital addiction.
4. Electromagnetic radiation: Some individuals express concerns about the potential health effects ot
electromagnetic radiation emitted by devices such as smartphones and Wi-Fi routers. Hovwevet, the
scientific consensus is that the levels of electromagnetic radiation emitted by these devices are
generally considered safe and do not pose significant health risks. Regulatory bodies establish safety
guidelines and standards to ensure the safety of technology devices.
5. Gaming-related disorders: Excessive gaming can lead to gaming-related disorders, such as gamin8
addiction or Internet Gaming Disorder (IGD). Individuals with gaming disorders may experience
impaired control over gaming, prioritizing gaming over other activities or responsibilities, continued
gaming despite negative consequences, and withdrawal symptoms when not gaming. Treatment
options and interventions are available for individuals struggling with gaming-related disorders.
6. Privacy and data security: The use of technology often involves sharing personal information and
data online. Privacy breaches and data security issues can have signiicant consequences for
individuals, including identity theft and unauthorized access to personal information. t is crucial to be
vigilant about privacy settings, use strong passwords, and be cautious when sharing personal
information online.
These additional health concerns highlight the need for responsible technology usage, digital well
being, and maintaining a healthy balance between technology and other aspects of life. It is important
to stay informed, practice good digital habits, and seek support or professional help when needed.