LMRS Ip 2020 21
LMRS Ip 2020 21
Session: 2020-21
Class-XII
INFORMATICS PRACTICES
LAST MINUTES REVISION MATERIAL
Session: 2020-21
CHIEF PATRON
Sh. B L Morodia, Deputy Commissioner, KVS (RO), Jaipur
PATRON(S)
Shri D R Meena, Assistant Commissioner, KVS(RO), Jaipur
CONTENT COORDINATOR/LEADER
CONTENT TEAM
Sh. Sandeep Arora, PGT(CS) KV 1 Udaipur
Sh. Prem Prakash Meena, PGT(CS) KV Alwar
Sh. Navneet Sadh, PGT(CS) KV Churu
Python Revision
Intro:
• Python is a high level (close to English) and interpreted (read and executed line by line) programming
language developed by Guido Van Rossum in the 90s.
• It can be operated via shell (interactive) or script mode.
Identifier: A variable/name of the function can be any combination of letters, digits and underscore
characters. The first character cannot be a digit. Variables in Python are case sensitive.
abc (all chars) 1abc (starts with a digit)
valid _val1 (underscore, char and digits) for (it is a reserved keyword) invalid
first_name (underscore as a first&name (use of special character)
connector)
Keywords: Reserved for special use. Can’t be used as variable names. Ex. if, any, in while, else etc
Operators: Just like regular mathematics has operators so does the python, most are borrowed from
math
a, b=15,4
✓ Arithmetic: +, -,*,/,//,%,** Ex. print(a+b,a%b,a//b,a*b) O/P 19 3 3 60
✓ Comparison: <,==,>=; Ex. print(a>b, a<b, a==15) O/P True False True
✓ Logical: and, or, not; Ex. print(a>b and b<a-b) O/P True
✓ Membership: in, not in Ex. print (a in [3,41,50]) O/P False
Data Types:
✓ Number (Immutable)
✓ Integer- 52, -9
✓ Float- 23,7,-0.0003,
✓ Boolean- True, False, 2>3, 5%2==1
✓ Collection
❖ String- Ordered and immutable collection of characters, digits and special symbols. Methods: count (),
find (), isupper (), isdigit (), tolower (), etc. Ex. s1,s2 = 'अजगर', ''Sita sings the blues''
❖ List - Ordered, Heterogenous and mutable collection. Methods: count (), insert (), append (), remove (),
pop (), sort () etc. Ex. l1,l2= [1,2,3], [1109,'R Rajkumar','XII','89.25%']
❖ Tuple - Ordered, Heterogenous and immutable collection. Methods: count(), index() etc.
Ex.t1,t2= (1,2,3), (1109,'R Rajkumar','XII','89.25%')
● Common Operations:
○ * and + operator will behave same on all three.
Ex. print(s1*3) # O/P: अजगरअजगरअजगर
Ex. print(l1+l2) # O/P: [1,2,3,1,2,3]
import numpy as np O/P Note: Even though lst (list object), arr (array object)
import pandas as pd [2, 1, 1, 2, 2, 1, 1, 2] and sr (series object) have the same data. I.e. 2, 1, 1
lst=[2,1,1,2] [4 2 2 4] and 2.
arr=np.array(lst) [2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2]
When + or * operators are applied to them list behaves
sr=pd.Series(lst) 0 6
differently from both NumPy and series.
print(lst+lst) 1 3
print(arr+arr) 2 3 lst*3 prints the list elements three times, whereas sr*3
print(lst*3) 3 6 multiplies 3 to the individual elements 2,1,1 and 2.
print(sr*3) dtype: int64
• Degree: Total No. of Columns in a table is called its Degree. In the above table degree is 4.
• Cardinality: Total No of Rows in a Table is Called its Cardinality. In the above table cardinality is
5. (Note, while calculating cardinality we do not count the header row.)
TIP: Degree →Column (DC : Direct Current ) ; Cardinality → Row (CR : Credit Ratio) Both C not
together
Q . A table has 4 rows and 6 column find its degree and cardinality. [1 or 2 Marks]
Ans. Degree 6 ; Cardinality 4
Q. A table has 6 rows and 5 columns. 2 insert operations are performed on it. Find the new degree and
cardinality of the table? [1 or 2 Marks]
Ans. Degree 5; Cardinality 8
6 ALTER TABLE
To modify the structure of the table. i.e. add a new attribute, delete an existing attribute, change
to size and data type of a new attribute, renaming an attribute
i. ALTER TABLE EMP ADD MOBILE INT(10) → Adding attribute
Ii ALTER TABLE EMP DROP MOBILE; → Deleting/removing attribute
Iii ALTER TABLE EMP MODIFY ENAME VARCHAR(25); → Changing data type and size of attribute
ALTER TABLE EMP MODIFY EMPID INT(4);
iv ALTER TABLE EMP CHANGE ENAME EMP_NAME VARCHAR(25); → renaming attribute
7 DROP TABLE <TABLENAME>
To Delete/remove a table from the database. Drop Table emp;
8 DESCRIBE / DESC
To view the structure of the table. Desc emp;
9 Show Tables
To view the names of the tables in the current database. Show Tables;
SQL COMMANDS
Data Manipulation Language (DML)
1 INSERT
To add new record or records into a table
INSERT INTO EMP VALUES(101,”RAKESH SHARMA”,’1995-05-10”, ”MANAGER”, ”REGULAR”,
12345678911, 50000, ”SALES”);
2 DELETE
To Remove tuples from a table.
DELETE FROM <tablename> WHERE <Condition>;
DELETE FROM emp WHERE Ename = ’Rakesh Sharma’;
3 UPDATE
To modify or change the data in the tables
UPDATE <tablename>
SET Attribute1=<new value>, Attribute2=<new value>,…
WHERE <Condition>
Update emp set sal = sal = 50 where deptno =30;
KVS Regional Office Jaipur| Session 2020-21 Page 10 of 19
4 SELECT [3+2 Marks/Query / Output ]
To view / show / fetch / extract rows or tuples from table(s) or relation(s)
SELECT Attribute list/*
FROM table name(s)
WHERE Condition
ORDER BY Attribute name
GROUP BY Attribute name
HAVING Condition
DISTINCT, AS, AND, OR, NOT, IN / NOT IN, BETWEEN / NOT BETWEEN, IS NULL / IS NOT NULL
5 SINGLE ROW FUNCTIONS
NUMERIC FUNCTIONS – [1 Mark / Output Based]
- POW(X,Y) - x raise to the power of y Select Pow(8,2); → 64
- MOD(X,Y) - Remainder of X/Y Select MOD(80/12) → 8
- ROUND(N,D) - Rounds number N upto given D Select Round(123.7898,2); → 123.79
no. of digits
- SIGN(N) - If N is position then output 1, Select SIGN(-165); → -1
negative then -1 and Zero then output is 0 Select SIGN(0) ; → 0
- SQRT(X) – Returns square root of X Select SQRT(144): → 12
SRING/CHARACTER FUNCTIONS [1 Mark / Output Based]
- LENGTH(STR) : Find Number of characters in Select LENGTH(‘APPLE’) → 5
given string.
- CONCAT(STR1,STR2,STR3….) : Joins the given select CONCAT('Ken', 'driya');
strings one after the other. → 'Kendriya'
- UPPER(STR)/UCASE(STR): Converts lower case Select UPPER('Kendriya') → 'KENDRIYA'
alphabets of given string alphabets to Upper Select UPPER('orange') → 'ORANGE'
case. Other charters remain as it is.
- LOWER(STR)/LCASE(STR) : Converts Upper Select LOWER('Kendriya') → 'kendriya'
case alphabets of given string alphabets to Select LOWER('ORANGE') → 'orange'
lower case. Other charters remain as it is.
- LTRIM(STR): Removes Spaces on left side of Select LTRIM(‘ APPLE IS RED ‘);
given string. → ‘APPLE IS RED ‘
- RTRIM(STR) : Removes Spaces on Right side Select RTRIM(‘ APPLE IS RED ‘);
of given string. → ‘ APPLE IS RED‘
- TRIM(STR) : Removes both leading (left) and Select TRIM(‘ APPLE IS RED ‘)
Trailing (right )Spaces from given string. → ‘APPLE IS RED ‘
- LEFT(STR,N) : extract N characters from left Select LEFT('Kendriya',4) → 'Kend'
side of given String
- RIGHT(STR,N) : extract N characters from Select RIGHT('Kendriya',4) → 'riya'
right side of given String
- INSTR(STR,SUBTRING) : returns the position Select INSTR("apple", "p"); →2
of the first occurrence of a string in another
string.
- SUBSTR(STR, position, no. of characters) or Select MID('Kendriya',4,2) → 'dr'
MID(STR, position, no. of characters)
Introduction to Internet: The Internet is a vast network that connects computers all over the world.
URL : Uniform Resource Locator : address of a given unique resource on the Web.
e.g. http://www.example.com/index.html
Domain Name: A domain name is the permanent address of a website on the Internet.
e.g. www.yahoo.com
WWW: World Wide Web : also known as a Web, is a collection of websites or web pages stored in web
servers and connected to local computers through the internet.
Web Site: a set of related web pages located under a single domain name, typically produced by a single
person or organization.
Web: is a collection of websites or web pages stored in web servers and connected to local computers
through the internet.
Email: is an Internet service that allows people who have an e-mail address (accounts) to send and receive
electronic letters. These letters may be plain text, hypertext or images. We can also send files with email
using attachments.
Chat : is a way of communication, in which a user sends text messages through Internet. The messages can
be send as one to one communication (one sender sending message to only one receiver) or as one to
many communication (one sender sending a message to a group of people)
VoIP: Voice over Internet Protocol: is a technology that allows you to make voice calls using an Internet
connection instead of a regular (or analog) phone line.
Difference between a Website and webpage
Webpage Website
Webpage is a single document on the Internet Website is a collection of multiple webpages with
information on a related topic
Each webpage has a unique URL. Each website has a unique Domain Name
Static Web Page: A static web page (sometimes called a flat page or a stationary page) is a web page that is
delivered to the user's web browser exactly as stored. i.e. static Web pages contain the same prebuilt content
each time the page is loaded
Dynamic web page: The contents of Dynamic web page are constructed with the help of a program. They may
change each time a user visit the page. Example a webpage showing score of a Live Cricket Match.
Web Server: Web server is a computer where the web content is stored. Basically web server is used to host
the web sites
KVS Regional Office Jaipur| Session 2020-21 Page 15 of 19
Hosting of a Website: When a hosting provider allocates space on a web server for a website to store its files,
they are hosting a website. Web hosting makes the files that comprise a website (code, images, etc.) available
for viewing online
Web Browser: A web browser (commonly referred to as a browser) is a software application for accessing
information on the World Wide Web. e.g. Internet Explorer, Google Chrome, Mozilla Firefox, and Apple Safari.
Add-ons/plug-ins : is a software component that adds a specific feature to an existing computer program.
Cookies: are combination of data and short codes, which help in viewing a webpage properly in an easy and fast
way. Cookies are downloaded into our system, when we first open a site using cookies and then they are stored
in our computer only. Next time when we visit the website, instead of downloading the cookies, locally stored
cookies are used. Though cookies are very helpful but they can be dangerous, if miss-utilized.
Protocols: Protocols are set of rules, which governs a Network communication. Or set of rules that determine
how data is transmitted between different devices in a network.
HTTP : Hyper Text Transfer Protocol : HTTP offers set of rules and standards which govern how any
information can be transmitted on the World Wide Web
HTTPs : Hypertext Transfer Protocol Secure: It is advanced and secure version of HTTP.
TCP/IP : Transmission Control Protocol / Internet Protocol : determine how a specific computer should be
connected to the internet and how data should be transmitted between them.
FTP : File Transfer Protocol : Transfer file(Upload/ Download) files to or from a remote server.
SMTP : Simple Mail Transfer Protocol : purpose is to send, receive, mail between email senders and
receivers.
POP3 : Post Office Protocol version 3 : standard protocol for receiving e-mail.
VoIP : Voice Over Internet Protocol :
HTTP HTTPs
HTTP is unsecured HTTPS is secured
HTTP sends data over port 80 HTTPS uses port 443
Hints to solve Case Study based Question: [5 Marks Generally last ques. in QP]
Question Type Hint Answer
Circuit Diagram Connects all the units in the question with a unit having
maximum no. of computers
Best Place to host Server Unit having Maximum no. of computers
Placing of Switch/Hub In each unit
Placing of Repeater Between units where distance is more than 100m
Most economical Communication Broadband
medium
Communication media for small Ethernet Cable
Distance < 100 m
Communication Media for Radio Waves,
Desert areas
Communication Media for Hilly Radio Waves/ Microwaves
Areas
Hardware/Software to prevent Firewall
unauthorized access
Think before posting on a public platform don’t post too much personal info online
No copyright Share the Respect Respect Avoid cyber Don’t feed the
violation expertise privacy diversity bullying troll
Communication Etiquettes
Be Precise Be Polite Be Credible
Social Media Etiquettes
Be Secure Be Reliable
Choose a strong Know who beware of Think before you upload
password you befriend fake info
3. Intellectual property rights (IPR) allow its owners to exclude/include some third parties in order to
grant permission to access/modify his/her work through licensing while retaining ownership.
licensing of intellectual property: Technology Transfer, Trademark, Copyright and Patent
4. Plagiarism is the act of using or passing off someone else’s work as your own without giving proper
credit to the original creator.
crime or not: Under normal circumstances, it is considered a morally unethical issue but not a crime.
If a copyrighted work is copied without permission then it becomes a crime.
How to detect: Blockchain technology can be used to counter plagiarism. Services like Turnitin and
Grammarly are already used in academia to detect plagiarism.
One has to explicitly choose, or create, the license. It exists, without me doing anything to assert it,
It does not apply automatically. from the moment of creation.
Ex. When you are given a licence of the book from Ex. When you buy a book, you’re buying the
the copyright owner. You may republish or sell it printing copy of the book. You’re not buying the
under your name. copyright in the book.
Rootkit: Can’t be removed Trojan Horse: looks like useful Adware: unwanted software that
very easily from within the os software but contains malware bombards advertisements
8. Cyber Law: “law governing cyberspace”. It includes freedom of expression, access to and usage of the
internet, and online privacy. The issues addressed by cyber law include cybercrime, e-commerce, IPR,
Data Protection.
Indian IT Act, 2000 and amendment in 2008 is the cyber law of India.
● Guidelines on the processing, storage and transmission of sensitive information
● Cyber cells in police stations where one can report any cybercrime
● Penalties Compensation and Adjudication via cyber tribunals
9. E-waste: Various forms of electric and electronic equipment that have ceased to be of value to their
users or no longer satisfy their original purpose. Include TV, headphone, cell phone etc.
Hazards: It consists of a mixture of hazardous inorganic and organic materials.
● If mixed with water and soil creates a threat to the environment.
● Burning/Acid bath creates hazardous compounds in the air we breathe.
Management: Sell back, gift/donate, reuse the parts, giveaway to a certified e-waste recycler.
10. Technology and Health:
- Health apps and gadgets to monitor and alert. - Physical: Eye strain, Muscle Problems. Sleep
- Virtual Doctor issues, Depression etc
- VR games to improve fitness in a fun manner - Social: emotional issues, isolation, anti-social
- Online medical records.
behaviour etc