Complete revision of Class XI database concepts and SQL commands – click a topic below to jump to its notes
Database: An organized collection of interrelated data.
DBMS (Database Management System): Software to create, manage, and manipulate databases (e.g., MySQL, Oracle).
RDBMS: Relational DBMS stores data in tables (relations) linked by keys.
SQL (Structured Query Language): Standard language for communicating with RDBMS. Used to define, manipulate, and query data.
Key terms: Table/Relation, Row/Tuple, Column/Attribute, Degree (no. of columns), Cardinality (no. of rows).
डेटाबेस: आपस में जुड़े डेटा का संगठित संग्रह।
DBMS: डेटाबेस बनाने, प्रबंधित करने और उसमें हेरफेर करने का सॉफ्टवेयर।
RDBMS: रिलेशनल डीबीएमएस, डेटा को तालिकाओं (tables) में रखता है जो कुंजियों (keys) से जुड़ी होती हैं।
SQL: आरडीबीएमएस से बात करने की मानक भाषा।
प्रमुख शब्द: टेबल/रिलेशन, पंक्ति/टपल, कॉलम/विशेषता, डिग्री (कॉलमों की संख्या), कार्डिनालिटी (पंक्तियों की संख्या)।
Common SQL data types used in Class XI:
CREATE TABLE defines a new table with column names, data types, and constraints.
CREATE TABLE कमांड नई टेबल बनाती है, जिसमें कॉलम, उनके प्रकार और प्रतिबंध (constraints) दिए जाते हैं।
CREATE TABLE Student (
RollNo INT PRIMARY KEY,
Name VARCHAR(30) NOT NULL,
Class CHAR(2) DEFAULT 'XI',
DOB DATE,
City VARCHAR(20),
Marks DECIMAL(5,2) CHECK(Marks >= 0)
);
Explanation: PRIMARY KEY makes RollNo unique and not null. CHECK ensures marks are not negative.
व्याख्या: PRIMARY KEY RollNo को अद्वितीय और शून्य नहीं बनाता। CHECK यह सुनिश्चित करता है कि अंक ऋणात्मक न हों।
↑ Back to TopALTER TABLE is used to add, modify, or delete columns and constraints in an existing table.
मौजूदा टेबल में कॉलम जोड़ने, बदलने या हटाने के लिए ALTER TABLE का उपयोग करते हैं।
-- Add a new column ALTER TABLE Student ADD (Email VARCHAR(50)); -- Modify a column's datatype ALTER TABLE Student MODIFY Name VARCHAR(40); -- Drop a column ALTER TABLE Student DROP COLUMN Email;
DROP TABLE permanently removes the table structure and all its data.
TRUNCATE deletes all rows but keeps the table structure (faster, can't be rolled back in some DBs).
DROP TABLE तालिका और उसके सारे डेटा को स्थायी रूप से मिटा देता है।
TRUNCATE सभी पंक्तियाँ हटाता है पर तालिका का ढाँचा बना रहता है।
DROP TABLE Student; TRUNCATE TABLE Student;
INSERT INTO adds new rows to a table. You can specify columns or rely on their order.
टेबल में नई पंक्तियाँ जोड़ने के लिए। कॉलम नाम देकर या क्रम से सभी के लिए मान दे सकते हैं।
-- Specifying columns INSERT INTO Student (RollNo, Name, Class) VALUES (1, 'Ankit', 'XI'); -- All columns in order INSERT INTO Student VALUES (2, 'Priya', 'XI', '2007-05-12', 'DEL', 92.5);
UPDATE modifies existing rows. DELETE removes rows. Always use WHERE clause carefully!
UPDATE मौजूदा डेटा को बदलता है। DELETE पंक्तियाँ हटाता है। बिना WHERE के सारी पंक्तियाँ प्रभावित होंगी।
-- Increase marks of students from Delhi UPDATE Student SET Marks = Marks + 5 WHERE City = 'DEL'; -- Delete a particular student DELETE FROM Student WHERE RollNo = 10;
The most important SQL command. Retrieves data from one or more tables. Syntax:
SELECT [DISTINCT] column1, column2... FROM table [WHERE condition] [ORDER BY ...];
सबसे महत्वपूर्ण SQL कमांड। टेबल से डेटा निकालने के लिए। ऊपर सिंटैक्स देखें।
-- Select all columns SELECT * FROM Student; -- Selected columns with alias SELECT Name, Marks*100 AS Percentage FROM Student; -- Distinct cities SELECT DISTINCT City FROM Student;
Filters rows using conditions. Operators: =, <>, <, >, <=, >=, BETWEEN, IN, LIKE, IS NULL, AND, OR, NOT.
शर्त के अनुसार पंक्तियाँ छाँटता है। ऊपर दिए गए ऑपरेटरों का उपयोग होता है।
-- Marks between 70 and 90
SELECT * FROM Student WHERE Marks BETWEEN 70 AND 90;
-- City is either DEL or MUM
SELECT * FROM Student WHERE City IN ('DEL','MUM');
-- Name starts with 'A'
SELECT * FROM Student WHERE Name LIKE 'A%';
-- Marks is NULL
SELECT * FROM Student WHERE Marks IS NULL;
ORDER BY sorts the result set. Default ascending (ASC), DESC for descending.
परिणामों को क्रम में लगाने के लिए। ASC बढ़ता क्रम, DESC घटता क्रम।
SELECT Name, Marks FROM Student ORDER BY Marks DESC; -- Order by multiple columns SELECT * FROM Student ORDER BY City ASC, Name DESC;
Operate on a set of rows, return a single value: COUNT(), SUM(), AVG(), MAX(), MIN().
कई पंक्तियों पर काम करके एक परिणाम देते हैं: COUNT() गिनती, SUM() जोड़, AVG() औसत, MAX() अधिकतम, MIN() न्यूनतम।
SELECT COUNT(*) AS TotalStudents FROM Student; SELECT AVG(Marks) FROM Student; SELECT MAX(Marks), MIN(Marks) FROM Student;
GROUP BY groups rows with same values. HAVING filters groups (like WHERE for groups).
GROUP BY समान मान वाली पंक्तियों को समूह बनाता है। HAVING समूहों पर शर्त लगाता है (जैसे WHERE पर पंक्ति पर)।
-- City-wise average marks SELECT City, AVG(Marks) AS AvgMarks FROM Student GROUP BY City; -- Only cities with average > 80 SELECT City, AVG(Marks) FROM Student GROUP BY City HAVING AVG(Marks) > 80;
Cartesian Product: every row of table1 with every row of table2 (no join condition).
Equi-Join / Inner Join: match rows where common column values are equal.
Natural Join: automatically joins on columns with same name and domain.
कार्टीजियन गुणन: हर पंक्ति का हर पंक्ति से मेल।
ईक्वी-जॉइन/इनर जॉइन: समान कॉलम के आधार पर जोड़।
नेचुरल जॉइन: अपने आप समान नाम वाले कॉलम से जोड़।
-- Inner Join (explicit syntax) SELECT Student.Name, City.CityName FROM Student INNER JOIN City ON Student.City = City.CityCode; -- Implicit join (old style) SELECT Student.Name, City.CityName FROM Student, City WHERE Student.City = City.CityCode; -- Natural Join SELECT * FROM Student NATURAL JOIN City;
TCL (Transaction Control): COMMIT saves, ROLLBACK undoes, SAVEPOINT sets a marker.
Views: Virtual tables based on a SELECT query. CREATE VIEW view_name AS SELECT ...;
TCL: COMMIT सेव, ROLLBACK पीछे लौटना, SAVEPOINT एक बिंदु तक वापस जाना।
व्यू: एक वर्चुअल टेबल जो SELECT क्वेरी पर आधारित होती है।
-- Transaction example START TRANSACTION; UPDATE Student SET Marks = Marks + 5; SAVEPOINT sp1; DELETE FROM Student WHERE RollNo = 5; ROLLBACK TO sp1; -- undo delete COMMIT; -- save the update permanently -- View CREATE VIEW TopStudents AS SELECT RollNo, Name, Marks FROM Student WHERE Marks > 90; SELECT * FROM TopStudents;
SQL provides several built-in numeric functions to perform mathematical operations directly inside queries. The three most commonly used in the curriculum are POWER(), ROUND(), and MOD(). These functions can be used in SELECT, WHERE, ORDER BY, and even with UPDATE statements.
decimal_places is negative, it rounds to the left of the decimal point (tens, hundreds, …).dividend by divisor. It behaves like the % operator in many languages.All three functions can be nested or combined with other expressions.
SQL में कई गणितीय फलन (mathematical functions) पहले से मौजूद हैं जिन्हें हम क्वेरी के अंदर ही उपयोग कर सकते हैं। पाठ्यक्रम में तीन मुख्य फलन POWER(), ROUND(), और MOD() हैं। इनका इस्तेमाल SELECT, WHERE, ORDER BY और UPDATE में किया जा सकता है।
% चिह्न की तरह काम करता है।इन तीनों फलनों को एक-दूसरे के साथ या अन्य एक्सप्रेशन के साथ मिलाकर उपयोग कर सकते हैं।
-- =========== POWER() examples =========== SELECT POWER(2, 3); -- 8 SELECT POWER(10, -2); -- 0.01 (10⁻²) SELECT POWER(5, 0); -- 1 (anything⁰ = 1) -- Using POWER() with table columns SELECT Side, POWER(Side, 2) AS Area FROM Squares; -- =========== ROUND() examples =========== SELECT ROUND(15.678, 2); -- 15.68 SELECT ROUND(15.678, 0); -- 16 SELECT ROUND(15.678, -1); -- 20 (rounds to nearest tens) SELECT ROUND(15.678); -- 16 (default decimal_places = 0) -- Rounding a column SELECT Name, ROUND(Percentage, 1) FROM Students; -- =========== MOD() examples =========== SELECT MOD(17, 5); -- 2 SELECT MOD(100, 7); -- 2 SELECT MOD(10, 2); -- 0 (evenly divisible) -- Using MOD() to find even/odd SELECT RollNo FROM Student WHERE MOD(RollNo, 2) = 0; -- even roll numbers
-- Combining functions
SELECT Name,
ROUND(POWER(Marks, 0.5), 2) AS SqrtMarks -- square root via POWER
FROM Student;
SELECT RollNo, Marks,
CASE WHEN MOD(RollNo, 2) = 0 THEN 'Even' ELSE 'Odd' END AS RollType
FROM Student;
Explanation / व्याख्या: All these functions are evaluated row by row inside the query engine. They do not change the actual data stored in the table; they only affect the output of the query. Using them in WHERE or HAVING can filter rows based on calculated values.
SQL provides powerful string manipulation functions that let you change case, extract parts of a string, find substrings, and clean up unwanted spaces – all inside your queries. These are extremely useful for data cleaning, reporting, and formatting output.
start is usually 1‑based (first character = 1).n characters.n characters.substring within text. Returns 0 if not found (MySQL) or 0/error depending on DBMS.LTRIM(RTRIM(text))).Note: In many SQL dialects (MySQL, MariaDB) SUBSTRING and MID are identical. Some systems also support SUBSTR. The start position often begins at 1, not 0.
SQL में टेक्स्ट को जोड़ने, तोड़ने, साफ़ करने और बदलने के लिए ढेर सारे फलन मौजूद हैं। ये डेटा सफाई, रिपोर्ट बनाने और आउटपुट को सही तरीके से दिखाने में बहुत काम आते हैं।
शुरुआत 1 से गिनी जाती है।n अक्षर देता है।n अक्षर देता है।खोजने_का_शब्द टेक्स्ट में किस स्थान पर पहली बार आया। यदि नहीं मिला तो 0 लौटाता है।-- =========== UPPER / UCASE ===========
SELECT UPPER('hello world'); -- 'HELLO WORLD'
SELECT UCASE(Name) FROM Student; -- converts all names to uppercase
-- =========== LOWER / LCASE ===========
SELECT LOWER('HELLO'); -- 'hello'
SELECT LCASE(City) FROM Student; -- converts city names to lowercase
-- =========== MID / SUBSTRING / SUBSTR ===========
SELECT MID('Database', 2, 3); -- 'ata' (start=2, length=3)
SELECT SUBSTRING('Database', 2, 3); -- 'ata'
SELECT SUBSTR('Database', 2, 3); -- 'ata' (all the same)
-- Using on table column
SELECT Name, SUBSTRING(Name, 1, 3) AS ShortName FROM Student;
-- =========== LENGTH ===========
SELECT LENGTH('Hello'); -- 5
SELECT Name, LENGTH(Name) AS NameLen FROM Student;
-- =========== LEFT & RIGHT ===========
SELECT LEFT('Hello World', 4); -- 'Hell'
SELECT RIGHT('Hello World', 5); -- 'World'
-- Extract first 3 characters of each student's name
SELECT Name, LEFT(Name, 3) FROM Student;
-- =========== INSTR ===========
SELECT INSTR('Hello World', 'o'); -- 5 (first 'o' at position 5)
SELECT INSTR('Hello World', 'x'); -- 0 (not found)
-- Find domain part of email (after '@')
SELECT Email, SUBSTRING(Email, INSTR(Email, '@')+1) AS Domain FROM Users;
-- =========== LTRIM, RTRIM, TRIM ===========
SELECT LTRIM(' Hello'); -- 'Hello'
SELECT RTRIM('Hello '); -- 'Hello'
SELECT TRIM(' Hello '); -- 'Hello'
-- Clean up messy data
SELECT TRIM(Name) FROM Student; -- removes extra spaces around names
RIGHT(filename, 3)), separating first name from full name.-- Practical combination example
-- Cleaning and extracting info from a 'FullAddress' column
SELECT
FullAddress,
TRIM(FullAddress) AS CleanAddress,
UPPER(LEFT(FullAddress, 3)) AS CityCode,
RIGHT(FullAddress, 6) AS Pincode,
SUBSTRING(FullAddress, INSTR(FullAddress, ',')+1, LENGTH(FullAddress)) AS AfterComma
FROM AddressBook;
Explanation / व्याख्या: Text functions do not modify the data stored in tables; they only shape the output. You can nest them together to perform complex string operations in a single query. Remember that the starting position for MID/SUBSTRING is usually 1 (not 0). INSTR returns 0 when the substring is absent, which can be used in a WHERE clause to filter rows that contain (or do not contain) a certain pattern.
SQL provides built‑in date functions to work with date and time values. They help you extract specific parts (year, month, day) from a date, get the current system date/time, and format dates for reports.
All these functions can be used in SELECT, WHERE, GROUP BY, etc. They accept dates stored in DATE or DATETIME columns, or date literals in 'YYYY-MM-DD' format.
SQL में दिनांक और समय से जुड़े काम करने के लिए कई फलन हैं। इनकी मदद से आप तारीख में से साल, महीना, दिन अलग कर सकते हैं, मौजूदा समय देख सकते हैं और रिपोर्ट को सही फॉर्मेट में दिखा सकते हैं।
-- =========== NOW() – current date & time ===========
SELECT NOW(); -- e.g., 2026-07-18 14:30:45
SELECT NOW() AS CurrentDateTime;
-- =========== DATE() – extract only date ===========
SELECT DATE(NOW()); -- e.g., 2026-07-18
SELECT DATE('2026-07-18 09:15:22'); -- 2026-07-18
-- =========== MONTH() & MONTHNAME() ===========
SELECT MONTH('2026-07-18'); -- 7
SELECT MONTHNAME('2026-07-18'); -- 'July'
-- =========== YEAR() ===========
SELECT YEAR('2026-07-18'); -- 2026
-- =========== DAY() & DAYNAME() ===========
SELECT DAY('2026-07-18'); -- 18
SELECT DAYNAME('2026-07-18'); -- 'Saturday' (since 2026-07-18 is a Saturday)
-- =========== Using with a table (example: Employee) ===========
-- Assuming table Employee has a DOJ (Date of Joining) column
SELECT
EmpName,
DOJ,
YEAR(DOJ) AS JoiningYear,
MONTHNAME(DOJ) AS JoiningMonth,
DAYNAME(DOJ) AS JoiningDay
FROM Employee;
-- Employees who joined in the year 2022
SELECT EmpName FROM Employee WHERE YEAR(DOJ) = 2022;
-- Employees who joined on a Monday
SELECT EmpName, DOJ FROM Employee WHERE DAYNAME(DOJ) = 'Monday';
All these functions are read‑only – they don't change stored data, only affect query output. They are heavily used in WHERE and GROUP BY clauses.
-- Practical combination: showing "Date of Joining" in a friendly format
SELECT
EmpName,
DOJ,
CONCAT(DAYNAME(DOJ), ', ', DAY(DOJ), ' ', MONTHNAME(DOJ), ' ', YEAR(DOJ)) AS FriendlyJoinDate
FROM Employee;
-- Example output: 'Saturday, 18 July 2026'
Explanation / व्याख्या: These date functions are evaluated row by row. They accept date literals in 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MI:SS' format. MONTHNAME() and DAYNAME() return names in the database's default language (usually English). You can combine them with other string functions (like CONCAT) to create custom formatted date strings.
Aggregate functions perform a calculation on a set of rows and return a single value. They are extremely useful for summarizing data – finding totals, averages, extremes, and counts. These functions are often used with GROUP BY but can also be used on the entire table.
All functions except COUNT(*) ignore NULL values.
समग्र फलन (aggregate functions) कई पंक्तियों पर गणना करके एक अकेला परिणाम लौटाते हैं। डेटा का सारांश निकालने, कुल योग, औसत, न्यूनतम‑अधिकतम निकालने में ये बहुत काम आते हैं। इन्हें GROUP BY के साथ भी इस्तेमाल कर सकते हैं।
COUNT(*) को छोड़कर सभी फलन NULL को नज़रअंदाज करते हैं।
-- =========== MAX() & MIN() =========== SELECT MAX(Marks) FROM Student; -- highest marks SELECT MIN(Marks) FROM Student; -- lowest marks SELECT MAX(Marks) - MIN(Marks) AS Range FROM Student; -- difference -- =========== AVG() =========== SELECT AVG(Marks) FROM Student; -- average marks -- With alias and rounding SELECT ROUND(AVG(Marks), 2) AS AverageMarks FROM Student; -- =========== SUM() =========== SELECT SUM(Amount) FROM Fees; -- total fees collected SELECT SUM(Marks) AS TotalMarks FROM Student; -- =========== COUNT() =========== -- Count students with non‑NULL marks SELECT COUNT(Marks) FROM Student; -- Count total number of students SELECT COUNT(*) FROM Student; -- Count distinct cities SELECT COUNT(DISTINCT City) FROM Student;
-- Combining multiple aggregates in one query
SELECT
COUNT(*) AS TotalStudents,
AVG(Marks) AS AverageMarks,
MAX(Marks) AS Highest,
MIN(Marks) AS Lowest,
SUM(Marks) AS TotalMarks
FROM Student;
GROUP BY to calculate statistics per group.GROUP BY के साथ मिलकर हर समूह के लिए अलग‑अलग परिणाम दे सकते हैं।-- Using COUNT(*) vs COUNT(column)
-- Assume some rows have Marks = NULL
SELECT COUNT(*) FROM Student; -- 50 (all rows)
SELECT COUNT(Marks) FROM Student; -- 48 (only rows with marks)
-- Using aggregate with GROUP BY
SELECT City,
COUNT(*) AS NumStudents,
AVG(Marks) AS AvgMarks
FROM Student
GROUP BY City;
Explanation / व्याख्या: These functions work on sets of rows. MAX(), MIN(), AVG(), and SUM() ignore NULLs, so they won't affect the result. COUNT(*) is special – it's the only aggregate that counts every row, regardless of NULLs. Always use COUNT(*) when you just need the total number of rows; use COUNT(column) only when you need to count non‑NULL entries. You can also use DISTINCT inside these functions (e.g., COUNT(DISTINCT City)) to operate only on unique values.
GROUP BY, HAVING and ORDER BY are three powerful clauses used to organise, filter, and sort the output of SELECT queries. They often appear together and must be written in a specific order.
Correct clause order:
SELECT … FROM … WHERE … GROUP BY … HAVING … ORDER BY …
GROUP BY. It is like WHERE but works on groups, not individual rows. Aggregate functions can be used in HAVING.ASC) or descending (DESC) order. It can sort by one or more columns.GROUP BY, HAVING और ORDER BY तीन ऐसे खंड (clauses) हैं जो डेटा को व्यवस्थित, समूहित और क्रमबद्ध करने के लिए उपयोग होते हैं। इनका एक निश्चित क्रम होता है।
सही क्रम:
SELECT … FROM … WHERE … GROUP BY … HAVING … ORDER BY …
WHERE जैसा है, लेकिन पंक्ति की बजाय पूरे समूह को फ़िल्टर करता है।ASC) या घटते (DESC) क्रम में सजाता है।-- =========== GROUP BY basics =========== -- City‑wise student count and average marks SELECT City, COUNT(*) AS NoOfStudents, AVG(Marks) AS AvgMarks FROM Student GROUP BY City; -- Group by multiple columns SELECT City, Class, COUNT(*) FROM Student GROUP BY City, Class;
-- =========== HAVING clause =========== -- Only those cities where average marks > 80 SELECT City, AVG(Marks) AS AvgMarks FROM Student GROUP BY City HAVING AVG(Marks) > 80; -- Cities with more than 5 students SELECT City, COUNT(*) AS Total FROM Student GROUP BY City HAVING COUNT(*) > 5;
-- =========== ORDER BY clause =========== -- Sort students by marks (highest first) SELECT Name, Marks FROM Student ORDER BY Marks DESC; -- Sort by city ascending, then by marks descending SELECT * FROM Student ORDER BY City ASC, Marks DESC;
| WHERE | HAVING |
|---|---|
| Filters individual rows before grouping | Filters groups after grouping |
| Cannot use aggregate functions | Can use aggregate functions |
| Comes before GROUP BY | Comes after GROUP BY |
| WHERE | HAVING |
|---|---|
| समूह बनने से पहले पंक्तियाँ छाँटता है | समूह बनने के बाद समूह छाँटता है |
| समग्र फलन का उपयोग नहीं कर सकते | समग्र फलन का उपयोग कर सकते हैं |
| GROUP BY से पहले लिखते हैं | GROUP BY के बाद लिखते हैं |
-- Putting it all together: a complete query
-- Find cities with more than 3 students,
-- show average marks > 70,
-- and sort the result from highest average to lowest
SELECT City,
COUNT(*) AS StudentCount,
ROUND(AVG(Marks), 1) AS AverageMarks
FROM Student
WHERE Marks IS NOT NULL -- filter rows first
GROUP BY City -- group rows
HAVING COUNT(*) > 3 -- filter groups
AND AVG(Marks) > 70
ORDER BY AverageMarks DESC; -- sort the final output
Explanation / व्याख्या: Think of the execution like this: first WHERE picks the right rows, then GROUP BY puts them into buckets, then HAVING keeps only the buckets that meet the condition, finally ORDER BY arranges the buckets for display. ORDER BY can reference column aliases (like AverageMarks), but GROUP BY and HAVING cannot.
In a relational database, data is often split across multiple tables to avoid duplication. When you need to fetch combined information from two (or more) tables, you use a JOIN. The most common type is the Equi‑Join – a join where the matching condition uses the equality operator (=), typically linking a Foreign Key in one table to the Primary Key in another table.
There are two ways to write an equi‑join in SQL:
FROM clause, then specify the equality condition in the WHERE clause.JOIN ... ON keyword. This is more readable and separates join conditions from filtering conditions.Without a join condition, the database performs a Cartesian Product (every row of table1 combined with every row of table2), which is rarely useful.
रिलेशनल डेटाबेस में डेटा अक्सर कई तालिकाओं में बँटा होता है ताकि दोहराव न हो। जब हमें दो (या अधिक) तालिकाओं से जुड़ी जानकारी चाहिए तब जॉइन का उपयोग करते हैं। सबसे आम जॉइन है एक्वी‑जॉइन – जहाँ समानता (=) के आधार पर एक तालिका की विदेशी कुंजी (Foreign Key) को दूसरी तालिका की प्राथमिक कुंजी (Primary Key) से जोड़ा जाता है।
एक्वी‑जॉइन लिखने के दो तरीके हैं:
FROM में सभी टेबल के नाम लिखकर, WHERE में समानता की शर्त लगाना।JOIN ... ON का उपयोग करना। यह ज़्यादा साफ़ रहता है और जॉइन की शर्तों को फ़िल्टर की शर्तों से अलग रखता है।यदि जॉइन की शर्त न लगाई जाए तो कार्टीज़ियन गुणनफल बनता है, जो सामान्यतः उपयोगी नहीं होता।
-- ===== IMPLICIT EQUI-JOIN (old style) ===== SELECT Student.Name, City.CityName FROM Student, City WHERE Student.CityCode = City.CityCode; -- ===== EXPLICIT EQUI-JOIN (ANSI/Standard style) ===== SELECT Student.Name, City.CityName FROM Student INNER JOIN City ON Student.CityCode = City.CityCode; -- 'INNER JOIN' is the same as 'JOIN' – both are equi-joins
-- ===== Joining more than two tables ===== -- Suppose we also have a Course table (CourseId, CourseName, Fee) -- and an Enrollment table (RollNo, CourseId, EnrollmentDate) -- Get student names along with their enrolled course names SELECT Student.Name, Course.CourseName FROM Student JOIN Enrollment ON Student.RollNo = Enrollment.RollNo JOIN Course ON Enrollment.CourseId = Course.CourseId; -- Using aliases for shorter names SELECT S.Name, C.CourseName FROM Student AS S JOIN Enrollment AS E ON S.RollNo = E.RollNo JOIN Course AS C ON E.CourseId = C.CourseId;
-- ===== Equi-join with additional filters and ordering ===== -- Show students from 'Delhi' enrolled in 'Python' course, ordered by name SELECT S.Name, C.CourseName, E.EnrollmentDate FROM Student S JOIN City Ct ON S.CityCode = Ct.CityCode JOIN Enrollment E ON S.RollNo = E.RollNo JOIN Course C ON E.CourseId = C.CourseId WHERE Ct.CityName = 'Delhi' AND C.CourseName = 'Python' ORDER BY S.Name;
ON clause needed, but can be dangerous if unexpected matching columns exist.The explicit JOIN ON syntax is recommended because it clearly separates the join logic from the filtering logic (WHERE).
परीक्षा और वास्तविक उपयोग में एक्सप्लिसिट JOIN ON सिंटैक्स को अधिक पसंद किया जाता है।
-- A complete realistic query using equi-join
SELECT
S.RollNo,
S.Name,
Ct.CityName,
C.CourseName,
E.EnrollmentDate
FROM Student S
JOIN City Ct ON S.CityCode = Ct.CityCode
JOIN Enrollment E ON S.RollNo = E.RollNo
JOIN Course C ON E.CourseId = C.CourseId
WHERE E.EnrollmentDate >= '2025-01-01'
ORDER BY E.EnrollmentDate DESC;
Explanation / व्याख्या: Equi‑join is the backbone of relational queries – whenever you need data from more than one table, you use it. The join condition is almost always between a primary key and a foreign key. Using aliases (S, Ct, etc.) makes the query shorter and easier to read, especially when joining multiple tables. Always double‑check that the join condition is correct; a missing condition results in a huge, meaningless output.
A library in Python is a collection of pre‑written code (functions, classes, modules) that you can reuse in your programs. Libraries save time and effort – instead of writing everything from scratch, you simply import a library and use its features.
Key points:
pip (Python's package manager), e.g. NumPy, Pandas, Matplotlib.import statement, after which you can use its contents.import math, from math import sqrt, import numpy as np.पाइथन में लाइब्रेरी (पुस्तकालय) पहले से लिखे कोड (फंक्शन, क्लास, मॉड्यूल) का संग्रह होती है, जिसे आप अपने प्रोग्राम में दोबारा उपयोग कर सकते हैं। इससे समय और मेहनत बचती है – सब कुछ खुद लिखने की बजाय, लाइब्रेरी आयात (import) करके उसकी सुविधाओं का लाभ उठा सकते हैं।
मुख्य बातें:
pip की मदद से इंस्टॉल कर सकते हैं, जैसे NumPy, Pandas, Matplotlib.import स्टेटमेंट से आयात करते हैं, फिर उसकी सामग्री का उपयोग करते हैं।import math, from math import sqrt, import numpy as np.# Importing the whole library import math print(math.sqrt(25)) # 5.0 print(math.pi) # 3.1415926535... # Importing specific functions from math import factorial, pow print(factorial(5)) # 120 print(pow(2, 3)) # 8.0 # Importing with an alias (nickname) import statistics as st data = [10, 20, 30, 40] print(st.mean(data)) # 25.0
# Examples with built-in libraries
import random
fruits = ['apple', 'banana', 'cherry']
print(random.choice(fruits)) # picks a random fruit
random.shuffle(fruits)
print(fruits)
import datetime
today = datetime.date.today()
print("Today's date:", today)
import os
print("Current directory:", os.getcwd())
Outside the standard library, you often need extra libraries. You install them using pip (Python package installer) from the terminal/command prompt.
Example: pip install matplotlib or python -m pip install pandas.
After installation, import them just like built‑in libraries.
मानक पुस्तकालय के बाहर की लाइब्रेरी इस्तेमाल करने के लिए pip का उपयोग किया जाता है। टर्मिनल/कमांड प्रॉम्प्ट में जाकर कमांड चलाएँ।
उदाहरण: pip install matplotlib या python -m pip install pandas।
इंस्टॉल करने के बाद, उन्हें भी वैसे ही import करें जैसे बिल्ट‑इन लाइब्रेरी को करते हैं।
Summary / सारांश: Libraries are the superpower of Python – they turn a good language into an incredibly versatile one. The standard library covers many everyday needs, while the vast ecosystem of third‑party libraries lets you do data science, web development, machine learning, and much more. Mastering the import statement is the key to unlocking all this power.
Pandas and Matplotlib are two of the most popular Python libraries for data analysis and visualization.
Series (1D) and DataFrame (2D) – and hundreds of functions to read, clean, transform, and analyse data.pyplot module makes it easy to generate line charts, bar graphs, histograms, scatter plots, and more.Together they are the backbone of data science in Python: Pandas prepares the data, and Matplotlib visualizes it.
Pandas और Matplotlib पाइथन के दो सबसे लोकप्रिय पुस्तकालय हैं जो डेटा विश्लेषण और चित्रण के लिए उपयोग होते हैं।
Series (1‑डी) और DataFrame (2‑डी) – तथा सैकड़ों फंक्शन डेटा पढ़ने, साफ करने, बदलने और विश्लेषण करने में मदद करते हैं।pyplot मॉड्यूल सरल इंटरफ़ेस देता है।ये दोनों साथ मिलकर पाइथन में डेटा साइंस की रीढ़ हैं: Pandas डेटा तैयार करता है, Matplotlib उसे दृश्य रूप देता है।
# Install (if not already) # pip install pandas matplotlib # Importing import pandas as pd import matplotlib.pyplot as plt
Series: A one‑dimensional labelled array (like a column in a spreadsheet).
DataFrame: A two‑dimensional table with rows and columns (like a spreadsheet or SQL table).
Series: एक लेबल वाला एक‑आयामी डेटा (स्प्रेडशीट के कॉलम जैसा)।
DataFrame: दो‑आयामी तालिका (पंक्तियाँ और कॉलम, एक्सेल शीट या SQL टेबल जैसी)।
# ----- Series -----
marks = pd.Series([85, 90, 78, 92], index=['Anjali','Amit','Raj','Priya'])
print(marks)
# ----- DataFrame -----
data = {
'Name': ['Anjali','Amit','Raj','Priya'],
'Marks': [85, 90, 78, 92],
'City': ['Delhi','Mumbai','Delhi','Chennai']
}
df = pd.DataFrame(data)
print(df)
# ----- Common DataFrame operations -----
# Reading data from a CSV file
df = pd.read_csv('students.csv')
# First few rows
print(df.head()) # first 5 rows (default)
print(df.head(10)) # first 10 rows
# Last few rows
print(df.tail(3)) # last 3 rows
# Information about columns and data types
print(df.info())
# Statistical summary
print(df.describe())
# Selecting a column
print(df['Name'])
# Filtering rows
high_scorers = df[df['Marks'] > 85]
# Grouping and aggregation
city_avg = df.groupby('City')['Marks'].mean()
print(city_avg)
The pyplot module (usually imported as plt) provides functions to create figures step by step: plot(), bar(), scatter(), hist(), pie(). You can then label axes, add a title, and display or save the chart.
pyplot मॉड्यूल (plt के नाम से आयात) चार्ट बनाने के फंक्शन देता है: plot() (रेखा), bar() (बार), scatter() (बिंदु), hist() (हिस्टोग्राम), pie() (पाई)। इसके बाद अक्षों के नाम, शीर्षक जोड़ सकते हैं और चार्ट दिखा या सहेज सकते हैं।
# ----- Line plot -----
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
plt.plot(x, y, marker='o', color='blue', linestyle='--')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Simple Line Plot')
plt.grid(True)
plt.show()
# ----- Bar chart -----
cities = ['Delhi','Mumbai','Chennai']
students = [150, 200, 120]
plt.bar(cities, students, color=['red','green','blue'])
plt.xlabel('City')
plt.ylabel('Number of Students')
plt.title('City-wise Student Count')
plt.show()
# ----- Scatter plot -----
marks_math = [85, 90, 78, 92, 88]
marks_science = [80, 95, 72, 88, 85]
plt.scatter(marks_math, marks_science)
plt.xlabel('Maths Marks')
plt.ylabel('Science Marks')
plt.title('Maths vs Science')
plt.show()
# ----- Using Matplotlib with Pandas Data -----
df = pd.DataFrame({
'Month': ['Jan','Feb','Mar','Apr','May'],
'Sales': [15000, 18000, 22000, 17000, 20000]
})
# Bar chart from DataFrame
plt.bar(df['Month'], df['Sales'], color='teal')
plt.xlabel('Month')
plt.ylabel('Sales (in ₹)')
plt.title('Monthly Sales')
plt.show()
# Line chart
plt.plot(df['Month'], df['Sales'], marker='o', color='coral')
plt.xlabel('Month')
plt.ylabel('Sales (in ₹)')
plt.title('Sales Trend')
plt.show()
A typical data analysis task: read data with Pandas → clean and summarize → create a plot with Matplotlib to communicate insights.
Example: Read a CSV of exam results, calculate city‑wise average marks, then plot them as a bar chart.
एक सामान्य डेटा विश्लेषण कार्य: Pandas से डेटा पढ़ें → साफ करें और सारांश निकालें → Matplotlib से आरेख बनाकर निष्कर्ष प्रस्तुत करें।
उदाहरण: परीक्षा परिणाम की CSV फ़ाइल पढ़ें, शहरवार औसत निकालें, फिर उसे बार चार्ट से दिखाएँ।
# Complete mini‑project: read, analyse, plot
import pandas as pd
import matplotlib.pyplot as plt
# 1. Read data
df = pd.read_csv('marks.csv') # columns: Name, City, Marks
# 2. Analyse – city average
city_avg = df.groupby('City')['Marks'].mean()
# 3. Plot
city_avg.plot(kind='bar', color='skyblue', edgecolor='black')
plt.xlabel('City')
plt.ylabel('Average Marks')
plt.title('City‑wise Average Marks')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()
Summary / सारांश: Pandas turns raw data into a structured, analysable table, while Matplotlib turns numbers into pictures that reveal patterns. Learning the basics of these two libraries will enable you to perform end‑to‑end data analysis in Python – from loading data to presenting insights. Always import Pandas as pd and Matplotlib.pyplot as plt.
Pandas provides two fundamental data structures that are used for data manipulation and analysis:
Both Series and DataFrames are built on top of NumPy arrays and provide a rich set of attributes and methods for data handling.
Pandas दो मुख्य डेटा संरचनाएँ प्रदान करता है जो डेटा हेरफेर और विश्लेषण के लिए उपयोग होती हैं:
Series और DataFrame दोनों ही NumPy arrays पर आधारित हैं और डेटा हैंडलिंग के लिए ढेर सारे गुण (attributes) और विधियाँ (methods) प्रदान करते हैं।
A Series can be created from a list, array, dictionary, or scalar value. The index parameter assigns labels to each element (defaults to 0,1,2…).
Important attributes: values, index, dtype, size, ndim, name.
Series को list, array, dictionary या scalar से बनाया जा सकता है। index पैरामीटर से हर तत्व को एक लेबल दिया जाता है (डिफ़ॉल्ट 0,1,2… होता है)।
महत्वपूर्ण गुण: values, index, dtype, size, ndim, name।
import pandas as pd
# Creation from a list
s1 = pd.Series([10, 20, 30])
print(s1)
# Creation with custom index
s2 = pd.Series([10, 20, 30], index=['a','b','c'])
print(s2)
# Creation from a dictionary
s3 = pd.Series({'Anjali':85, 'Amit':90, 'Raj':78})
print(s3)
# Attributes
print(s2.values) # [10 20 30]
print(s2.index) # Index(['a','b','c'], dtype='object')
print(s2.dtype) # int64
print(s2.size) # 3
print(s2.ndim) # 1
s2.name = "Marks" # assign name to Series
A DataFrame can be created from a dictionary of lists/arrays, a list of dictionaries, a 2D NumPy array, or by reading external files (CSV, Excel, etc.).
Important attributes: shape, dtypes, columns, index, values, size, ndim (always 2), info(), describe(), head(), tail().
DataFrame को lists/arrays की dictionary, dictionaries की list, 2‑D NumPy array, या बाहरी फ़ाइल (CSV, Excel) पढ़कर बनाया जा सकता है।
महत्वपूर्ण गुण: shape, dtypes, columns, index, values, size, ndim (हमेशा 2), info(), describe(), head(), tail()।
# Creating DataFrame from dictionary of lists
data = {
'Name': ['Anjali','Amit','Raj','Priya'],
'Marks': [85, 90, 78, 92],
'City': ['Delhi','Mumbai','Delhi','Chennai']
}
df = pd.DataFrame(data)
print(df)
# Creating from list of dictionaries
students = [
{'Name':'Anjali','Marks':85},
{'Name':'Amit','Marks':90},
{'Name':'Raj','Marks':78}
]
df2 = pd.DataFrame(students)
# Creating from CSV file (must exist)
# df3 = pd.read_csv('students.csv')
# DataFrame attributes
print(df.shape) # (4, 3) → (rows, columns)
print(df.dtypes) # data type of each column
print(df.columns) # Index(['Name','Marks','City'])
print(df.index) # RangeIndex(start=0, stop=4, step=1)
print(df.values) # 2D numpy array of values
print(df.size) # 12 (total number of cells)
print(df.ndim) # 2
# Quick peek at data print(df.head(2)) # first 2 rows print(df.tail(1)) # last 1 row print(df.info()) # summary of columns & memory print(df.describe()) # statistical summary (numeric columns)
| Feature | Series | DataFrame |
|---|---|---|
| Dimension | 1‑D | 2‑D |
| Structure | Single column with index | Multiple columns with row and column indexes |
| Homogeneity | All values same data type | Each column can have a different data type |
| Size | size gives number of elements |
shape gives (rows, columns) |
| विशेषता | Series | DataFrame |
|---|---|---|
| आयाम | 1‑डी | 2‑डी |
| संरचना | एक कॉलम और इंडेक्स | अनेक कॉलम, पंक्ति और स्तंभ इंडेक्स |
| डेटा प्रकार | सभी मान एक ही प्रकार के | प्रत्येक कॉलम अलग प्रकार का हो सकता है |
| आकार | size → तत्वों की संख्या |
shape → (पंक्तियाँ, कॉलम) |
Think of a DataFrame as a collection of Series objects sharing the same index. Each column in a DataFrame is a Series. Operations like selecting a column (df['column']) return a Series. You can also create a Series from a DataFrame row using .iloc[] or .loc[].
DataFrame को कई Series का समूह समझें जो समान index साझा करती हैं। DataFrame का हर कॉलम एक Series होता है। df['column'] से हमें एक Series मिलती है। पंक्ति से भी Series प्राप्त की जा सकती है (.iloc[] या .loc[])।
# Column as Series marks_series = df['Marks'] print(type(marks_series)) # <class 'pandas.core.series.Series'> print(marks_series) # Row as Series row0 = df.iloc[0] # first row print(row0) # Adding a new column (as a Series) df['Grade'] = pd.Series(['A','A+','B','A+'], index=[0,1,2,3]) print(df)
Summary / सारांश: Series is a 1‑D labelled array – ideal for a single column of data. DataFrame is a 2‑D labelled table – the primary data structure for data analysis. A DataFrame can be seen as a container of Series objects. Understanding these two structures is the first step towards mastering Pandas for data science.
↑ Back to TopA Pandas Series is a one‑dimensional labelled array. It can be created from various data sources. The three most important ways are:
pd.Series(). The index will be automatically generated (0, 1, 2, …) unless you supply a custom one.In all cases, you can control the index with the index parameter, set a name, and specify a dtype if needed.
Pandas Series एक 1‑डी लेबल वाली सरणी है। इसे कई तरह के डेटा स्रोतों से बनाया जा सकता है। तीन सबसे महत्वपूर्ण तरीके हैं:
pd.Series() में भेजें। इंडेक्स अपने आप (0,1,2…) बनता है, जब तक कि आप कस्टम इंडेक्स न दें।हर स्थिति में index पैरामीटर से नियंत्रण कर सकते हैं, name दे सकते हैं, और जरूरत पड़ने पर dtype भी।
First import NumPy and Pandas. Create a NumPy array using np.array(), then pass it to pd.Series().
NumPy और Pandas इम्पोर्ट करें। np.array() से array बनाएँ, फिर pd.Series() में दें।
import numpy as np import pandas as pd # NumPy array arr = np.array([10, 20, 30, 40]) # Series from ndarray s1 = pd.Series(arr) print(s1) # With custom index s2 = pd.Series(arr, index=['a','b','c','d']) print(s2) # You can also specify a name and dtype s3 = pd.Series(arr, index=[101,102,103,104], name="Values", dtype='float64') print(s3)
Pass a Python dictionary directly to pd.Series(). The keys become the index, values become the data. If you provide an index argument, the Series will be reindexed to match that index (missing keys result in NaN).
Python डिक्शनरी को सीधे pd.Series() में दें। keys → index, values → डेटा। यदि index पैरामीटर दिया तो Series उस इंडेक्स के अनुसार पुनर्व्यवस्थित होती है; जो keys नहीं हैं वहाँ NaN आ जाता है।
# From a dictionary
marks_dict = {'Anjali':85, 'Amit':90, 'Raj':78, 'Priya':92}
s4 = pd.Series(marks_dict)
print(s4)
# With explicit index (reordering/selecting)
s5 = pd.Series(marks_dict, index=['Amit','Priya','Anjali','Ravi'])
print(s5)
# Controlling dtype
s6 = pd.Series(marks_dict, dtype='float32')
print(s6)
A scalar is a single value (number, string, boolean). To create a Series, you must provide an index. The scalar will be broadcast to every entry. This is handy for initialising a constant column.
स्केलर एक अकेला मान (संख्या, स्ट्रिंग, बूलियन) है। Series बनाने के लिए index देना ज़रूरी है। वह स्केलर हर इंडेक्स पर दोहरा दिया जाता है।
# Scalar value with index
s7 = pd.Series(5, index=['a','b','c','d'])
print(s7)
# String scalar
s8 = pd.Series('Yes', index=[1,2,3])
print(s8)
# Boolean scalar
s9 = pd.Series(True, index=range(3))
print(s9)
| Data Source | Index behaviour | Typical use |
|---|---|---|
ndarray |
Auto 0,1,2… or custom | Converting array results |
dict |
Keys become index | Mapping labels to values |
scalar |
Must provide index | Initialise a constant column |
| डेटा स्रोत | इंडेक्स व्यवहार | सामान्य उपयोग |
|---|---|---|
ndarray |
ऑटो 0,1,2… या कस्टम | Array परिणामों को Series में बदलना |
dict |
keys → index | लेबल से वैल्यू मैप करना |
scalar |
इंडेक्स देना ज़रूरी | स्थिर कॉलम प्रारंभ करना |
Summary / सारांश: The Series constructor is highly flexible. pd.Series(data, index=..., name=..., dtype=...) works for all three sources. Remember that when using a dictionary, the provided index acts as a selector – missing keys become NaN. For scalar values, the index is mandatory.
Once you create a Pandas Series, you can perform many operations directly – just like you would with a single column of data. This section covers mathematical operations (vectorized arithmetic), head() & tail() to quickly inspect data, and selection, indexing & slicing to extract elements by label or position.
Pandas Series बनाने के बाद आप इस पर कई प्रकार की क्रियाएँ कर सकते हैं। इस खंड में गणितीय संक्रियाएँ (वेक्टराइज़्ड अर्थमेटिक), head() और tail() (डेटा देखने के लिए), और चयन, इंडेक्सिंग और स्लाइसिंग (लेबल या स्थान के अनुसार तत्व निकालना) शामिल हैं।
Pandas Series supports vectorized operations – you can add, subtract, multiply, divide, and apply functions to every element at once without loops. When two Series are involved, operations align by index (missing values become NaN).
s + 5, s * 2, s ** 2 (square), s / 10s1 + s2, s1 * s2 (matching indexes are added/multiplied)np.sqrt(s), np.log(s), s.abs(), s.round(2)s.sum(), s.mean(), s.max(), s.min(), s.std()Pandas Series वेक्टराइज़्ड ऑपरेशन का समर्थन करती है – बिना लूप के सभी तत्वों पर एक साथ जोड़, घटा, गुणा, भाग कर सकते हैं। दो Series पर ऑपरेशन इंडेक्स के अनुसार संरेखित (align) होता है।
s + 5, s * 2, s ** 2 (वर्ग), s / 10s1 + s2, s1 * s2 (समान इंडेक्स पर ही गणना)np.sqrt(s), np.log(s), s.abs(), s.round(2)s.sum(), s.mean(), s.max(), s.min(), s.std()import pandas as pd import numpy as np s = pd.Series([10, 20, 30, 40], index=['a','b','c','d']) # Scalar arithmetic print(s + 5) # all values increased by 5 print(s * 2) # [20, 40, 60, 80] print(s ** 2) # squares: 100, 400, 900, 1600 # Two Series s2 = pd.Series([5, 10, 15, 20], index=['a','b','c','d']) print(s + s2) # 15, 30, 45, 60 # Different indexes – alignment s3 = pd.Series([1, 2], index=['a','c']) print(s * s3) # a:10*1=10, c:30*2=60, b&d: NaN # Functions print(np.sqrt(s)) # square roots print(s.abs()) # absolute values (already positive) print(s.mean()) # 25.0
These are quick‑inspection methods to view the first or last few rows of a Series (or DataFrame). By default they return 5 rows. They don't change the original data.
Series (और DataFrame) के पहले या अंतिम कुछ तत्वों को तुरंत देखने के लिए उपयोगी। डिफ़ॉल्ट 5 पंक्तियाँ दिखाते हैं। मूल डेटा में कोई बदलाव नहीं होता।
# Create a Series of 10 values
marks = pd.Series([85,90,78,92,88,76,95,89,70,82],
index=['S' + str(i) for i in range(1,11)])
print(marks)
# head() – first 5 by default
print(marks.head()) # S1..S5
print(marks.head(3)) # S1..S3
# tail() – last 5 by default
print(marks.tail()) # S6..S10
print(marks.tail(2)) # S9, S10
You can access elements in a Series using label‑based indexing (.loc[]), position‑based indexing (.iloc[]), or the common [] operator which can mix both but may be ambiguous.
s['a'], s[['a','c']], slice s['a':'c'] (both inclusive with labels).s.iloc[0], s.iloc[[0,2]], slice s.iloc[0:3] (excludes stop).s[s > 80] returns values where condition is True.s.loc['b'] explicitly label‑based.Note: Slicing with [] on a Series can behave differently: when the index is integer‑based it's position‑based, otherwise label‑based. Using .loc and .iloc removes confusion.
Series से तत्वों को लेबल या स्थान के आधार पर निकाल सकते हैं। .loc[] लेबल आधारित, .iloc[] स्थान आधारित, तथा [] ऑपरेटर मिश्रित व्यवहार करता है।
s['a'], s[['a','c']], स्लाइस s['a':'c'] (दोनों सम्मिलित)।s.iloc[0], s.iloc[[0,2]], स्लाइस s.iloc[0:3] (अंतिम छोड़ता है)।s[s > 80] → शर्त पूरी करने वाले मान।s.loc['b'] स्पष्ट रूप से लेबल आधारित।ध्यान दें: जब इंडेक्स पूर्णांक हों तो [] स्थान आधारित स्लाइसिंग करता है, अन्यथा लेबल आधारित। .loc और .iloc का उपयोग भ्रम से बचाता है।
s = pd.Series([85,90,78,92], index=['A','B','C','D']) # Label‑based (using []) print(s['A']) # 85 print(s[['A','C']]) # A:85, C:78 print(s['A':'C']) # includes A, B, C (both ends) # Position‑based (using iloc) print(s.iloc[1]) # 90 (value at index 'B') print(s.iloc[[0,2]]) # A:85, C:78 print(s.iloc[0:3]) # positions 0,1,2 => A,B,C (excludes 3) # Boolean indexing high = s[s > 80] # values > 80 print(high) # Using .loc print(s.loc['B']) # 90 # When index is integer s_int = pd.Series([10,20,30], index=[1,2,3]) print(s_int[1]) # label 1 -> 10 print(s_int.iloc[1]) # position 1 -> 20
Explanation / व्याख्या: Mathematical operations are element‑wise and align on index – missing matches become NaN. head() and tail() are your best friends for a quick glance at data. For extraction, always prefer .loc for label‑based and .iloc for position‑based indexing to avoid ambiguity. Boolean indexing is extremely powerful for filtering data in one line.
A DataFrame is a two‑dimensional labelled data structure. Two common ways to create one are:
NaN.NaN.Both methods let you explicitly set the index and columns parameters if needed.
DataFrame एक दो‑आयामी लेबल वाली डेटा संरचना है। इसे बनाने के दो सामान्य तरीके:
NaN भर जाता है।NaN आ जाता है।दोनों विधियों में आप चाहें तो index और columns पैरामीटर अलग से भी दे सकते हैं।
When you pass a dictionary of Series to pd.DataFrame(), each Series becomes a column. The index of the resulting DataFrame is the union of all individual Series indexes. Alignment happens automatically: wherever a Series lacks a value, NaN is inserted.
You can also provide an explicit index to select a specific set of row labels, or columns to order/select columns.
pd.DataFrame() में जब आप Series की डिक्शनरी देते हैं, तो हर Series एक कॉलम बन जाती है। DataFrame का index सभी Series के indexes का सम्मिलन (union) होता है। अलाइनमेंट अपने आप होता है: जहाँ किसी Series में मान नहीं है, वहाँ NaN आ जाता है।
आप index पैरामीटर से विशिष्ट पंक्ति लेबल चुन सकते हैं, और columns से कॉलमों का क्रम/चयन कर सकते हैं।
import pandas as pd
import numpy as np
# Three Series with overlapping indexes
roll = pd.Series([101, 102, 103], index=['Anjali','Amit','Raj'])
marks = pd.Series([85, 90, 78], index=['Anjali','Amit','Raj'])
city = pd.Series(['Delhi','Mumbai','Delhi'], index=['Anjali','Amit','Raj'])
# Dictionary of Series
data_series = {
'RollNo': roll,
'Marks': marks,
'City': city
}
df1 = pd.DataFrame(data_series)
print(df1)
# Alignment example: different indexes
s1 = pd.Series([1, 2], index=['a','b'])
s2 = pd.Series([10, 20, 30], index=['b','c','d'])
df2 = pd.DataFrame({'A': s1, 'B': s2})
print(df2)
# With explicit index and columns
df3 = pd.DataFrame(data_series,
index=['Amit','Priya'], # select only these rows
columns=['Marks','RollNo']) # specific column order
print(df3)
Each dictionary in the list becomes one row. Keys are automatically converted to column names. If a key is missing in a particular dictionary, the cell is set to NaN.
The order of rows in the DataFrame follows the order of dictionaries in the list. You can also supply an index to label the rows explicitly.
सूची में मौजूद प्रत्येक डिक्शनरी एक पंक्ति बनती है। डिक्शनरी की keys, कॉलम नामों में बदल जाती हैं। यदि किसी पंक्ति में कोई key गायब है तो वहाँ NaN भर जाता है।
पंक्तियों का क्रम सूची के क्रम में ही रहता है। index पैरामीटर देकर पंक्तियों को मनचाहे लेबल दिए जा सकते हैं।
# List of dictionaries
students = [
{'Name': 'Anjali', 'Marks': 85, 'City': 'Delhi'},
{'Name': 'Amit', 'Marks': 90, 'City': 'Mumbai'},
{'Name': 'Raj', 'City': 'Delhi'}, # Marks missing
{'Name': 'Priya', 'Marks': 92} # City missing
]
df4 = pd.DataFrame(students)
print(df4)
# With custom index
df5 = pd.DataFrame(students, index=['S1','S2','S3','S4'])
print(df5)
| Method | What each entity becomes | Best for |
|---|---|---|
| Dict of Series | Key → column name; Series → column data | Combining pre‑existing Series columns |
| List of dicts | Each dict → one row; keys → column names | Loading record‑like data (e.g., from JSON or APIs) |
| विधि | प्रत्येक इकाई क्या बनती है | उपयोग कब करें |
|---|---|---|
| Series की डिक्शनरी | Key → कॉलम नाम; Series → कॉलम डेटा | पहले से मौजूद Series को जोड़कर तालिका बनाना |
| डिक्शनरी की सूची | प्रत्येक dict → एक पंक्ति; keys → कॉलम | रिकॉर्ड‑आधारित डेटा (जैसे JSON से) लोड करना |
Summary / सारांश: Use a dictionary of Series when you already have data in separate Series objects and want to combine them column‑wise with automatic alignment. Use a list of dictionaries when data arrives as records (rows) and each record may have slightly different fields. In both cases, NaN gracefully fills missing data, making these methods robust for real‑world, incomplete datasets.
Once you have a Pandas DataFrame, you need to know how to read data from external files (CSV, text), display it effectively, iterate through it if necessary, and perform essential row/column operations – adding, selecting, deleting, and renaming. This section covers all these core skills.
pd.read_csv() or pd.read_table() to load data.head(), tail(), info(), and just printing the DataFrame.iterrows() and itertuples() are the tools.एक बार जब आप Pandas DataFrame बना लेते हैं, तो आपको सीखना होता है – बाहरी फ़ाइलों (CSV, टेक्स्ट) से डेटा कैसे पढ़ें, उसे प्रदर्शित करें, ज़रूरत पड़ने पर पुनरावृत्ति करें, और पंक्तियों और स्तंभों पर आवश्यक संक्रियाएँ करें – जोड़ना, चुनना, हटाना और नाम बदलना।
pd.read_csv() या pd.read_table() से डेटा लोड करें।head(), tail(), info() और सीधे DataFrame प्रिंट करना।iterrows() और itertuples() काम आते हैं।pd.read_csv() is the most common way. For text files with different separators (e.g., tab), use pd.read_table() or pass sep='\t' to read_csv(). Useful parameters:
filepath – path to the filesep – delimiter (default comma for CSV)header – row number for column names (default 0)index_col – column(s) to use as row indexnrows – number of rows to readskiprows – rows to skip at the startpd.read_csv() सबसे आम है। भिन्न विभाजक वाली फ़ाइल के लिए sep='\t' आदि का उपयोग करें। महत्वपूर्ण पैरामीटर: filepath (फ़ाइल का पथ), sep (विभाजक), header (कॉलम नामों वाली पंक्ति), index_col (इंडेक्स के लिए कॉलम), nrows (कितनी पंक्तियाँ पढ़नी हैं), skiprows (शुरू की कितनी पंक्तियाँ छोड़नी हैं)।
import pandas as pd
# Reading a CSV file
df = pd.read_csv('students.csv')
print(df)
# With parameters
df = pd.read_csv('data.txt', sep='\t', index_col='RollNo', nrows=50)
# Skip first 2 rows, no header
df = pd.read_csv('file.csv', skiprows=2, header=None)
To inspect a DataFrame quickly:
df.head(n) – first n rows (default 5)df.tail(n) – last n rowsprint(df) – show entire DataFrame (careful with large data)df.info() – summary of columns, types, non‑null countsdf.describe() – statistical summary for numeric columnsDataFrame को जल्दी देखने के लिए:
df.head(n) – पहली n पंक्तियाँdf.tail(n) – अंतिम n पंक्तियाँprint(df) – पूरा DataFrame (बड़े डेटा में सावधानी बरतें)df.info() – कॉलम, प्रकार, गैर‑शून्य गिनतीdf.describe() – संख्यात्मक कॉलमों का सांख्यिकीय सारांशdf = pd.read_csv('students.csv')
print(df.head()) # first 5
print(df.tail(3)) # last 3
df.info() # structure overview
print(df.describe()) # numeric summary
Pandas is designed for vectorized operations – avoid loops when possible. But when necessary:
for index, row in df.iterrows(): – yields index and Series for each row (slow, copies data).for row in df.itertuples(): – yields namedtuples, faster and more memory efficient.for col_name, series in df.iteritems(): (or just for col in df.columns).Pandas वेक्टराइज़्ड ऑपरेशन के लिए बना है – जितना हो सके लूप से बचें। पर ज़रूरत पड़ने पर:
for index, row in df.iterrows(): – हर पंक्ति के लिए इंडेक्स और Series देता है।for row in df.itertuples(): – namedtuple देता है, तेज़ और कम मेमोरी।for col_name, series in df.iteritems(): या for col in df.columns।# iterrows()
for idx, row in df.iterrows():
print(f"{row['Name']} scored {row['Marks']}")
# itertuples()
for row in df.itertuples():
print(row.Index, row.Name, row.Marks) # row.Index is the index
# iterate columns
for col_name, col_data in df.iteritems():
print(f"Column: {col_name}\n{col_data.head()}")
You can add, select, delete, and rename rows and columns easily.
आसानी से पंक्तियाँ और कॉलम जोड़, चुन, हटा सकते हैं और उनका नाम बदल सकते हैं।
# ----- ADD -----
# Add a new column
df['Grade'] = ['A','B','A+','A','B']
# Add column based on existing ones
df['Percent'] = df['Marks'] / 100 * 100
# Add a row (using .loc with new index)
df.loc['S5'] = ['Neha', 88, 'Delhi', 'A', 88.0] # all columns
# Better: use pd.concat to add rows
new_row = pd.DataFrame([['Vikram', 95, 'Pune', 'A+', 95.0]],
columns=df.columns, index=['S6'])
df = pd.concat([df, new_row])
# ----- SELECT ----- # Select a single column (returns Series) print(df['Marks']) # Select multiple columns print(df[['Name', 'Marks']]) # Select rows by label print(df.loc['S1':'S3']) # label slice inclusive print(df.loc['S1']) # single row as Series # Select rows by position print(df.iloc[0:2]) # first two rows (0,1) print(df.iloc[0, 1]) # scalar: row 0, column 1 # Conditional selection (Boolean indexing) print(df[df['Marks'] > 85]) print(df[(df['City'] == 'Delhi') & (df['Marks'] > 80)])
# ----- DELETE -----
# Drop a column
df.drop('Grade', axis=1, inplace=True) # axis=1 for column
# Alternatively: del df['Grade']
# Drop a row by index
df.drop('S5', axis=0, inplace=True) # axis=0 for row
# Drop multiple rows/columns
df.drop(['S3','S4'], inplace=True)
df.drop(['Percent','City'], axis=1, inplace=True)
# ----- RENAME -----
# Rename columns
df.rename(columns={'Name':'StudentName', 'Marks':'Score'}, inplace=True)
# Rename index
df.rename(index={'S1':'Std1', 'S2':'Std2'}, inplace=True)
# Or assign a completely new list of column names
df.columns = ['Student', 'Score', 'Location']
Summary / सारांश: These operations form the bread and butter of data wrangling. Read data efficiently with read_csv(), inspect it with head()/info(), iterate only when necessary, and then freely add, select, delete, and rename rows and columns to shape your DataFrame exactly the way you need.
When working with DataFrames (and Series), two essential skills are quickly inspecting the data using head() and tail(), and precisely extracting rows or columns using label‑based indexing. These tools help you explore data and select exactly what you need without writing complicated loops.
n rows (default 5). Great for seeing the structure and sample data.n rows. Useful for checking the end of a file or most recent entries.df.loc[row_labels, column_labels] or the direct df[column_label] / df[[col1, col2]] to select data by index and column names instead of numeric positions.These operations never modify the original DataFrame; they return a view or copy that you can assign to a new variable or use directly.
DataFrames (और Series) के साथ काम करते समय दो आवश्यक कौशल हैं – head() और tail() से डेटा का त्वरित निरीक्षण करना, तथा लेबल‑आधारित इंडेक्सिंग से पंक्तियों और स्तंभों का सटीक चयन करना। ये उपकरण बिना जटिल लूप लिखे डेटा का पता लगाने और अपनी जरूरत के अनुसार चुनने में मदद करते हैं।
n पंक्तियाँ लौटाता है (डिफ़ॉल्ट 5)। संरचना देखने और नमूना डेटा जाँचने के लिए शानदार।n पंक्तियाँ लौटाता है। फ़ाइल का अंत या सबसे हाल की प्रविष्टियाँ देखने के लिए उपयोगी।df.loc[row_labels, column_labels] या सीधे df[column_label] / df[[col1, col2]] का उपयोग करके इंडेक्स और कॉलम नामों से डेटा चुनना, न कि संख्यात्मक स्थानों से।ये ऑपरेशन मूल DataFrame को कभी नहीं बदलते; ये एक दृश्य (view) या प्रतिलिपि (copy) लौटाते हैं जिसे आप किसी नए वेरिएबल में रख सकते हैं या सीधे उपयोग कर सकते हैं।
Both head() and tail() work exactly the same for DataFrames and Series. They take a single argument n (default 5) and return that many rows from the top or bottom.
head() और tail() DataFrame और Series दोनों के लिए समान रूप से काम करते हैं। ये एक तर्क n (डिफ़ॉल्ट 5) लेते हैं और ऊपर या नीचे से उतनी पंक्तियाँ लौटाते हैं।
import pandas as pd
# Sample DataFrame
df = pd.DataFrame({
'Name': ['Anjali','Amit','Raj','Priya','Neha','Vikram'],
'Marks': [85, 90, 78, 92, 88, 95],
'City': ['Delhi','Mumbai','Delhi','Chennai','Kolkata','Pune']
})
print("Original DataFrame:")
print(df)
# head() – first 5 (default)
print("\nhead() default:")
print(df.head())
# head(3) – first 3 rows
print("\nhead(3):")
print(df.head(3))
# tail() – last 5
print("\ntail() default:")
print(df.tail())
# tail(2) – last 2 rows
print("\ntail(2):")
print(df.tail(2))
Label‑based indexing uses the actual index labels (row names) and column names to retrieve data. The primary tool is .loc[], but the simpler [] operator also works for selecting columns.
df['column_name'] returns a Series.df[['col1','col2']] returns a DataFrame.df.loc['row_label'] (single row as Series) or df.loc[['r1','r2']] (multiple rows).df.loc[['r1','r2'], ['col1','col2']].df.loc['r1':'r3'] (inclusive of both ends).df.loc[df['Marks'] > 85, ['Name','Marks']].Note: .loc[] expects labels. If you want integer positions, use .iloc[] instead.
लेबल‑आधारित इंडेक्सिंग में वास्तविक इंडेक्स लेबल (पंक्ति के नाम) और कॉलम नामों का उपयोग करके डेटा निकाला जाता है। मुख्य उपकरण .loc[] है, किंतु कॉलम चुनने के लिए सरल [] ऑपरेटर भी काम करता है।
df['column_name'] एक Series लौटाता है।df[['col1','col2']] एक DataFrame लौटाता है।df.loc['row_label'] (एक पंक्ति, Series) या df.loc[['r1','r2']] (अनेक पंक्तियाँ)।df.loc[['r1','r2'], ['col1','col2']]।df.loc['r1':'r3'] (दोनों सिरे शामिल होते हैं)।df.loc[df['Marks'] > 85, ['Name','Marks']]।ध्यान दें: .loc[] लेबल माँगता है। यदि पूर्णांक स्थान (position) चाहिए तो .iloc[] का उपयोग करें।
# ----- Selecting Columns ----- # Single column → Series names = df['Name'] print(names) # Multiple columns → DataFrame subset = df[['Name', 'Marks']] print(subset)
# ----- Selecting Rows by Label with .loc[] ----- # Assuming default integer index (0,1,2...) acts as labels print(df.loc[0]) # row with label 0 → Series print(df.loc[0:2]) # labels 0,1,2 (inclusive) print(df.loc[[0,2,4]]) # specific rows as DataFrame # ----- Selecting Rows and Columns Together ----- # Row labels 0,1 ; columns 'Name' and 'City' print(df.loc[[0,1], ['Name','City']]) # All rows, specific columns print(df.loc[:, ['Name','Marks']]) # Specific rows, all columns print(df.loc[[0,2], :])
# ----- Boolean Indexing with .loc[] -----
# Students with marks > 85
print(df.loc[df['Marks'] > 85])
# Same, but only show Name and Marks
print(df.loc[df['Marks'] > 85, ['Name','Marks']])
# ----- Slicing with Non‑Integer Index -----
df_custom = df.set_index('Name') # make 'Name' the row label
print(df_custom)
# Now use labels
print(df_custom.loc['Amit':'Raj']) # from Amit to Raj (inclusive)
print(df_custom.loc[['Anjali','Priya']])
Remember / याद रखें: .loc[] always uses labels; slices with .loc include both start and stop. For position‑based indexing (like normal Python slicing) use .iloc[]. Mastering .loc is the key to powerful and readable data selection in Pandas.
Two essential skills in data analysis are filtering rows using Boolean indexing and moving data seamlessly between CSV files and Pandas DataFrames. Boolean indexing lets you select rows based on conditions; import/export handles persistence and data exchange.
True/False values to select rows. You write a condition like df['Marks'] > 80 and pass it inside df[...] or df.loc[...]. Multiple conditions can be combined with & (and), | (or), ~ (not).pd.read_csv('file.csv') with many parameters (sep, header, index_col, usecols, nrows, skiprows, etc.).df.to_csv('file.csv', index=False). Common parameters: index, header, columns, sep.These operations are used together daily: load a CSV, filter rows with Boolean indexing, perform calculations, and save the result back to a new CSV.
डेटा विश्लेषण में दो आवश्यक कौशल हैं – बूलियन इंडेक्सिंग द्वारा पंक्तियाँ छाँटना, और CSV फ़ाइलों और Pandas DataFrames के बीच डेटा का निर्बाध आदान-प्रदान। बूलियन इंडेक्सिंग से आप शर्तों के अनुसार पंक्तियाँ चुनते हैं; आयात/निर्यात डेटा को संग्रहित करने और आदान-प्रदान का कार्य करता है।
True/False की श्रृंखला से पंक्तियाँ चुनना। df['Marks'] > 80 जैसी शर्त लिखकर df[...] या df.loc[...] में दें। कई शर्तों को & (और), | (या), ~ (नहीं) से जोड़ सकते हैं।pd.read_csv('file.csv') का उपयोग करें। अनेक पैरामीटर: sep, header, index_col, usecols, nrows, skiprows आदि।df.to_csv('file.csv', index=False) का उपयोग करें। सामान्य पैरामीटर: index, header, columns, sep।ये क्रियाएँ रोज़ एक साथ उपयोग होती हैं: CSV लोड करें, बूलियन इंडेक्सिंग से पंक्तियाँ छाँटें, गणना करें, और परिणाम नई CSV में सहेजें।
Boolean indexing creates a mask of True/False values corresponding to each row. Only rows where the mask is True are returned. The condition can involve one or multiple columns. Use & for AND, | for OR, and ~ for NOT. Always use parentheses around each condition when combining them, due to operator precedence.
बूलियन इंडेक्सिंग हर पंक्ति के लिए True/False का एक मुखौटा बनाती है। जहाँ True होता है वही पंक्तियाँ लौटती हैं। शर्त एक या अनेक कॉलम पर हो सकती है। AND के लिए &, OR के लिए |, NOT के लिए ~ का प्रयोग करें। ऑपरेटर प्राथमिकता के कारण प्रत्येक शर्त को कोष्ठक में लिखना आवश्यक है।
import pandas as pd
# Sample DataFrame
df = pd.DataFrame({
'Name': ['Anjali','Amit','Raj','Priya','Neha','Vikram'],
'Marks': [85, 90, 78, 92, 88, 95],
'City': ['Delhi','Mumbai','Delhi','Chennai','Kolkata','Pune'],
'Grade': ['A','A+','B','A+','A','A+']
})
print("Original DataFrame:")
print(df)
# ----- Simple Boolean Condition ----- # Rows where Marks > 85 high_scorers = df[df['Marks'] > 85] print(high_scorers) # Alternative with .loc (same result) high_scorers = df.loc[df['Marks'] > 85] print(high_scorers)
# ----- Multiple Conditions (AND, OR, NOT) ----- # Students from Delhi AND Marks > 80 delhi_high = df[(df['City'] == 'Delhi') & (df['Marks'] > 80)] print(delhi_high) # Students from Delhi OR Mumbai delhi_mumbai = df[(df['City'] == 'Delhi') | (df['City'] == 'Mumbai')] print(delhi_mumbai) # Using isin() for cleaner OR delhi_mumbai = df[df['City'].isin(['Delhi','Mumbai'])] print(delhi_mumbai) # NOT condition – students NOT from Delhi not_delhi = df[~(df['City'] == 'Delhi')] print(not_delhi)
# ----- Boolean Indexing with Specific Columns ----- # Show Name and Marks for students with Grade A+ aplus_names = df.loc[df['Grade'] == 'A+', ['Name','Marks']] print(aplus_names) # Modifying values using Boolean mask df.loc[df['Marks'] < 80, 'Grade'] = 'Fail' # change grade of low scorers print(df)
# ----- Using query() Method (Alternative) -----
# Some prefer df.query() for complex conditions (more readable)
result = df.query("City == 'Delhi' and Marks > 80")
print(result)
Pandas provides robust functions to read from and write to CSV files, the most common data interchange format.
Pandas CSV फ़ाइलों से पढ़ने और लिखने के लिए सुदृढ़ फलन प्रदान करता है, जो सबसे आम डेटा विनिमय प्रारूप है।
# ========== IMPORT (Reading CSV) ==========
# Basic read
df_from_csv = pd.read_csv('students.csv')
print(df_from_csv.head())
# Common parameters
df = pd.read_csv(
'data.csv',
sep=',', # delimiter (default ',')
header=0, # row number for column names (0 means first row)
index_col='RollNo', # use 'RollNo' column as the row index
usecols=['Name','Marks','City'], # read only these columns
nrows=50, # read only first 50 rows
skiprows=2, # skip first 2 rows of the file
na_values=['NA','-'] # treat 'NA' and '-' as NaN
)
# Reading a text file with tab separator
df_tab = pd.read_csv('data.txt', sep='\t')
# Reading a file with no header
df_no_header = pd.read_csv('file.csv', header=None, names=['A','B','C'])
# ========== EXPORT (Writing to CSV) ==========
# Assuming we have a DataFrame 'result_df' that we want to save
# Basic export
result_df.to_csv('output.csv')
# Common parameters to avoid unwanted index column
result_df.to_csv('output.csv', index=False) # most common practice
# Export with specific columns only
result_df.to_csv('output.csv', columns=['Name','Marks'], index=False)
# Export without header
result_df.to_csv('output.csv', header=False, index=False)
# Use a different delimiter (e.g., tab)
result_df.to_csv('output.tsv', sep='\t', index=False)
# Handling NaN representation
result_df.to_csv('output.csv', na_rep='NULL', index=False)
# ========== Full workflow: Load → Filter → Save ==========
import pandas as pd
# 1. Load data from CSV
df = pd.read_csv('students.csv')
print("Loaded data:")
print(df.head())
# 2. Boolean indexing – filter toppers from Delhi
toppers_delhi = df[(df['City'] == 'Delhi') & (df['Marks'] >= 90)]
print("\nFiltered data (Delhi toppers):")
print(toppers_delhi)
# 3. Save result to new CSV
toppers_delhi.to_csv('delhi_toppers.csv', index=False)
print("\nResult saved to delhi_toppers.csv")
Summary / सारांश: Boolean indexing is the primary way to filter rows in Pandas; always remember to use parentheses around each condition. pd.read_csv() and df.to_csv() are your gateway to persistent data – they are indispensable for any real‑world project. Combine both to load raw data, filter what you need, and save the cleaned result for further use.
Data visualization means representing data in graphical or pictorial form (charts, plots, graphs). The main purpose of plotting is to understand data quickly, spot patterns, trends, and outliers that are not obvious from raw numbers.
In Python, we use Matplotlib (and libraries built on it like Seaborn) to create publication‑quality plots with just a few lines of code.
डेटा दृश्यीकरण का अर्थ है आँकड़ों को ग्राफ, चार्ट या चित्र के रूप में दिखाना। प्लॉटिंग का मुख्य उद्देश्य है – डेटा को तेज़ी से समझना, ऐसे पैटर्न, रुझान और बाहरी बिंदु पकड़ना जो केवल संख्याओं से नज़र नहीं आते।
पाइथन में हम Matplotlib (और इस पर बनी लाइब्रेरी जैसे Seaborn) का उपयोग करके कुछ ही पंक्तियों में आकर्षक प्लॉट बनाते हैं।
import matplotlib.pyplot as plt
import pandas as pd
# Sample data – monthly sales
months = ['Jan','Feb','Mar','Apr','May']
sales = [15000, 18000, 22000, 17000, 20000]
# Line plot to show trend
plt.plot(months, sales, marker='o', linestyle='-', color='teal')
plt.title('Monthly Sales Trend')
plt.xlabel('Month')
plt.ylabel('Sales (₹)')
plt.grid(True)
plt.show()
# Without the plot, the numbers alone wouldn't reveal the March peak
# or the April dip as instantly as this visual does.
Key Takeaway / मुख्य निष्कर्ष: Plotting is not just about making data look pretty – it is a crucial step in exploratory data analysis (EDA). Before applying any complex algorithm, always plot your data to understand its shape, outliers, and relationships. It saves time and leads to better insights.
↑ Back to TopMatplotlib’s pyplot module (imported as plt) provides simple functions to create a wide variety of plots. In this section, we cover the three most fundamental types:
plt.plot(). Shows trends over a continuous range (e.g., time series).plt.bar(). Compares discrete categories with rectangular bars.plt.hist(). Displays the frequency distribution of a numerical dataset.After creating any plot, you can save it to a file (PNG, PDF, SVG, etc.) using plt.savefig('filename') before calling plt.show(). Saving after show() may result in a blank file.
Matplotlib का pyplot मॉड्यूल (plt के नाम से आयात) कई प्रकार के प्लॉट बनाने के सरल फलन प्रदान करता है। इस खंड में हम तीन मूलभूत प्रकार सीखेंगे:
plt.plot()। सतत परास पर रुझान दिखाता है (जैसे समय श्रृंखला)।plt.bar()। आयताकार पट्टियों से श्रेणियों की तुलना करता है।plt.hist()। संख्यात्मक डेटा का बारंबारता वितरण दिखाता है।कोई भी प्लॉट बनाने के बाद plt.savefig('filename') का उपयोग करके उसे फ़ाइल (PNG, PDF, SVG) के रूप में सहेज सकते हैं। plt.show() से पहले सहेजना आवश्यक है, अन्यथा फ़ाइल खाली हो सकती है।
Purpose: Show trends, changes over time, or continuous data. Data points are connected by straight lines.
Key parameters: plt.plot(x, y, color, linestyle, marker, linewidth, label).
उद्देश्य: रुझान, समय के साथ बदलाव, या सतत डेटा दिखाना। बिंदु सीधी रेखाओं से जुड़ते हैं।
import matplotlib.pyplot as plt
import numpy as np
# Data
days = ['Mon','Tue','Wed','Thu','Fri']
temperature = [32, 34, 36, 33, 31]
# Plot
plt.figure(figsize=(8,5))
plt.plot(days, temperature, color='coral', marker='o', linestyle='-', linewidth=2, label='Temperature')
plt.title('Weekly Temperature Trend', fontsize=14)
plt.xlabel('Day')
plt.ylabel('Temperature (°C)')
plt.legend()
plt.grid(True, linestyle='--', alpha=0.7)
# Save first
plt.savefig('line_plot.png', dpi=150, bbox_inches='tight')
plt.show()
Purpose: Compare quantities across categories. Each category has a bar whose height represents the value.
Key parameters: plt.bar(x, height, color, width, edgecolor, label).
For horizontal bars use plt.barh(). For grouped/stacked bars, call bar() multiple times.
उद्देश्य: श्रेणियों के बीच तुलना। हर श्रेणी की एक पट्टी होती है जिसकी ऊँचाई मान दिखाती है।
# Data
cities = ['Delhi','Mumbai','Chennai','Kolkata']
population_lakhs = [110, 125, 70, 45]
plt.figure(figsize=(8,5))
bars = plt.bar(cities, population_lakhs, color=['red','green','blue','orange'],
edgecolor='black', width=0.6)
plt.title('City Population (in Lakhs)', fontsize=14)
plt.xlabel('City')
plt.ylabel('Population (Lakhs)')
# Add value labels on top of bars
for bar in bars:
height = bar.get_height()
plt.text(bar.get_x() + bar.get_width()/2, height + 1, str(height),
ha='center', fontweight='bold')
plt.savefig('bar_graph.png', dpi=150, bbox_inches='tight')
plt.show()
# Horizontal bar graph example
plt.barh(cities, population_lakhs, color='teal', edgecolor='black')
plt.title('Horizontal Bar Graph')
plt.xlabel('Population (Lakhs)')
plt.savefig('horizontal_bar.png')
plt.show()
Purpose: Understand the distribution of a numerical dataset. The range of values is divided into equal bins, and the height of each bar shows how many data points fall into that bin.
Key parameters: plt.hist(data, bins, color, edgecolor, alpha, cumulative).
bins controls the number of intervals; more bins → finer detail.
उद्देश्य: संख्यात्मक डेटा का वितरण समझना। मानों की सीमा को समान खंडों (bins) में बाँटा जाता है, और हर पट्टी की ऊँचाई बताती है कि उस खंड में कितने डेटा बिंदु हैं।
# Generate random exam scores
np.random.seed(42)
scores = np.random.normal(70, 10, 200) # mean 70, std 10, 200 students
plt.figure(figsize=(8,5))
plt.hist(scores, bins=15, color='skyblue', edgecolor='black', alpha=0.7)
plt.title('Distribution of Exam Scores', fontsize=14)
plt.xlabel('Marks')
plt.ylabel('Number of Students')
plt.axvline(x=70, color='red', linestyle='--', label='Average') # add a vertical line
plt.legend()
plt.savefig('histogram.png', dpi=150, bbox_inches='tight')
plt.show()
plt.savefig() before plt.show(); otherwise the figure is emptied.dpi (resolution), bbox_inches='tight' (removes extra whitespace), transparent=True (transparent background).'.png', '.jpg', '.pdf', '.svg'.plt.savefig() को हमेशा plt.show() से पहले बुलाएँ; बाद में करने पर आकृति खाली हो जाती है।dpi (रिज़ॉल्यूशन), bbox_inches='tight' (अतिरिक्त सफ़ेद हिस्सा हटाता है), transparent=True (पारदर्शी पृष्ठभूमि)।'.png', '.jpg', '.pdf', '.svg'।# Saving a plot with various options
plt.plot([1,2,3], [4,5,6])
plt.title("Sample Plot")
plt.savefig('high_quality.pdf', dpi=300, bbox_inches='tight', transparent=True)
plt.show()
Summary / सारांश: Line plots for trends, bar graphs for comparisons, and histograms for distributions. Master these three plot types and the save functionality to create and export professional‑looking visualizations with Matplotlib.
↑ Back to TopA raw plot conveys data, but to make it understandable and professional you must add labels, a title, and a legend. Matplotlib provides simple functions for each, which can be customized with font sizes, colors, and positions.
plt.xlabel('text') and plt.ylabel('text') add descriptions to the X and Y axes. Use parameters like fontsize, color, fontweight.plt.title('text') sets the main title of the plot. You can also set loc to left, center, or right.label argument inside the plotting function (plot(), bar(), etc.). Then call plt.legend(). Customize with loc (location like 'upper left'), title, fontsize, frameon.These additions turn a bare plot into a clear, self‑explanatory visual that can be presented directly.
एक सादा प्लॉट डेटा तो दिखाता है, लेकिन उसे समझने योग्य और पेशेवर बनाने के लिए लेबल, शीर्षक और लीजेंड जोड़ना ज़रूरी है। Matplotlib में हर चीज़ के लिए सरल फलन हैं, जिन्हें फ़ॉन्ट आकार, रंग और स्थिति से सजाया जा सकता है।
plt.xlabel('text') और plt.ylabel('text') अक्षों का विवरण देते हैं। fontsize, color जैसे पैरामीटर उपयोग कर सकते हैं।plt.title('text') प्लॉट का मुख्य शीर्षक लगाता है। loc से इसे बाएँ, बीच या दाएँ रख सकते हैं।label तर्क दें, फिर plt.legend() बुलाएँ। loc, title, fontsize से अनुकूलित करें।ये जोड़ किसी भी प्लॉट को स्वतः स्पष्ट बना देते हैं और सीधे प्रस्तुत करने लायक बनाते हैं।
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
plt.plot(x, y, marker='o')
plt.xlabel('X-axis values', fontsize=12, color='blue') # X label
plt.ylabel('Y-axis values', fontsize=12, color='green') # Y label
plt.title('Simple Line Plot', fontsize=16, fontweight='bold')
plt.show()
# Multiple lines with legend
y2 = [1, 3, 5, 7, 9]
plt.plot(x, y, marker='o', label='Line 1 (y=2x)')
plt.plot(x, y2, marker='s', label='Line 2 (y=2x-1)')
plt.xlabel('X')
plt.ylabel('Y')
plt.title('Two Lines with Legend')
plt.legend() # default location 'best'
plt.show()
# Customized legend
plt.legend(loc='upper left', fontsize=10, title='Legend Title', frameon=True, shadow=True)
plt.show()
# Title with position and background
plt.title('Centered Title', loc='center', fontsize=14,
color='darkred', backgroundcolor='lightyellow', pad=15)
# Combining everything for a bar chart
categories = ['A', 'B', 'C']
values1 = [25, 40, 35]
values2 = [20, 30, 45]
plt.bar(categories, values1, width=0.4, label='Group 1', color='skyblue', align='edge')
plt.bar(categories, values2, width=-0.4, label='Group 2', color='orange', align='edge')
plt.xlabel('Category', fontweight='bold')
plt.ylabel('Score', fontweight='bold')
plt.title('Grouped Bar Chart', fontsize=15, fontweight='heavy', style='italic')
plt.legend(loc='upper right', framealpha=0.7, edgecolor='black')
plt.show()
label inside the plotting call, otherwise nothing appears in the legend.'best', 'upper right', 'upper left', 'lower left', 'lower right', 'center'.frameon=False.label arguments or do not call plt.legend().label दें, वरना लीजेंड में कुछ नहीं दिखेगा।'best', 'upper right', 'upper left', 'lower left', 'lower right', 'center'।frameon=False करें।label मत दें या plt.legend() न बुलाएँ।Summary / सारांश: Adding labels, a title, and a legend takes only a few lines of code but dramatically improves the readability of your plots. Use them consistently to create self‑documenting visualizations that anyone can understand at a glance.
↑ Back to TopComputer Network: A computer network is a collection of interconnected devices (computers, servers, printers, etc.) that can communicate and share resources (data, files, internet, printers). The connection can be wired (Ethernet cables, fiber optics) or wireless (Wi‑Fi, Bluetooth, satellite).
Need for Networking:
Types of Networks (by scale):
Basic Components: Nodes (devices), communication links (cables/wireless), switches, routers, protocols (rules like TCP/IP).
कंप्यूटर नेटवर्क: आपस में जुड़े उपकरणों (कंप्यूटर, सर्वर, प्रिंटर) का समूह जो डेटा और संसाधन साझा कर सकते हैं। कनेक्शन तार (ईथरनेट, फाइबर) या बेतार (वाई‑फाई, ब्लूटूथ) हो सकता है।
नेटवर्किंग की आवश्यकता:
नेटवर्क के प्रकार (पैमाने के अनुसार):
मुख्य घटक: नोड (उपकरण), संचार लिंक (केबल/वायरलेस), स्विच, राउटर, प्रोटोकॉल (नियम जैसे TCP/IP)।
+--------+ +--------+ +--------+
| Laptop | <--> | Switch | <--> | Router | <--> Internet
+--------+ +--------+ +--------+
|
+------+------+
| |
+--------+ +--------+
| Server | | Printer|
+--------+ +--------+
Simple LAN Diagram
Explanation / व्याख्या: A network allows devices to exchange data via a set of rules (protocols). The Internet is a "network of networks" connecting millions of computers globally using the TCP/IP protocol suite. Understanding networks is fundamental for cybersecurity, cloud computing, and everyday digital life.
↑ Back to TopComputer networks are classified by their geographical spread and purpose. The four primary types are:
As the area grows, the technology, speed, cost, and management complexity change.
कंप्यूटर नेटवर्क को उनके भौगोलिक विस्तार और उद्देश्य के आधार पर वर्गीकृत किया जाता है। चार प्रमुख प्रकार हैं:
जैसे-जैसे क्षेत्र बढ़ता है, तकनीक, गति, लागत और प्रबंधन जटिलता बदल जाती है।
Smallest network, range up to ~10 metres. Used for communication among personal devices like smartphone, laptop, tablet, smartwatch. Technologies: Bluetooth, Infrared, USB cable.
Example: Connecting wireless earphones to a mobile phone.
Features: Very low cost, low power, limited to one user.
सबसे छोटा नेटवर्क, लगभग 10 मीटर तक। निजी उपकरणों (स्मार्टफोन, लैपटॉप, टैबलेट) के बीच संचार। तकनीक: ब्लूटूथ, इन्फ्रारेड, USB केबल।
उदाहरण: मोबाइल से वायरलेस ईयरफोन जोड़ना।
विशेषताएँ: बहुत कम लागत, कम ऊर्जा, केवल एक उपयोगकर्ता तक सीमित।
Confined to a small area – a room, building, or campus (up to a few kilometres). Connects computers, printers, and servers within an organisation. High data transfer rate (100 Mbps to 10 Gbps). Uses Ethernet cables (UTP, fiber) or Wi‑Fi.
Example: Computer lab in a school, office network.
Features: Privately owned, low latency, easy to set up and manage.
एक छोटे क्षेत्र – कमरा, भवन, परिसर (कुछ किलोमीटर) तक सीमित। संगठन के भीतर कंप्यूटर, प्रिंटर, सर्वर जोड़ता है। उच्च डेटा गति (100 Mbps से 10 Gbps)। ईथरनेट केबल (UTP, फाइबर) या वाई‑फाई का उपयोग।
उदाहरण: स्कूल की कंप्यूटर लैब, कार्यालय नेटवर्क।
विशेषताएँ: निजी स्वामित्व, कम विलंबता, स्थापित और प्रबंधित करना आसान।
Spans a city or a large town (up to ~50 km). Larger than LAN but smaller than WAN. Often connects multiple LANs together, e.g., different branches of an organisation within the same city. Uses fiber optics, microwave links, or leased lines.
Example: Cable TV network in a city, city‑wide Wi‑Fi (like free public Wi‑Fi zones).
Features: Medium cost, moderate speed, managed by a corporation or government body.
एक शहर या बड़े कस्बे (लगभग 50 किमी) तक फैला। LAN से बड़ा, WAN से छोटा। अक्सर एक ही शहर में संस्था के विभिन्न कार्यालयों को जोड़ता है। फाइबर ऑप्टिक्स, माइक्रोवेव लिंक या लीज्ड लाइनों का उपयोग करता है।
उदाहरण: शहर का केबल टीवी नेटवर्क, सार्वजनिक वाई‑फाई ज़ोन।
विशेषताएँ: मध्यम लागत, मध्यम गति, किसी कॉर्पोरेशन या सरकार द्वारा प्रबंधित।
Covers a very large geographical area – countries, continents, or the whole globe. The Internet is the largest WAN. Connects LANs and MANs across long distances. Uses leased telecommunication lines, fiber optics, satellites, and undersea cables. Data rates are lower compared to LAN due to distance and infrastructure.
Example: Internet, a multinational company connecting offices in India, USA, and Europe.
Features: Expensive, complex management, public or private ownership, slower than LAN (relative to the distance).
बहुत बड़े भौगोलिक क्षेत्र – देश, महाद्वीप या पूरी पृथ्वी पर फैला। इंटरनेट सबसे बड़ा WAN है। लंबी दूरी पर LAN और MAN को जोड़ता है। लीज्ड दूरसंचार लाइनों, फाइबर, उपग्रहों और समुद्री केबलों का उपयोग करता है। दूरी और बुनियादी ढाँचे के कारण डेटा दर LAN की तुलना में कम होती है।
उदाहरण: इंटरनेट, भारत, अमेरिका और यूरोप में कार्यालयों को जोड़ने वाली बहुराष्ट्रीय कंपनी।
विशेषताएँ: महँगा, जटिल प्रबंधन, सार्वजनिक या निजी स्वामित्व, LAN से धीमा (दूरी के सापेक्ष)।
| Feature | PAN | LAN | MAN | WAN |
|---|---|---|---|---|
| Full Form | Personal Area Network | Local Area Network | Metropolitan Area Network | Wide Area Network |
| Range | ~10 m | Up to few km | Up to ~50 km | Countries / Continents |
| Speed | Low-Medium | High (100 Mbps–10 Gbps) | Medium | Lower (depends on link) |
| Ownership | Personal | Private | Corporation / Govt. | Multiple organisations / Public |
| Example | Bluetooth headset | School lab | City cable TV | Internet |
| विशेषता | PAN | LAN | MAN | WAN |
|---|---|---|---|---|
| पूरा नाम | पर्सनल एरिया नेटवर्क | लोकल एरिया नेटवर्क | मेट्रोपॉलिटन एरिया नेटवर्क | वाइड एरिया नेटवर्क |
| सीमा | ~10 मीटर | कुछ किमी तक | ~50 किमी तक | देश / महाद्वीप |
| गति | कम‑मध्यम | उच्च (100 Mbps–10 Gbps) | मध्यम | कम (लिंक पर निर्भर) |
| स्वामित्व | व्यक्तिगत | निजी | निगम / सरकार | अनेक संगठन / सार्वजनिक |
| उदाहरण | ब्लूटूथ हेडसेट | स्कूल लैब | शहर का केबल टीवी | इंटरनेट |
PAN (10 m) LAN (building) MAN (city) WAN (world) ┌─────────┐ ┌────┬────┬────┐ ┌────┬────┐ ┌────┬────┬────┐ │Phone-PC│ │PC │Switch│Srv│ │LAN1│LAN2│ │LAN1│WAN │LAN2│ └─────────┘ └────┴────┴────┘ └────┴────┘ └────┴────┴────┘ Bluetooth Ethernet / Wi-Fi Fiber/Microwave Internet (TCP/IP)
Explanation / व्याख्या: Remember the order of increasing size – Personal Local Metropolitan Wide (P → L → M → W). PAN is about you, LAN is about your building, MAN is about your city, WAN is about the world.
↑ Back to TopNetwork devices are hardware components that connect computers, manage traffic, extend signals, and connect different networks. Each device works at a specific layer of the network and performs a unique function.
नेटवर्क उपकरण वे हार्डवेयर होते हैं जो कंप्यूटरों को जोड़ते हैं, ट्रैफ़िक प्रबंधित करते हैं, सिग्नल बढ़ाते हैं और भिन्न नेटवर्कों को जोड़ते हैं। प्रत्येक उपकरण नेटवर्क की एक विशेष परत पर काम करता है और एक विशेष भूमिका निभाता है।
Internet
|
Modem
|
Router (192.168.1.1) ← Gateway to LAN
|
Switch
/ | \
PC1 PC2 Printer
Signal: PC --- Repeater --- PC (extends distance)
Old LAN: Hub (all ports share data, slow)
Modern: Switch (dedicated paths, fast)
| Device | OSI Layer | Function | Data Form |
|---|---|---|---|
| Modem | Physical | Analog ↔ Digital conversion | Signal |
| Hub | Physical | Broadcast to all ports | Bits |
| Repeater | Physical | Regenerate weak signal | Signal |
| Switch | Data Link | Forward to specific port (MAC) | Frame |
| Router | Network | Path selection & forwarding (IP) | Packet |
| Gateway | All layers | Protocol & format translation | Varies |
| उपकरण | OSI परत | कार्य | डेटा रूप |
|---|---|---|---|
| मॉडम | भौतिक | एनालॉग ↔ डिजिटल रूपांतरण | सिग्नल |
| हब | भौतिक | सभी पोर्ट पर प्रसारण | बिट |
| रिपीटर | भौतिक | कमज़ोर सिग्नल पुनर्जीवित करना | सिग्नल |
| स्विच | डेटा लिंक | MAC पते से विशिष्ट पोर्ट पर भेजना | फ्रेम |
| राउटर | नेटवर्क | IP आधारित पथ चयन और अग्रेषण | पैकेट |
| गेटवे | सभी परतें | प्रोटोकॉल और प्रारूप अनुवाद | भिन्न |
Memory Trick / स्मरण युक्ति: Order them by intelligence and layer: Repeater (just amplify) → Hub (multiport repeater) → Switch (MAC‑based forwarding) → Router (IP‑based routing) → Gateway (protocol translation). Modem is special: it modulates/demodulates signals.
↑ Back to TopNetwork topology refers to the physical or logical arrangement of devices (nodes) and connections (links) in a computer network. The topology affects performance, fault tolerance, cost, and scalability. The four fundamental topologies are:
नेटवर्क टोपोलॉजी कंप्यूटर नेटवर्क में उपकरणों (नोड्स) और कनेक्शनों (लिंक्स) की भौतिक या तार्किक व्यवस्था को कहते हैं। टोपोलॉजी प्रदर्शन, दोष-सहिष्णुता, लागत और विस्तारणीयता को प्रभावित करती है। चार मूलभूत टोपोलॉजी हैं:
All nodes are connected to a central device (usually a switch or hub). The central device manages and relays data. If one cable fails, only that node is affected; if the central device fails, the whole network goes down.
Advantages: Easy to install, add/remove nodes, fault isolation simple.
Disadvantages: Central device dependency, requires more cable than bus.
सभी नोड एक केंद्रीय उपकरण (स्विच/हब) से जुड़े होते हैं। केंद्रीय उपकरण डेटा संभालता है। किसी एक केबल के खराब होने पर केवल वही नोड प्रभावित होता है; केंद्रीय उपकरण खराब होने पर पूरा नेटवर्क बंद हो जाता है।
लाभ: स्थापित करना आसान, नोड जोड़ना/हटाना सरल, दोष अलग करना आसान।
हानि: केंद्रीय उपकरण पर निर्भरता, बस से अधिक केबल की आवश्यकता।
[PC]
|
[PC]--[Switch]--[PC]
|
[Printer]
Star Topology
All devices are connected to a single central cable (backbone). Data travels in both directions. Terminators at both ends prevent signal reflection.
Advantages: Simple, cheap, uses least cable, easy to expand (just tap into the backbone).
Disadvantages: If the backbone fails, entire network goes down. Only one device can transmit at a time (collisions). Difficult to troubleshoot.
सभी उपकरण एक मुख्य केबल (बैकबोन) से जुड़ते हैं। डेटा दोनों दिशाओं में चलता है। सिरों पर टर्मिनेटर सिग्नल को वापस आने से रोकते हैं।
लाभ: सरल, सस्ता, सबसे कम केबल, विस्तार आसान।
हानि: बैकबोन खराब होने पर पूरा नेटवर्क ठप। एक समय में एक ही डिवाइस ट्रांसमिट कर सकता है (टकराव)। समस्या ढूँढना कठिन।
[Terminator]--[PC]--[PC]--[Printer]--[Terminator]
Main Bus Cable (coaxial/Ethernet)
A hierarchical structure where a root node connects to one or more nodes, which may further branch out. It is a combination of star and bus topologies. Often used in large organisations and WANs.
Advantages: Scalable, hierarchical management, easy to extend and isolate faults in branches.
Disadvantages: Highly dependent on root and backbone links, complex wiring, maintenance cost high.
पदानुक्रमित संरचना जहाँ एक रूट नोड आगे के नोड्स से जुड़ता है जो और शाखाएँ बनाते हैं। यह स्टार और बस का मिला-जुला रूप है। बड़े संगठनों और WAN में उपयोग होता है।
लाभ: विस्तार योग्य, पदानुक्रमित प्रबंधन, शाखाओं में आसान दोष पृथक्करण।
हानि: रूट और बैकबोन लिंक पर अत्यधिक निर्भरता, जटिल वायरिंग, रखरखाव खर्चीला।
[Root Switch]
/ \
[Switch] [Switch]
/ \ / \
[PC] [PC] [PC] [Printer]
Tree Topology (hierarchical stars)
Every device is connected to every other device (full mesh) or at least to several other devices (partial mesh). Provides maximum redundancy and reliability.
Advantages: Extremely reliable, data can take multiple paths, no single point of failure (full mesh). Ideal for critical networks.
Disadvantages: Very expensive (huge amount of cabling), complex to install and manage.
प्रत्येक उपकरण हर दूसरे उपकरण से जुड़ा होता है (पूर्ण मेश) या कम से कम कई अन्य उपकरणों से (आंशिक मेश)। अधिकतम अनावश्यकता और विश्वसनीयता प्रदान करता है।
लाभ: अत्यधिक विश्वसनीय, डेटा कई रास्तों से जा सकता है, एकल विफलता बिंदु नहीं (पूर्ण मेश)। महत्वपूर्ण नेटवर्क के लिए आदर्श।
हानि: बहुत महँगा (केबल की अधिकता), स्थापित व प्रबंधित करना कठिन।
Full Mesh (4 nodes): Partial Mesh:
P1-------P2 P1-------P2
| \ / | | |
| \ / | | |
| / \ | P3-------P4
| / \ |
P4-------P3
| Topology | Structure | Cable Length | Fault Tolerance | Cost |
|---|---|---|---|---|
| Star | Central device, all nodes radiate | Moderate | Single node failure = okay Central failure = network down |
Medium |
| Bus | Single backbone cable | Least | Cable break = entire network down | Lowest |
| Tree | Hierarchical stars | High | Branch failure = isolated Root failure = major outage |
High |
| Mesh | Every node connected to many others | Maximum | Very high (multiple paths) | Highest |
| टोपोलॉजी | संरचना | केबल लंबाई | दोष-सहिष्णुता | लागत |
|---|---|---|---|---|
| स्टार | केंद्रीय उपकरण, चारों ओर नोड | मध्यम | एक नोड खराब = ठीक केंद्रीय खराब = नेटवर्क बंद |
मध्यम |
| बस | एकल बैकबोन केबल | सबसे कम | केबल टूटने पर पूरा नेटवर्क ठप | सबसे कम |
| ट्री | पदानुक्रमित स्टार | उच्च | शाखा खराब = पृथक रूट खराब = बड़ा आउटेज |
उच्च |
| मेश | हर नोड कई अन्य से जुड़ा | अधिकतम | बहुत उच्च (कई रास्ते) | सबसे अधिक |
Summary / सारांश: Topology choice depends on budget, reliability needs, and scale. Star is most common in LANs (office, school). Bus is obsolete for new installations. Tree scales well for larger organisations. Mesh is used where uptime is critical (data centres, military).
↑ Back to TopInternet: A global network of billions of computers and other electronic devices. With the Internet, you can access information, communicate with anyone in the world, and do much more. The Internet is the infrastructure, while the World Wide Web (WWW) is a collection of web pages and websites that run on top of the Internet.
Key elements:
Applications of the Internet:
All these applications use different protocols – rules that define how data is transmitted and received.
इंटरनेट: दुनिया भर के अरबों कंप्यूटरों और उपकरणों का एक वैश्विक नेटवर्क। इससे आप जानकारी प्राप्त कर सकते हैं, दुनिया में किसी से भी संवाद कर सकते हैं। इंटरनेट बुनियादी ढाँचा है, जबकि वर्ल्ड वाइड वेब (WWW) वेब पेजों और वेबसाइटों का संग्रह है जो इंटरनेट पर चलता है।
मुख्य तत्व:
इंटरनेट के अनुप्रयोग:
ये सभी अलग-अलग प्रोटोकॉल (नियम) का उपयोग करते हैं जो डेटा भेजने-पाने के तरीके तय करते हैं।
Example URL breakdown:
https://www.example.com/products/page.html?color=blue#section
|--------|----------------|------------------------|-------------|--------|
Protocol Subdomain Domain Path Query Fragment
(https) (www) (example.com) (/products/ ?color= #section
page.html) blue)
Common protocols for applications:
Web → HTTP, HTTPS
Email → SMTP (sending), POP3 / IMAP (receiving)
Chat → XMPP, proprietary protocols (WhatsApp, Telegram)
VoIP → SIP, RTP (often used by Zoom, Skype, etc.)
The Web is a collection of interconnected documents and resources, linked by hyperlinks. Created by Tim Berners‑Lee in 1989. Uses HTTP/HTTPS protocol. Accessed via a web browser (Chrome, Firefox, Edge). Each page is written in HTML and identified by a URL.
वेब आपस में जुड़े दस्तावेज़ों और संसाधनों का संग्रह है, जो हाइपरलिंक से जुड़े हैं। 1989 में टिम बर्नर्स‑ली ने बनाया। HTTP/HTTPS प्रोटोकॉल उपयोग करता है। वेब ब्राउज़र (Chrome, Firefox) से देखते हैं। हर पेज HTML में लिखा होता है और URL से पहचाना जाता है।
Electronic mail. Uses store‑and‑forward model. Protocols: SMTP for sending, POP3 or IMAP for receiving. Address format: username@domain.com. You can attach files (images, documents) and send to multiple recipients.
इलेक्ट्रॉनिक डाक। स्टोर‑एंड‑फ़ॉरवर्ड मॉडल पर काम करता है। प्रोटोकॉल: SMTP (भेजने), POP3/IMAP (पाने) के लिए। पता प्रारूप: username@domain.com। आप फ़ाइलें जोड़ सकते हैं और एक साथ कई लोगों को भेज सकते हैं।
Real‑time text communication between two or more people. Can include file sharing, emojis, audio messages. Examples: WhatsApp, Telegram, Facebook Messenger, Slack. Often uses proprietary protocols.
दो या अधिक लोगों के बीच वास्तविक समय में टेक्स्ट बातचीत। फ़ाइल साझा करना, इमोजी, ऑडियो संदेश शामिल हो सकते हैं। उदाहरण: WhatsApp, Telegram, Facebook Messenger। आमतौर पर स्वामित्व प्रोटोकॉल।
Technology that lets you make voice calls using a broadband Internet connection instead of a regular phone line. Converts voice into digital packets. Supports video calls too. Examples: Skype, Zoom, Google Meet, WhatsApp audio/video calls.
ऐसी तकनीक जो साधारण फ़ोन लाइन की बजाय ब्रॉडबैंड इंटरनेट से वॉइस कॉल करने देती है। आवाज़ को डिजिटल पैकेट में बदलती है। वीडियो कॉल भी समर्थित। उदाहरण: Skype, Zoom, Google Meet, WhatsApp कॉल।
Summary / सारांश: The Internet is the global network; the Web is a service on it. Applications like Web browsing, email, chat, and VoIP make the Internet useful in daily life. Each application uses specific protocols and address schemes (URLs for Web, email addresses for email, etc.).
↑ Back to TopWebpage: A single document on the World Wide Web, written in HTML, that can contain text, images, videos, links, etc. It is displayed in a web browser and identified by a unique URL (e.g., https://www.example.com/about.html).
Website: A collection of related webpages grouped together under a single domain name (e.g., www.example.com). A website may consist of a single page (single‑page website) or thousands of interconnected pages, all sharing a common theme or purpose.
Key Difference:
Together, webpages form a website. When you visit a website, you navigate through its webpages using hyperlinks.
वेबपेज: वर्ल्ड वाइड वेब पर एक अकेला दस्तावेज़, जो HTML में लिखा होता है। इसमें टेक्स्ट, चित्र, वीडियो, लिंक आदि हो सकते हैं। इसे वेब ब्राउज़र में देखा जाता है और एक अद्वितीय URL से पहचाना जाता है।
वेबसाइट: एक ही डोमेन नाम (जैसे www.example.com) के तहत समूहित संबंधित वेबपेजों का संग्रह। कोई वेबसाइट एक ही पेज की हो सकती है या हज़ारों पेजों की, सभी एक समान विषय या उद्देश्य साझा करते हैं।
मुख्य अंतर:
कई वेबपेज मिलकर एक वेबसाइट बनाते हैं। जब आप किसी वेबसाइट पर जाते हैं, तो हाइपरलिंक के माध्यम से अलग-अलग वेबपेजों पर जाते हैं।
| Aspect | Webpage | Website |
|---|---|---|
| Definition | Single HTML document | Collection of multiple webpages |
| Address | Has its own specific URL | Main domain URL (e.g., example.com) |
| Analogy | A page in a book | The entire book |
| Content | Specific topic or information | Overall theme, navigation among pages |
| Example | /contact.html |
www.school.edu |
| पहलू | वेबपेज | वेबसाइट |
|---|---|---|
| परिभाषा | एक अकेला HTML दस्तावेज़ | अनेक वेबपेजों का संग्रह |
| पता | अपना विशिष्ट URL | मुख्य डोमेन URL (जैसे example.com) |
| उपमा | किताब का एक पन्ना | पूरी किताब |
| सामग्री | विशिष्ट विषय या जानकारी | समग्र विषय, पृष्ठों के बीच नेविगेशन |
| उदाहरण | /contact.html |
www.vidyalay.edu |
Key Takeaway / मुख्य निष्कर्ष: A website is a collection of webpages. The homepage is often the first webpage you see; all other pages are accessed through links. Understanding this difference is fundamental to web development and browsing.
↑ Back to TopStatic Web Page: A fixed page that displays the same content to every user. It is written in plain HTML and CSS. Content changes only when the developer manually edits the file. No interaction with a database. Fast loading, simple to create.
Dynamic Web Page: Content changes based on user interaction, time, or other parameters. Built using server‑side scripting languages (PHP, Python, ASP.NET) and a database. Examples: social media feeds, e‑commerce sites, webmail. Slower than static due to processing, but highly interactive and personalised.
स्टैटिक वेबपेज: एक स्थिर पेज जो हर उपयोगकर्ता को एक जैसा दिखता है। यह केवल HTML और CSS में लिखा जाता है। सामग्री तभी बदलती है जब डेवलपर फ़ाइल संपादित करे। डेटाबेस से कोई इंटरैक्शन नहीं। तेज़ लोडिंग, बनाना आसान।
डायनामिक वेबपेज: सामग्री उपयोगकर्ता के इंटरैक्शन, समय, या अन्य चरों के अनुसार बदलती है। सर्वर‑साइड स्क्रिप्टिंग भाषाओं (PHP, Python) और डेटाबेस से बनता है। उदाहरण: सोशल मीडिया फ़ीड, ई‑कॉमर्स, वेबमेल। प्रसंस्करण के कारण स्टैटिक से धीमा, पर अत्यधिक इंटरैक्टिव और वैयक्तिकृत।
| Feature | Static | Dynamic |
|---|---|---|
| Content | Same for all; rarely changes | Varies per user/interaction; changes frequently |
| Technology | HTML, CSS, maybe client‑side JS | HTML, CSS, JS + server‑side scripting (PHP, Python, etc.) + Database |
| Database | Not used | Used to store/retrieve dynamic content |
| Processing | Client‑side (browser renders HTML) | Server‑side generates HTML before sending |
| Examples | Portfolio, company brochure | Facebook, Amazon, webmail |
| विशेषता | स्टैटिक | डायनामिक |
|---|---|---|
| सामग्री | सबके लिए समान, कम बदलती | उपयोगकर्ता के अनुसार बदलती, बार-बार अपडेट |
| तकनीक | HTML, CSS, कभी-कभी क्लाइंट-साइड JS | HTML, CSS, JS + सर्वर-साइड स्क्रिप्ट (PHP, Python) + डेटाबेस |
| डेटाबेस | उपयोग नहीं | डायनामिक सामग्री के लिए आवश्यक |
| प्रसंस्करण | क्लाइंट-साइड (ब्राउज़र HTML दिखाता है) | सर्वर-साइड, HTML भेजने से पहले सर्वर पेज बनाता है |
| उदाहरण | पोर्टफोलियो, कंपनी ब्रोशर | Facebook, Amazon, वेबमेल |
A web server is a computer program (or hardware device) that stores, processes, and delivers webpages to clients (browsers) via HTTP/HTTPS. When you type a URL, the browser sends a request to the web server; the server finds the requested file (or generates it dynamically) and sends it back as a response. Popular web server software: Apache, Nginx, Microsoft IIS, LiteSpeed.
The term "web server" can refer to the software (like Apache) or the physical machine that runs the software. Usually, a web server also handles security (SSL/TLS), logging, and load balancing.
वेब सर्वर एक प्रोग्राम (या हार्डवेयर) है जो वेबपेजों को संग्रहीत, प्रसंस्कृत और क्लाइंट (ब्राउज़र) को HTTP/HTTPS के माध्यम से भेजता है। जब आप URL टाइप करते हैं, ब्राउज़र सर्वर को अनुरोध भेजता है; सर्वर फ़ाइल ढूँढकर (या डायनामिक रूप से बनाकर) वापस भेजता है। लोकप्रिय सॉफ्टवेयर: Apache, Nginx, Microsoft IIS।
"वेब सर्वर" शब्द सॉफ्टवेयर (जैसे Apache) या उस भौतिक मशीन के लिए उपयोग होता है जो सॉफ्टवेयर चलाती है। आमतौर पर वेब सर्वर सुरक्षा (SSL/TLS), लॉगिंग और लोड संतुलन भी संभालता है।
Client (Browser) Web Server
| |
| -------- HTTP Request ------> | (GET /index.html)
| | (Looks for file / generates response)
| <-------- HTTP Response ------- | (200 OK + HTML content)
Web hosting is a service that allows individuals and organisations to make their website accessible on the Internet. A hosting provider allocates space on a web server where website files (HTML, CSS, images, scripts) are stored. The server is connected to the Internet 24/7, so people can visit the site anytime.
Types of hosting:
Domain Name: The human‑friendly address (e.g., www.example.com) that points to the hosting server’s IP address via DNS.
Uploading a Website: After creating website files, you upload them to the hosting server using FTP (File Transfer Protocol) or a file manager provided by the host. Once uploaded, the site becomes live.
वेब होस्टिंग एक सेवा है जो व्यक्तियों/संगठनों को उनकी वेबसाइट इंटरनेट पर उपलब्ध कराने देती है। होस्टिंग प्रदाता सर्वर पर स्थान देता है, जहाँ वेबसाइट फ़ाइलें (HTML, चित्र आदि) रखी जाती हैं। सर्वर 24/7 इंटरनेट से जुड़ा रहता है, इसलिए साइट कभी भी खुल सकती है।
होस्टिंग के प्रकार:
डोमेन नाम: मानव-पठनीय पता (जैसे www.example.com) जो DNS के माध्यम से होस्टिंग सर्वर के IP पते की ओर इंगित करता है।
वेबसाइट अपलोड करना: साइट फ़ाइलें बनाने के बाद, उन्हें FTP (फ़ाइल ट्रांसफ़र प्रोटोकॉल) या होस्ट द्वारा दिए गए फ़ाइल मैनेजर का उपयोग करके सर्वर पर अपलोड करते हैं। अपलोड होते ही साइट लाइव हो जाती है।
Summary / सारांश: Static pages are pre‑built and fixed; dynamic pages are generated on‑the‑fly per request. A web server (software/hardware) delivers webpages. Hosting provides the server space and connectivity to keep a website online 24/7. Together, these concepts form the backbone of how websites are created, stored, and accessed.
↑ Back to TopWeb Browser: A software application used to access, retrieve, and display content from the World Wide Web. When you type a URL or click a link, the browser sends a request to the web server, receives the HTML/CSS/JavaScript files, and renders (displays) them as a readable webpage. Browsers translate code into the visual pages we interact with.
Functions of a browser:
How a browser works (simplified): User enters URL → Browser looks up IP via DNS → Sends HTTP request → Server responds with HTML → Browser parses HTML, fetches linked resources (CSS, JS, images) → Builds the DOM tree and CSSOM → Renders the page on screen.
वेब ब्राउज़र: एक सॉफ्टवेयर अनुप्रयोग जो वर्ल्ड वाइड वेब से सामग्री प्राप्त करने और प्रदर्शित करने के लिए उपयोग होता है। जब आप URL टाइप करते हैं या किसी लिंक पर क्लिक करते हैं, तो ब्राउज़र वेब सर्वर को अनुरोध भेजता है, HTML/CSS/JavaScript फ़ाइलें प्राप्त करता है और उन्हें पठनीय वेबपेज के रूप में प्रस्तुत (render) करता है।
ब्राउज़र के कार्य:
ब्राउज़र कैसे काम करता है (सरल रूप): उपयोगकर्ता URL डालता है → ब्राउज़र DNS से IP पता खोजता है → HTTP अनुरोध भेजता है → सर्वर HTML के साथ उत्तर देता है → ब्राउज़र HTML पार्स करता है, संबंधित संसाधन (CSS, JS, चित्र) लाता है → DOM और CSSOM बनाता है → पेज स्क्रीन पर दिखाता है।
Typical browser request flow: User -> Address bar (URL) -> DNS lookup -> Server IP -> HTTP request -> Server response -> Browser rendering -> Display page Components of a browser: +-------------------------------------------------+ | Tab 1 Tab 2 Tab 3 [+] | <- Tab bar +-------------------------------------------------+ | Back/Forward | Refresh | URL bar | Bookmarks | <- Navigation +-------------------------------------------------+ | | | Web Page Content | | (rendered HTML/CSS/JS) | | | +-------------------------------------------------+ | Status bar, Developer tools (F12) | +-------------------------------------------------+
| Browser | Developer / Company | Engine | Key Features |
|---|---|---|---|
| Google Chrome | Blink | Fast, sync across devices, huge extension library, built‑in Google services | |
| Mozilla Firefox | Mozilla Foundation | Gecko | Open‑source, strong privacy focus, customizable, extensive add‑ons |
| Safari | Apple Inc. | WebKit | Optimised for macOS/iOS, energy efficient, smooth integration with Apple devices |
| Microsoft Edge | Microsoft | Blink (since 2020) | Integrated with Windows, AI tools (Copilot), IE compatibility mode |
| Opera | Opera Software | Blink | Built‑in VPN, ad blocker, battery saver, sidebar messengers |
| ब्राउज़र | डेवलपर/कंपनी | इंजन | मुख्य विशेषताएँ |
|---|---|---|---|
| Google Chrome | Blink | तेज़, डिवाइसों में तुल्यकालन, विशाल एक्सटेंशन लाइब्रेरी | |
| Mozilla Firefox | Mozilla Foundation | Gecko | ओपन‑सोर्स, गोपनीयता पर ज़ोर, अनुकूलन योग्य |
| Safari | Apple Inc. | WebKit | macOS/iOS के लिए अनुकूलित, ऊर्जा दक्ष, Apple उपकरणों के साथ एकीकरण |
| Microsoft Edge | Microsoft | Blink (2020 से) | Windows से एकीकृत, AI उपकरण (Copilot), IE संगतता मोड |
| Opera | Opera Software | Blink | अंतर्निहित VPN, विज्ञापन अवरोधक, बैटरी बचत |
Summary / सारांश: A web browser is your gateway to the Internet. It interprets code and displays webpages. Chrome, Firefox, Safari, Edge, and Opera are the most popular choices, each built on a browser engine (Blink, Gecko, WebKit) and offering unique features. Browsers are free and constantly updated for speed, security, and compatibility.
↑ Back to TopBeyond just displaying webpages, modern browsers offer a wide range of settings to control privacy, security, and appearance, support for extensions/add‑ons/plug‑ins to add functionality, and mechanisms like cookies to remember your preferences and sessions. Understanding these features helps you browse safely and efficiently.
वेब पेज दिखाने के अलावा, आधुनिक ब्राउज़र कई सेटिंग्स (गोपनीयता, सुरक्षा, रूप‑रंग), एक्सटेंशन/ऐड‑ऑन/प्लग‑इन (अतिरिक्त सुविधाएँ) और कुकीज़ (प्राथमिकताएँ याद रखने) जैसी सुविधाएँ देते हैं। इन्हें समझकर आप सुरक्षित और कुशल ब्राउज़िंग कर सकते हैं।
Every browser has a Settings or Preferences menu where you can customize how the browser works. Common settings include:
Most browsers also offer Incognito/Private mode: browsing activity is not stored locally (history, cookies, form data are deleted after closing the window).
हर ब्राउज़र में सेटिंग्स या प्राथमिकताएँ मेनू होता है। सामान्य सेटिंग्स:
अधिकांश ब्राउज़र गुप्त/निजी मोड भी देते हैं: ब्राउज़िंग गतिविधि स्थानीय रूप से संग्रहीत नहीं होती (विंडो बंद करने पर इतिहास, कुकीज़ मिट जाती हैं)।
These are small software components that add specific capabilities to a browser. Though often used interchangeably, there is a subtle difference:
You can install add‑ons/extensions from the browser’s official web store (Chrome Web Store, Firefox Add‑ons, etc.). Always check permissions before installing, as some may have access to your data.
ये छोटे सॉफ्टवेयर घटक हैं जो ब्राउज़र में नई क्षमताएँ जोड़ते हैं। हालाँकि अक्सर एक‑दूसरे के स्थान पर उपयोग होते हैं, लेकिन सूक्ष्म अंतर है:
आप ब्राउज़र के आधिकारिक स्टोर (Chrome Web Store, Firefox Add‑ons) से ऐड‑ऑन इंस्टॉल कर सकते हैं। इंस्टॉल करने से पहले अनुमतियाँ ज़रूर जाँचें।
Cookies are small text files stored on your computer by websites you visit. They remember information about you and your preferences. Cookies are sent back to the server with every request, allowing the server to recognize you.
Types of cookies:
Uses: Session management (keeping you logged in), personalisation (language, theme), tracking (analytics, ads).
Managing Cookies: You can view, delete, or block cookies from browser settings. Blocking all cookies may break some websites that rely on them for login or shopping cart functionality. Most modern browsers are phasing out third‑party cookies for privacy reasons.
कुकीज़ छोटी टेक्स्ट फ़ाइलें होती हैं जो वेबसाइटें आपके कंप्यूटर पर संग्रहीत करती हैं। ये आपके बारे में जानकारी और प्राथमिकताएँ याद रखती हैं। हर अनुरोध के साथ कुकीज़ सर्वर को वापस भेजी जाती हैं, जिससे सर्वर आपको पहचान सकता है।
कुकीज़ के प्रकार:
उपयोग: सत्र प्रबंधन (लॉग इन रखना), वैयक्तिकरण (भाषा, थीम), ट्रैकिंग (एनालिटिक्स, विज्ञापन)।
कुकीज़ प्रबंधित करना: आप ब्राउज़र सेटिंग्स में कुकीज़ देख, हटा या ब्लॉक कर सकते हैं। सभी कुकीज़ ब्लॉक करने से कुछ वेबसाइटें ठीक से काम नहीं करेंगी। आधुनिक ब्राउज़र गोपनीयता कारणों से तृतीय‑पक्ष कुकीज़ को हटा रहे हैं।
Example of a cookie (Set‑Cookie HTTP header): Set‑Cookie: session_id=abc123; Expires=Wed, 21 Jul 2026 07:28:00 GMT; Path=/; Secure; HttpOnly Browser Cookie Manager: +-------------------------------------------------+ | Site | Cookie Name | Value | Expires| +-------------------------------------------------+ | example.com | session_id | abc123 | Session| | google.com | NID | 204=... | 6 months| +-------------------------------------------------+ [Remove Selected] [Remove All] [Block All Cookies]
Summary / सारांश: Browser settings let you control privacy, appearance, and defaults. Add‑ons/extensions add extra features, while plug‑ins handle specific content types (largely outdated). Cookies are tiny text files that store session and preference data; managing them wisely balances convenience and privacy.
↑ Back to TopDigital Footprint is the trail of data you leave behind when you use the internet. Every website visit, social media post, online purchase, search query, and even "like" creates a record. This record can be permanent and contributes to your online identity.
Types of Digital Footprints:
Why it matters: Your digital footprint can affect your reputation, college admissions, job prospects, and even personal safety. Employers often check social media profiles before hiring. Once online, information can be copied, shared, and archived – sometimes forever.
Impacts on society: Digital footprints fuel targeted advertising, influence political campaigns, enable cyberstalking, and contribute to identity theft. On the positive side, they help personalise user experience, facilitate e‑commerce recommendations, and assist in criminal investigations.
डिजिटल पदचिह्न (Digital Footprint) वह डेटा का निशान है जो आप इंटरनेट का उपयोग करते समय पीछे छोड़ते हैं। हर वेबसाइट विज़िट, सोशल मीडिया पोस्ट, ऑनलाइन खरीदारी, सर्च क्वेरी, और "लाइक" एक रिकॉर्ड बनाती है। यह रिकॉर्ड स्थायी हो सकता है और आपकी ऑनलाइन पहचान में योगदान देता है।
डिजिटल पदचिह्न के प्रकार:
यह क्यों मायने रखता है: आपका डिजिटल पदचिह्न आपकी प्रतिष्ठा, कॉलेज प्रवेश, नौकरी की संभावनाओं और व्यक्तिगत सुरक्षा को प्रभावित कर सकता है। नियोक्ता अक्सर भर्ती से पहले सोशल मीडिया प्रोफ़ाइल देखते हैं। एक बार ऑनलाइन आने पर जानकारी कॉपी, साझा और संग्रहीत हो सकती है – कभी-कभी हमेशा के लिए।
सामाजिक प्रभाव: डिजिटल पदचिह्न लक्षित विज्ञापन, राजनीतिक अभियानों को प्रभावित करते हैं, साइबरस्टॉकिंग को सक्षम करते हैं, और पहचान चोरी में योगदान करते हैं। सकारात्मक पक्ष पर, वे उपयोगकर्ता अनुभव को वैयक्तिकृत करते हैं, ई‑कॉमर्स सिफ़ारिशें देते हैं और आपराधिक जाँच में मदद करते हैं।
Example of Active vs Passive Footprint: Active: Tweeting "Excited for my new job!" → visible, intentional. Passive: Website tracking which pages you visited and how long you stayed → invisible, automatic. Your Digital Footprint over a day: - 8:00 AM: Google search (passive: search query stored) - 9:30 AM: Instagram post (active: shared content) - 11:00 AM: Online shopping (passive: product views, clicks) - 2:00 PM: Comment on a news article (active: public comment) - 5:00 PM: Use of GPS navigation (passive: location data)
Summary / सारांश: Your digital footprint is the permanent trace of your online activity. It can be active (what you share intentionally) or passive (what is collected without your direct input). While it enables personalised experiences and useful services, it also poses privacy, security, and reputation risks. Managing it carefully is an essential skill in today's digital society.
↑ Back to TopNet Etiquettes (Netiquette): Set of rules for acceptable and respectful behaviour while communicating over the internet. It covers email, social media, chat, forums, and video calls. Good netiquette creates a positive digital environment.
Data Protection: Practices and laws designed to safeguard personal and sensitive information from unauthorised access, misuse, disclosure, or destruction. It includes technical measures, policies, and legal frameworks.
नेट शिष्टाचार (नेटिकेट): इंटरनेट पर संचार करते समय स्वीकार्य और सम्मानजनक व्यवहार के नियम। इसमें ईमेल, सोशल मीडिया, चैट, फोरम और वीडियो कॉल शामिल हैं। अच्छा नेटिकेट एक सकारात्मक डिजिटल वातावरण बनाता है।
डेटा संरक्षण: व्यक्तिगत और संवेदनशील जानकारी को अनधिकृत पहुँच, दुरुपयोग, प्रकटीकरण या विनाश से बचाने के लिए प्रथाएँ और कानून। इसमें तकनीकी उपाय, नीतियाँ और कानूनी ढाँचे शामिल हैं।
=== NET AND COMMUNICATION ETIQUETTES === 1. Be respectful – avoid offensive language, personal attacks, and hate speech. 2. Think before you type – messages are often permanent. 3. Use clear and concise language – avoid all caps (SHOUTING), excessive emojis, or slang. 4. Protect privacy – do not share others' personal info without permission; use BCC for mass emails. 5. Respect copyright – cite sources, don't plagiarise. 6. Be mindful of tone – humour/sarcasm may not translate well in text. 7. Reply promptly but not impulsively – especially if emotional. 8. Keep attachments small; check for viruses before sending. 9. Use proper subject lines in emails; keep messages relevant to the group/topic. 10. Avoid spamming – don't send unsolicited messages, chain letters, or promotional content.
Following netiquette reduces misunderstandings, prevents cyberbullying, maintains professional reputation, and fosters healthy online communities. Violations can lead to being banned from platforms, legal consequences, or social backlash.
नेटिकेट का पालन गलतफहमियाँ कम करता है, साइबरबुलिंग रोकता है, पेशेवर प्रतिष्ठा बनाए रखता है और स्वस्थ ऑनलाइन समुदायों को बढ़ावा देता है। उल्लंघन पर प्लेटफ़ॉर्म से प्रतिबंध, कानूनी परिणाम या सामाजिक प्रतिक्रिया हो सकती है।
=== DATA PROTECTION BEST PRACTICES === 1. Use strong, unique passwords and change them periodically. 2. Enable Two‑Factor Authentication (2FA) wherever possible. 3. Keep software/antivirus updated to patch security vulnerabilities. 4. Be cautious about phishing emails and suspicious links. 5. Encrypt sensitive data during storage and transmission (SSL/TLS, HTTPS). 6. Limit sharing of personal information on social media. 7. Regularly back up important data (3‑2‑1 rule: 3 copies, 2 media, 1 offsite). 8. Read privacy policies before providing personal data. 9. Use a VPN on public Wi‑Fi to protect your connection. 10. Lock your devices with PIN/password/biometrics; log out from shared computers.
Data protection is guided by principles like lawfulness, fairness, transparency, purpose limitation, data minimisation, accuracy, storage limitation, integrity, and confidentiality. In India, the Digital Personal Data Protection Act 2023 governs how personal data is collected and processed, giving individuals rights over their data.
डेटा संरक्षण के सिद्धांत – वैधता, निष्पक्षता, पारदर्शिता, उद्देश्य सीमा, डेटा न्यूनीकरण, सटीकता, भंडारण सीमा, अखंडता और गोपनीयता। भारत में डिजिटल व्यक्तिगत डेटा संरक्षण अधिनियम 2023 व्यक्तिगत डेटा के संग्रह और प्रसंस्करण को नियंत्रित करता है और व्यक्तियों को अपने डेटा पर अधिकार देता है।
Summary / सारांश: Good netiquette ensures respectful online communication and a positive digital presence. Data protection safeguards personal information from misuse through technical measures and legal frameworks. Both are essential for responsible digital citizenship.
↑ Back to TopIntellectual Property (IP) refers to creations of the mind – inventions, literary and artistic works, designs, symbols, names, and images used in commerce. Intellectual Property Rights (IPR) are the legal rights granted to creators and owners to protect their creations from unauthorised use, allowing them to benefit from their work.
Why IPR is important:
बौद्धिक संपदा (IP) दिमाग की रचनाएँ हैं – आविष्कार, साहित्यिक और कलात्मक कृतियाँ, डिज़ाइन, प्रतीक, नाम और व्यवसाय में उपयोग होने वाले चित्र। बौद्धिक संपदा अधिकार (IPR) वे कानूनी अधिकार हैं जो रचनाकारों और मालिकों को उनकी रचनाओं को अनधिकृत उपयोग से बचाने के लिए दिए जाते हैं, जिससे वे अपने काम से लाभ कमा सकें।
IPR क्यों महत्वपूर्ण है:
=== TYPES OF INTELLECTUAL PROPERTY RIGHTS === 1. PATENT - Protects new, useful inventions (product or process). - Gives exclusive right to make, use, sell the invention for 20 years. - Example: a new drug formula, a unique machine design. 2. COPYRIGHT - Protects original literary, artistic, musical, dramatic works. - Includes books, paintings, songs, software code, films. - Automatically granted upon creation; registration helps enforcement. - Lasts for the author’s lifetime + 60 years (in India). - Example: J.K. Rowling’s Harry Potter books, a Python program. 3. TRADEMARK - Protects distinctive signs (brand name, logo, slogan, sound) that distinguish goods/services. - Can be renewed indefinitely (usually every 10 years). - Example: Nike’s “Swoosh” logo, McDonald’s “I’m Lovin’ It”, the word “Google”. 4. TRADE SECRET - Protects confidential business information (formulas, practices, processes). - Not registered; kept secret. Legal action possible if illegally disclosed. - Example: Coca‑Cola recipe, Google search algorithm. 5. INDUSTRIAL DESIGN - Protects the ornamental or aesthetic aspect of an article. - Valid for 10‑15 years depending on jurisdiction. - Example: the unique shape of a Coca‑Cola bottle, a smartphone’s body design. 6. GEOGRAPHICAL INDICATION (GI) - Identifies goods originating from a specific place with qualities linked to that origin. - Example: Darjeeling Tea, Kanchipuram Silk, Champagne (France).
In the software and internet context:
सॉफ्टवेयर और इंटरनेट संदर्भ में:
Summary / सारांश: IPR protects the rights of creators and encourages innovation. Patents, copyrights, trademarks, trade secrets, designs, and GI tags cover different types of creations. In the digital age, understanding and respecting IPR is essential to avoid plagiarism, software piracy, and legal consequences.
↑ Back to TopIn the digital world, it’s crucial to understand plagiarism (using others’ work without credit), copyright (legal protection for original works), and licensing (permissions for use). These concepts protect creators’ rights and guide ethical use of content and software.
डिजिटल दुनिया में साहित्यिक चोरी (बिना श्रेय के दूसरों के काम का उपयोग), कॉपीराइट (मूल रचनाओं का कानूनी संरक्षण) और लाइसेंसिंग (उपयोग की अनुमतियाँ) को समझना ज़रूरी है। ये रचनाकारों के अधिकारों की रक्षा करते हैं और सामग्री/सॉफ्टवेयर के नैतिक उपयोग का मार्गदर्शन करते हैं।
Plagiarism means presenting someone else’s work, ideas, or words as your own without proper acknowledgment. It is an ethical and academic offence, and often a copyright violation.
Types of plagiarism:
Consequences: Loss of credibility, legal action, academic penalties (failing grades, expulsion), and damage to reputation.
How to avoid: Always cite sources, use quotation marks for direct quotes, paraphrase properly, keep track of references, use plagiarism‑checking tools.
साहित्यिक चोरी का अर्थ है किसी और के काम, विचारों या शब्दों को बिना उचित स्वीकारोक्ति के अपना बताना। यह एक नैतिक और शैक्षणिक अपराध है, और अक्सर कॉपीराइट उल्लंघन भी होता है।
साहित्यिक चोरी के प्रकार:
परिणाम: विश्वसनीयता की हानि, कानूनी कार्रवाई, शैक्षणिक दंड, प्रतिष्ठा को नुकसान।
बचाव: हमेशा स्रोतों का हवाला दें, सीधे उद्धरणों के लिए उद्धरण चिह्न लगाएँ, उचित रूप से व्याख्या करें, स्रोतों का रिकॉर्ड रखें, साहित्यिक चोरी जाँच उपकरणों का उपयोग करें।
Copyright is a legal right that gives the creator of an original work exclusive control over its use and distribution. It applies to literary, artistic, musical, dramatic works, software, and more.
Key points:
कॉपीराइट एक कानूनी अधिकार है जो मूल रचना के निर्माता को उसके उपयोग और वितरण पर अनन्य नियंत्रण देता है। यह साहित्यिक, कलात्मक, संगीत, नाटकीय कृतियों, सॉफ़्टवेयर आदि पर लागू होता है।
मुख्य बिंदु:
A license is a permission granted by the copyright holder to use a work in specific ways. It defines what you can and cannot do with the software, content, or creative work.
Software Licenses:
लाइसेंस कॉपीराइट धारक द्वारा दी गई अनुमति है जो किसी कार्य का विशेष तरीके से उपयोग करने की छूट देता है। यह बताता है कि आप सॉफ़्टवेयर, सामग्री या रचनात्मक कृति के साथ क्या कर सकते हैं।
सॉफ़्टवेयर लाइसेंस:
=== Quick Reference: Common Open Source Licenses === License | Copyleft? | Can use in proprietary? | Must disclose source? -------------------------------------------------------------------- GPL v3 | Yes | No | Yes (derivatives) MIT | No | Yes | No Apache 2.0| No | Yes | No, but must state changes BSD 2/3 | No | Yes | No Creative Commons types: CC BY : Must give credit. CC BY-SA : Credit + Share alike (derivatives same license). CC BY-NC : Credit + Non‑commercial only. CC BY-NC-SA: Credit + Non‑commercial + Share alike. CC BY-ND : Credit + No derivatives. CC0 : Public domain dedication.
Summary / सारांश: Plagiarism is an ethical breach; copyright is a legal right; licensing tells you how you may use someone’s work. Understanding these concepts is vital for students, developers, and content creators to avoid legal troubles and respect intellectual property.
↑ Back to TopFree and Open Source Software (FOSS) refers to software that is both free (as in freedom, not necessarily price) and open source. Users are free to run, study, modify, and share the software. The source code is publicly available, encouraging collaboration and transparency.
The Four Essential Freedoms (Free Software Foundation):
"Free" vs "Open Source": "Free software" emphasises the ethical aspect – users should have control. "Open source" focuses on the practical benefits – collaborative development, better quality. Both terms refer to essentially the same set of licenses (GPL, MIT, Apache, etc.).
Examples: Linux (OS), Apache (web server), MySQL (database), LibreOffice (office suite), GIMP (image editor), VLC Media Player, Python, Firefox.
मुक्त और खुला स्रोत सॉफ्टवेयर (FOSS) ऐसा सॉफ्टवेयर है जो एक साथ मुक्त (स्वतंत्रता, ज़रूरी नहीं कि मुफ़्त) और खुला स्रोत हो। उपयोगकर्ता इसे चला सकते हैं, पढ़ सकते हैं, बदल सकते हैं और साझा कर सकते हैं। स्रोत कोड सार्वजनिक रूप से उपलब्ध होता है।
चार आवश्यक स्वतंत्रताएँ (फ्री सॉफ्टवेयर फाउंडेशन):
"मुक्त" बनाम "खुला स्रोत": "मुक्त सॉफ्टवेयर" नैतिकता पर बल देता है – उपयोगकर्ता का नियंत्रण होना चाहिए। "खुला स्रोत" व्यावहारिक लाभों पर केंद्रित है। दोनों लगभग समान लाइसेंस समूह (GPL, MIT, Apache) का उपयोग करते हैं।
उदाहरण: लिनक्स (OS), अपाचे (वेब सर्वर), MySQL (डेटाबेस), लिब्रेऑफिस (कार्यालय सूट), GIMP (चित्र संपादक), VLC मीडिया प्लेयर, पाइथन, फ़ायरफ़ॉक्स।
=== Popular FOSS Licenses === License Type Key Condition ----------------------------------------------------------- GPL v3 Copyleft Derivative works must also be GPL MIT Permissive Can use in proprietary software (only retain notice) Apache 2.0 Permissive Can use; includes patent grant BSD 2‑Clause Permissive Like MIT, no endorsement clause MPL 2.0 Weak Copyleft File‑level copyleft; can combine with proprietary === FOSS vs Proprietary Software === Feature FOSS Proprietary ----------------------------------------------------------- Cost Usually free of cost Must purchase/license Source Code Available & modifiable Hidden; cannot modify Freedom Full (four freedoms) Limited by EULA Community Open, collaborative Closed, company‑controlled Security Transparency aids review Relies on vendor's claims Examples Linux, LibreOffice Windows, Microsoft Office
Summary / सारांश: FOSS empowers users with freedom to use, study, modify, and share software. It drives innovation, reduces costs, and builds communities. Understanding FOSS is essential for ethical software use and contributing to a global pool of knowledge.
↑ Back to TopCybercrime refers to illegal activities carried out using computers, networks, or the internet. These crimes can target individuals, organisations, or governments. With increasing digitisation, understanding cybercrime, its types, and the legal framework is essential for digital safety.
Key topics covered here:
साइबर अपराध कंप्यूटर, नेटवर्क या इंटरनेट का उपयोग करके किए जाने वाले अवैध कार्य हैं। ये व्यक्तियों, संगठनों या सरकारों को निशाना बना सकते हैं। बढ़ते डिजिटलीकरण के साथ, साइबर अपराध, इसके प्रकार और कानूनी ढाँचे को समझना डिजिटल सुरक्षा के लिए आवश्यक है।
यहाँ शामिल मुख्य विषय:
=== CATEGORIES OF CYBERCRIME === 1. Against Individuals: - Identity theft, cyber stalking, phishing, cyber bullying, credit card fraud. 2. Against Property: - Hacking, virus/malware attacks, software piracy, intellectual property theft. 3. Against Organisation: - Data breach, denial of service (DoS/DDoS), cyber espionage. 4. Against Society / Government: - Cyber terrorism, spreading hate/rumours, hacking government websites.
Cyber law governs legal issues related to the internet, digital transactions, and cybercrimes. In India, the primary legislation is the Information Technology Act, 2000 (IT Act), amended in 2008. It defines offences and penalties for cybercrimes.
Key sections:
Other relevant laws include the Indian Penal Code (IPC), Data Protection Act (DPDP 2023), and Consumer Protection Act for e‑commerce.
साइबर कानून इंटरनेट, डिजिटल लेन‑देन और साइबर अपराधों से जुड़े कानूनी मुद्दों को नियंत्रित करता है। भारत में प्रमुख विधान सूचना प्रौद्योगिकी अधिनियम, 2000 (IT Act) है, जो 2008 में संशोधित हुआ। यह साइबर अपराधों के लिए दंड परिभाषित करता है।
प्रमुख धाराएँ:
अन्य प्रासंगिक कानून: भारतीय दंड संहिता (IPC), डिजिटल व्यक्तिगत डेटा संरक्षण अधिनियम 2023, और ई‑कॉमर्स के लिए उपभोक्ता संरक्षण अधिनियम।
Hacking is the act of gaining unauthorised access to a computer system or network. Not all hacking is illegal – it depends on intent and authorisation.
Common hacking techniques: Password cracking, keyloggers, denial of service (DoS), SQL injection, social engineering, exploiting software bugs.
Prevention: Use strong passwords, keep software updated, use firewalls and antivirus, avoid suspicious links, enable two‑factor authentication.
हैकिंग किसी कंप्यूटर सिस्टम या नेटवर्क में अनधिकृत पहुँच प्राप्त करना है। सभी हैकिंग अवैध नहीं होती – यह इरादे और अनुमति पर निर्भर करता है।
सामान्य हैकिंग तकनीकें: पासवर्ड क्रैकिंग, कीलॉगर, डिनायल ऑफ सर्विस (DoS), SQL इंजेक्शन, सोशल इंजीनियरिंग, सॉफ्टवेयर बग का शोषण।
रोकथाम: मजबूत पासवर्ड, सॉफ्टवेयर अपडेट, फ़ायरवॉल/एंटीवायरस, संदिग्ध लिंक से बचें, दो‑कारक प्रमाणीकरण सक्षम करें।
Phishing is a social engineering attack where fraudsters impersonate legitimate organisations (banks, e‑commerce sites, social media) to trick victims into revealing sensitive information like usernames, passwords, credit card numbers, or OTPs.
Common forms:
Signs of phishing: Generic greetings, spelling errors, mismatched URLs, requests for sensitive data, suspicious attachments.
Prevention: Never click on links in unsolicited emails, verify the sender’s email address, use spam filters, look for HTTPS and padlock symbol, never share OTPs/passwords over phone.
फ़िशिंग एक सोशल इंजीनियरिंग हमला है जहाँ धोखेबाज़ वैध संगठनों (बैंक, ई‑कॉमर्स, सोशल मीडिया) का नाटक करके पीड़ितों से संवेदनशील जानकारी (यूज़रनेम, पासवर्ड, क्रेडिट कार्ड, OTP) चुराते हैं।
सामान्य रूप:
फ़िशिंग के संकेत: सामान्य अभिवादन, वर्तनी की गलतियाँ, बेमेल URL, संवेदनशील डेटा माँगना, संदिग्ध अटैचमेंट।
रोकथाम: अनचाहे ईमेल के लिंक पर क्लिक न करें, प्रेषक का पता सत्यापित करें, स्पैम फ़िल्टर का उपयोग करें, HTTPS और ताले का प्रतीक देखें, फ़ोन पर OTP/पासवर्ड कभी साझा न करें।
Example: A phishing email may look like: From: "security@bank0fIndia.com" (note '0' instead of 'o') Subject: URGENT! Your account has been locked. Message: Click here to verify: http://bank-secure-login.xyz (fake link) Always check the actual URL by hovering over the link.
Cyber bullying is bullying that takes place over digital devices – social media, messaging apps, gaming platforms, or any online space. It includes sending, posting, or sharing negative, harmful, false, or mean content about someone else. It is repeated behaviour intended to scare, anger, or shame the target.
Forms of cyber bullying:
Impact: Anxiety, depression, low self‑esteem, academic decline, and in extreme cases, self‑harm or suicide. Victims often feel helpless because the bullying can happen 24/7 and reach them even at home.
Prevention & Response: Do not engage/respond, block the bully, save evidence (screenshots), report to platform authorities, talk to a trusted adult (parent/teacher), and if serious, file a complaint with cyber police under relevant laws (IT Act, IPC).
साइबर बुलिंग डिजिटल उपकरणों – सोशल मीडिया, मैसेजिंग ऐप, गेमिंग प्लेटफ़ॉर्म – के माध्यम से किया जाने वाला उत्पीड़न है। इसमें किसी के बारे में नकारात्मक, हानिकारक, झूठी या अपमानजनक सामग्री भेजना, पोस्ट करना शामिल है। यह बार-बार किया जाने वाला व्यवहार है जो पीड़ित को डराने, गुस्सा दिलाने या शर्मिंदा करने के लिए होता है।
साइबर बुलिंग के रूप:
प्रभाव: चिंता, अवसाद, कम आत्मसम्मान, शैक्षिक गिरावट, और गंभीर मामलों में आत्म‑हानि। पीड़ित असहाय महसूस करते हैं क्योंकि बुलिंग 24/7 हो सकती है और घर पर भी पहुँच सकती है।
रोकथाम और प्रतिक्रिया: जवाब न दें, बुली को ब्लॉक करें, सबूत (स्क्रीनशॉट) सुरक्षित रखें, प्लेटफ़ॉर्म को रिपोर्ट करें, विश्वसनीय वयस्क (माता‑पिता/शिक्षक) से बात करें, और गंभीर मामलों में साइबर पुलिस में शिकायत करें।
Summary / सारांश: Cybercrime is a growing threat with serious legal consequences under the IT Act. Hacking ranges from ethical security testing to illegal intrusion. Phishing relies on deception to steal data; cyber bullying is psychological harassment online. Awareness, digital hygiene, and knowing your legal rights are the best defences.
↑ Back to TopInformation Technology Act, 2000 (IT Act) is India’s primary law dealing with cybercrime and electronic commerce. It was enacted on 17th October 2000 and amended in 2008 to include provisions for new forms of cyber offences.
Need for the IT Act: Before 2000, there were no specific laws to tackle online crimes, electronic contracts, or digital signatures. The IT Act provides legal recognition for electronic transactions, defines cyber offences, and prescribes penalties. It gives legal validity to e‑commerce, e‑governance, and digital records.
Objectives of the IT Act:
The Act extends to the whole of India and also applies to offences committed outside India if the computer/system involved is located in India.
सूचना प्रौद्योगिकी अधिनियम, 2000 (IT Act) भारत का प्रमुख कानून है जो साइबर अपराध और इलेक्ट्रॉनिक वाणिज्य से संबंधित है। यह 17 अक्टूबर 2000 को लागू हुआ और 2008 में नए साइबर अपराधों को शामिल करने के लिए संशोधित किया गया।
IT Act की आवश्यकता: 2000 से पहले, ऑनलाइन अपराधों, इलेक्ट्रॉनिक अनुबंधों या डिजिटल हस्ताक्षरों के लिए कोई विशेष कानून नहीं था। IT Act इलेक्ट्रॉनिक लेन-देन को कानूनी मान्यता देता है, साइबर अपराधों को परिभाषित करता है और दंड निर्धारित करता है। यह ई‑कॉमर्स, ई‑गवर्नेंस और डिजिटल रिकॉर्ड को कानूनी वैधता प्रदान करता है।
IT Act के उद्देश्य:
यह अधिनियम पूरे भारत में लागू होता है और यदि संबंधित कंप्यूटर/सिस्टम भारत में स्थित है तो विदेश में किए गए अपराधों पर भी लागू होता है।
=== KEY SECTIONS OF THE IT ACT, 2000 (AMENDED 2008) ===
Section 43 : Penalty for unauthorised access, downloading, virus/malware
introduction, damaging computer systems (civil liability – fine).
Section 65 : Tampering with computer source documents (up to 3 years jail).
Section 66 : Hacking with dishonest intent (up to 3 years, fine).
Section 66B : Receiving stolen computer resources dishonestly (up to 3 years).
Section 66C : Identity theft (using another's password, digital signature, etc.)
(up to 3 years, fine up to ₹1 lakh).
Section 66D : Cheating by personation using computer resource (up to 3 years, fine).
Section 66E : Violation of privacy (capturing, publishing private images)
(up to 3 years, fine).
Section 66F : Cyber terrorism (imprisonment up to life).
Section 67 : Publishing/transmitting obscene material electronically
(first conviction: up to 3 years, fine; repeat: up to 5 years).
Section 67A : Publishing sexually explicit material (first: up to 5 years; repeat: up to 7 years).
Section 67B : Child pornography (first: up to 5 years; repeat: up to 7 years).
Section 69 : Government power to intercept, monitor, decrypt information for
national security (with safeguards).
Section 43A : Corporate bodies to protect personal data; liable to pay
compensation if negligent.
Section 72A : Punishment for disclosure of personal information in breach
of lawful contract.
The original IT Act focused on e‑commerce and digital signatures. The 2008 amendment was a major update that introduced sections for new crimes like phishing, identity theft, cyber terrorism, child pornography, and video voyeurism. It also strengthened data protection requirements for companies, gave powers to the government to block websites for national security, and defined the role of intermediaries (like internet service providers and social media platforms) in managing user‑posted content.
The amendment also introduced Section 79 – "safe harbour" provision for intermediaries, which exempts them from liability for third‑party content if they follow due diligence. However, the government can still direct them to remove content under specific conditions.
मूल IT अधिनियम ई‑कॉमर्स और डिजिटल हस्ताक्षरों पर केंद्रित था। 2008 का संशोधन एक बड़ा अद्यतन था जिसमें फ़िशिंग, पहचान चोरी, साइबर आतंकवाद, बाल अश्लीलता और वीडियो वॉयरिज़्म जैसे नए अपराधों के लिए धाराएँ जोड़ी गईं। इसने कंपनियों के लिए डेटा संरक्षण आवश्यकताओं को भी मज़बूत किया, सरकार को राष्ट्रीय सुरक्षा के लिए वेबसाइटें ब्लॉक करने की शक्ति दी, और मध्यस्थों (जैसे इंटरनेट सेवा प्रदाता और सोशल मीडिया प्लेटफ़ॉर्म) की भूमिका को परिभाषित किया।
इस संशोधन ने धारा 79 भी जोड़ी – मध्यस्थों के लिए "सुरक्षित बंदरगाह" प्रावधान, जो उन्हें तीसरे पक्ष की सामग्री के लिए दायित्व से छूट देता है यदि वे उचित सावधानी बरतते हैं। हालाँकि, सरकार फिर भी विशेष परिस्थितियों में सामग्री हटाने का निर्देश दे सकती है।
Summary / सारांश: The Indian IT Act 2000 (amended 2008) provides a comprehensive legal framework for electronic governance, e‑commerce, and cybercrime. It defines offences ranging from hacking and identity theft to cyber terrorism and imposes strict penalties. Understanding its key sections is essential for every digital citizen to know their rights and responsibilities.
↑ Back to TopE‑waste (Electronic Waste) refers to discarded electrical or electronic devices – old computers, mobile phones, TVs, printers, batteries, etc. As technology advances rapidly, the volume of e‑waste is growing dangerously. Improper disposal and informal recycling release toxic substances that harm the environment and human health.
ई‑कचरा (इलेक्ट्रॉनिक अपशिष्ट) पुराने या फेंके गए बिजली/इलेक्ट्रॉनिक उपकरणों – कंप्यूटर, मोबाइल, टीवी, प्रिंटर, बैटरी आदि को कहते हैं। तकनीक तेज़ी से बदलने के कारण ई‑कचरे की मात्रा खतरनाक रूप से बढ़ रही है। अनुचित निपटान और अनौपचारिक रीसाइक्लिंग से ज़हरीले पदार्थ निकलते हैं जो पर्यावरण और मानव स्वास्थ्य को नुकसान पहुँचाते हैं।
E‑waste contains many hazardous materials. When dumped in landfills or burned informally, these substances leak into air, water, and soil.
ई‑कचरे में कई खतरनाक पदार्थ होते हैं। जब इसे लैंडफिल में डाला जाता है या अनौपचारिक रूप से जलाया जाता है, तो ये हवा, पानी और मिट्टी में मिल जाते हैं।
=== TOXIC SUBSTANCES IN E‑WASTE === Material Found in Health / Environmental Effect ------------------------------------------------------------------------- Lead (Pb) CRT monitors, solder Brain, kidney damage; blood disorders Mercury (Hg) LCDs, switches, batteries Neurological damage, birth defects Cadmium (Cd) Batteries, chips Kidney failure, bone damage, cancer Brominated Flame Retardants (BFRs) Plastic casings, circuit boards Hormonal disruption, thyroid issues Beryllium (Be) Connectors, motherboards Lung disease, cancer PVC Cable insulation Dioxins when burned (carcinogenic) Arsenic (As) Old LEDs, LCDs Cancer, skin diseases
Proper e‑waste management minimises environmental damage and recovers valuable materials. Key strategies:
उचित ई‑कचरा प्रबंधन पर्यावरणीय क्षति को कम करता है और मूल्यवान सामग्री पुनर्प्राप्त करता है। प्रमुख रणनीतियाँ:
=== MANAGEMENT STRATEGIES === 1. REDUCE (at source) - Buy only what you need; avoid unnecessary electronics. - Choose products with longer warranty and upgradeable parts. - Use cloud storage to extend old device usefulness. 2. REUSE - Donate working old gadgets to schools, NGOs, or underprivileged. - Refurbish and upgrade instead of discarding. 3. RECYCLE - Hand over e‑waste to authorised recyclers (formal sector). - Valuable metals (gold, silver, copper, palladium) are extracted safely. - Hazardous parts are treated scientifically before disposal. 4. EXTENDED PRODUCER RESPONSIBILITY (EPR) - Manufacturers are legally responsible for collecting and recycling their end‑of‑life products. - In India, E‑Waste (Management) Rules, 2016 (amended 2022) mandate targets for producers. 5. FORMAL RECYCLING INFRASTRUCTURE - Registered dismantlers and recyclers follow environmental norms. - Proper PPE for workers, controlled processes, emission control. 6. AWARENESS & LEGISLATION - Consumer education about drop‑off points and collection drives. - Strict enforcement of laws to prevent dumping/export of e‑waste to developing countries. - Basel Convention regulates transboundary movement of hazardous waste.
The E‑Waste (Management) Rules, 2016 (effective from 2018, amended in 2022) mandate:
ई‑कचरा (प्रबंधन) नियम, 2016 (2018 से प्रभावी, 2022 में संशोधित) अनिवार्य करते हैं:
Summary / सारांश: E‑waste is a serious environmental and health hazard due to toxic materials like lead, mercury, and cadmium. Safe management involves the 3Rs (Reduce, Reuse, Recycle), formal recycling with proper safety measures, and strict legal frameworks like Extended Producer Responsibility. Every individual can contribute by disposing of electronics at authorised collection centres.
↑ Back to TopWhile technology has revolutionised our lives, prolonged and improper use of digital devices can lead to several health issues. Being aware of these risks and practising healthy habits is essential for everyone – especially students and professionals who spend long hours on screens.
Common health concerns include eye strain, posture problems, repetitive strain injuries, sleep disruption, mental health issues, and possible effects of electromagnetic radiation. Most of these can be prevented with simple, conscious changes in daily routine.
यद्यपि प्रौद्योगिकी ने हमारे जीवन में क्रांति ला दी है, फिर भी डिजिटल उपकरणों का लंबे समय तक और अनुचित उपयोग अनेक स्वास्थ्य समस्याओं को जन्म दे सकता है। इन जोखिमों के प्रति जागरूक रहना और स्वस्थ आदतें अपनाना सभी के लिए आवश्यक है – विशेषकर छात्रों और पेशेवरों के लिए जो स्क्रीन पर लंबे घंटे बिताते हैं।
सामान्य स्वास्थ्य चिंताओं में आँखों पर तनाव, मुद्रा संबंधी समस्याएँ, पुनरावृत्तीय तनाव चोटें (RSI), निद्रा में बाधा, मानसिक स्वास्थ्य समस्याएँ और विद्युतचुम्बकीय विकिरण के संभावित प्रभाव शामिल हैं। इनमें से अधिकांश को दैनिक दिनचर्या में साधारण, सचेत परिवर्तनों द्वारा रोका जा सकता है।
=== COMMON TECHNOLOGY‑RELATED HEALTH CONCERNS ===
1. DIGITAL EYE STRAIN (Computer Vision Syndrome)
Causes: Continuous staring at bright screens, glare, poor lighting, not blinking enough.
Symptoms: Dry eyes, blurred vision, headaches, difficulty focusing.
Prevention: Follow the 20‑20‑20 rule (every 20 min, look 20 feet away for 20 sec),
adjust screen brightness & contrast, use anti‑glare screen, blink often.
2. NECK, SHOULDER & BACK PAIN (Posture Issues)
Causes: Slouching, forward head posture while using phones ("text neck"),
improper chair/desk height, prolonged sitting.
Symptoms: Stiffness, chronic pain in neck/shoulders/back, spinal issues.
Prevention: Sit with back straight, feet flat on floor, screen at eye level,
take short walks every hour, do stretching exercises.
3. REPETITIVE STRAIN INJURIES (RSI)
Causes: Repeated small movements like typing, clicking, swiping for long periods.
Affected areas: Wrist, fingers, thumb ("texting thumb"), elbow.
Symptoms: Pain, numbness, tingling in hand/wrist (Carpal Tunnel Syndrome).
Prevention: Use ergonomic keyboard/mouse, take frequent breaks,
do hand/wrist stretches, maintain neutral wrist position.
4. SLEEP DISRUPTION & INSOMNIA
Causes: Blue light emitted by screens suppresses melatonin (sleep hormone);
mentally engaging content (games, social media) keeps brain alert.
Effects: Difficulty falling asleep, poor sleep quality, daytime fatigue.
Prevention: Avoid screens at least 1 hour before bed,
use "Night Mode" / blue light filters, keep devices out of bedroom.
5. MENTAL HEALTH ISSUES & ADDICTION
Causes: Excessive social media → comparison, anxiety, low self‑esteem.
Gaming addiction, fear of missing out (FOMO), information overload.
Effects: Stress, anxiety, depression, social isolation, reduced attention span.
Prevention: Set screen time limits, take "digital detox" breaks,
cultivate offline hobbies, use social media mindfully,
seek help if feeling overwhelmed.
6. HEARING LOSS
Causes: Listening to loud music/games through earphones/headphones for long durations.
Prevention: Follow the 60/60 rule (no more than 60% volume for max 60 min),
use noise‑cancelling headphones to avoid high volume in noisy places.
7. ELECTROMAGNETIC RADIATION EXPOSURE
Concern: Continuous exposure from mobile phones, Wi‑Fi routers, laptops.
Research: While no conclusive evidence of serious harm at low levels,
some studies suggest long‑term heavy use may have biological effects.
Precaution: Use hands‑free or speaker mode, keep phone away from body,
limit device use, prefer wired connections where possible.
Technology is a tool – it should enhance our life, not harm our health. Awareness and balance are the keys.
प्रौद्योगिकी एक उपकरण है – इसे हमारे जीवन को बेहतर बनाना चाहिए, नुकसान नहीं पहुँचाना चाहिए। जागरूकता और संतुलन ही कुंजी है।