Blueprint of Computer Science Class XII
Blueprint of Computer Science Class XII
Types of Questions
Identify valid / invalid Identifiers. (identifiers can’t start with digit,
special characters except underscore _ and space not allowed and we can’t
use keywords as an identifier)
Functions of tuple
Functions of dictionary
Questions based on Slicing operation.
(i.e. a[0:5:1] in this 3rd parameter is most important if 3rd parameter is
positive that means you will traverse in forward direction and if 3rd
parameter is negative then we will traverse in reverse direction .
Beta isme sabse pehle question hi likh kar uski indexing kar lena means
upar forward indexing likh lena o se start karke or uske baad reverse
direction me negative indexing kar lena -1 se start karke or uske baad
question me job hi poucha ho uska output aap easily likh sakte ho.
Create a dictionary with value and key pair. ( we use curly brackets { for
dictionary and two key value pairs separated by comma and key, value
pair separated by colon. i.e. a={‘name’:”Ayushman”,”roll_no”:32,”age”:17}.
Questions based on concatenation and replication. (a=”harsh” then a*2
will be ‘harshharsh’, b=10, b*2 will be 20. c=”Deepak” d=”pal” then c+d will
be “Deepakpal”, e=10,f=20 then e+f will be 30).
Small Conceptual based Question on String or list.
Categorize or identify or difference between mutable or immutable
datatype (i.e. mutable data types : List, Dictionary Set and immutable data
types : int, float, Boolean, complex, string, tuple)
Random module (various functions in random module are random(),
randint(), uniform(), choice(), suffle(), sample()
Statistics Module (mean(), mode() , median()
Math Module ( sin(), cos(), floor(), ceil(), round(), factorial(), asin(), atan(),
copysign(), exp(), fabs(), isqrt(), sqrt(), gcd(), log(), pow(), perm(), trunc()
Built-in functions ( input(), len(), id(), type(), chr(), ord() )
Different type of functions ( Default function, positional functional ,
keyword type functions, variable length keyword type functions) definition
and example.
Formal and Actual Parameters ( difference and definition) actual
parameter and argument both are same
Local and Global variable ( difference, definition, example and scope)
Global keyword
LEGB Rule (Local Enclosed Global and Built-in)
Small conceptual program, to write function definition part.
Output based question on function. (you should careful while calling a
function and passing arguments
Break and continue differences
Global Variables are the one that are defined and declared outside a
function and we need to use them inside a function.
Local Variables: A variable declared inside the function's body and in the
local scope is known as a local variable.
Doc Strings are triple quoted string in Python module program which are
displayed as document when help command is used.
Modularity: The act of partitioning a program into individual components
(modules) is called modularity.
Parameters are variables listed within parentheses of a function header.
Stack data structure (LIFO property, characteristics, functions and
conditions)
o Stack is a linear data structure
o Stack is a list of elements in which an element to be inserted or
deleted only at one end called TOP of the stack.
o Stack follows the principal of LIFO.
Functions in Stack
PUSH: insertion of an element on the top of the stack . (i.e.
a.append(element) )
POP: Removal an element from the stack. ( i.e. a. pop() )
PEEK: To check the element at the top of list. (i.e. a[-1] )
Display: Display in reverse order (i.e. a[::-1] )
Isfull()
Conditions in stack:
def MakePop(Package):
if Package==[ ]:
print(“Underflow case “)
else:
print(“Deleted element : “, Package.pop( ))
def Push(Package):
EmpId = int(input(“Enter the employee id : “))
Ename= input(“Enter the employee name : “)
Salary=int(input(“Enter the salary of an employee: “))
a=[EmpId, Ename, Salary]
Package.append(a)
def MakePop(Package):
if Package==[ ]:
print(“Underflow case “)
else:
print(“Deleted element : “, Package.pop( ))
vowel_count = 0
consonant_count = 0
digit_count = 0
special_count = 0
space_count=0
word_count = 0
line_count = 0
f=open("abcde.txt","r")
for line in f:
line_count = line_count + 1
words = line.split()
word_count = word_count + len(words)
for i in line:
if i.lower() in "aeiou":
vowel_count = vowel_count + 1
elif i in "0123456789":
digit_count = digit_count + 1
elif i.isspace():
space_count = space_count+ 1
else:
special_count = special_count + 1
print("Vowels:", vowel_count)
print("Consonants:", consonant_count)
print("Digits:", digit_count)
print("Special Characters:", special_count)
print("Spaces:", space_count)
print("Words:", word_count)
print("Lines:", line_count)
Binary files : binary files are made up of non-human readable
characters and symbols, which require specific programs to access its
contents. File extention will be .dat
o pickle module is used while working with Binary files.
o Functions in Binary files:
load( ) it is used to read data from binary file.
Syntax: identifier = pickle.load(file_pointer)
Example: data = pickle.load(f) #here data is identifier
and f is a file pointer.
CSV files : csv module implements classes to read and write tabular data
in CSV format. It allows programmers to say, “write this data in the
format preferred by Excel. File extension will be .csv
o csv module is used while working with csv files.
o Functions in CSV files:
Reader ( ) : to read data from csv files.
Syntax: identifier = csv.reader( )
Example: data = csv.reader( )
Topologies:
Topology refers to the way in which the workstations attached to the network
are interconnected.
Some common network topologies are as follows:
Bus Topology: It uses a common single cable to connect all the workstations.
Each computer performs its task of sending messages without the help of the
central server. However, only one workstation can transmit a message at a
particular time in the bus topology.
Advantages:
• Easy to connect and install.
• Involves a low cost and installation time.
• Can be easily extended.
Disadvantages:
• The entire network shuts down if there is a failure in the central cable.
• Only a single message can travel at a particular time.
• Difficult to troubleshoot an error.
Star Topology: It is based on a central node which acts as a hub. A star
topology is common in-home networks where all the computers connect to the
single central computer, using a hub.
Advantages:
• Easy to troubleshoot.
• A single node failure does not affect the entire network.
• Fault detection and removal of faulty parts is easier.
• In case a workstation fails, the network is not affected.
Disadvantages:
• Difficult to expand.
• Longer cable is required.
• The cost of the hub and the longer cables make it expensive over others.
• In case hub fails, the entire network fails.
Tree Topology: It combines the characteristics of the linear bus and star
topologies. It consists of groups of star configured workstation connected to a
bus backbone cable.
Advantages:
• Eliminates network congestion.
• The network can be easily extended.
• Faulty nodes can be easily isolated from the rest of the network.
Disadvantages:
• Uses large cable length.
• Requires a large amount of hardware components and hence is expensive.
• Installation and reconfiguration is very difficult.
Transmission Media
Transmission media of a network refers to the connecting media used in the
network. It can be broadly defined as anything that can carry information from
a source to destination.
(A) Twisted Pair Cable : It consists of two identical 1mm thick copper wires
insulated and twisted together. The twisted pair cables are twisted in order to
reduce crosstalk and electromagnetic induction.
Advantages:
• It is easy to install and maintain.
• It is inexpensive.
Disadvantages:
• It is incapable to carry a signal over long distance without the use of
repeaters.
• Due to low bandwidth, these are unsuitable for broadband applications.
(B) Coaxial Cable : It consists of a solid wire core surrounded by one or more
coil or braided wire shields, each separated from the other by some kind of
plastic insulator. It is mostly used in the cable wires.
Advantages:
• Data transmission rate is better than twisted pair cables.
• It provides a cheap means of transporting multi-channel television signals
around metropolitan areas.
Disadvantages:
• Expensive than twisted pair cables.
• Difficult to manage and reconfigure.
(C) Optical fiber : It consists of thin glass fibres that can carry information in
the form of visible light.
Advantages:
• Transmit data over long distance with high security.
• Data transmission speed is high.
• Provide better noise immunity.
• Bandwidth is up to 10 Gbps.
Disadvantages:
• Expensive as compared to other guided media.
• Need special care while installation.
(D) Infrared: The infrared light transmits data through the air and can
propagate within a room, but will not penetrate walls. It is a secure medium of
signal transmission. The infrared transmission has become common in TV
remote, automotive lift doors, wireless speakers, etc.
Advantages:
• Power consumption is used.
• Circuitry cost is less.
• Secure mode of transmission.
Disadvantages
• Limited to a short range.
• Can be blocked by common materials like walls, people, plants, etc.
(E) Radio wave : It is an electromagnetic wave with a wavelength between 0.5
cm to 30,000m. The transmission making use of radio frequencies is termed as
radio-wave transmission.
Advantages:
• Radio wave transmission offers mobility.
• It is cheaper than laying cables and fibers.
• It offers ease of communication over difficult terrain.
Disadvantages:
• Radio wave communication is insecure communication.
• Radio wave propagation is susceptible to weather effects like rains, thunder
storms etc.
(F) Microwave : The microwave transmission is a line of sight transmission.
Microwave signals travel at a higher frequency than radio waves and are
popularly used for transmitting data over long distances.
Advantages:
• It is cheaper than laying cable or fiber.
• It has the ability to communicate over oceans.
Disadvantages:
• Microwave communication is an insecure communication.
• Signals from antenna may split up and get transmitted in different way to
different antenna which leads to reduce in signal strength.
• Microwave propagation is susceptible to weather effects like rains, thunder
storms, etc.
• Bandwidth allocation is extremely limited in case of microwaves.
Various Protocols
A protocol means the rules that are applicable for a network. It defines the
standardized format for data packets, techniques for detecting and correcting
errors and so on. A protocol is a formal description of message formats and the
rules that two or more machines must follow to exchange those messages.
Types of protocols are:
Hypertext Transfer Protocol (HTTP): It is a communication protocol for the
transfer of information on the Internet and world wide web. HTTP is a
request/response standard between a client and a server. A client is the end-
user while, the server is the website.
FTP (File Transfer Protocol): It is the simplest and most secure way to exchange
files over the Internet. The objectives of FTP are:
o To promote sharing of Files (computer programs and/or data).
o To encourage indirect or implicit use of remote computers.
o To shield a user from variations in file storage systems among different
hosts.
o To transfer data reliably and efficiently.
TCP/IP (Transmission Control Protocol/ Internet Protocol): TCP is responsible for
verifying the correct delivery of data from client to server. Data can’t be lost in the
intermediate network. TCP adds support to detect errors or lost data and to trigger
retransmission until the data is correctly and completely received.
IP is responsible for moving packet of data from node to node. IP forwards each packet
based on a four-byte destination address (the IP number). The Internet authorities
assign ranges of numbers to different organisations. The organisations assign groups
of their numbers to departments. IP operates on gateway machines that moves data
from department to organization, then to region and then around the world.
SMTP(Simple Mail Transfer Protocol): It is a standard protocol for email services
on TCP/IP network that provides ability to send and receive e-mail.
POP3 (Post Office Protocol Version3): It is a message access protocol which
allows client to fetch an e-mail from remote mail server.
Telnet is a network protocol used to virtually access a computer and to provide
a two-way, collaborative and text based communication channel between two
machines.
PPP (Point - to - Point Protocol): It is a communication protocol of the data link
layer that is used to transmit multiprotocol data between two directly connected
(point-to-point) computers. It is a byte - oriented protocol that is widely used in
broadband communications having heavy loads and high speeds.
HTTPS (Hypertext transfer protocol secure): It is the secure version of HTTP,
which is the primary protocol used to send data between a web browser and a
website. HTTPS is encrypted in order to increase security of data transfer.
• VoIP (Voice over Internet Protocol): It is a proven technology that lets anyone
place phone calls over an internet connection. With the rise of broadband, VoIP
has become the definitive choice of phone service for consumers and businesses
alike.
Network Devices
These are units that mediate data in a computer network and are also called
network equipment. Some of them are following:
• Modem: A MODEM (Modulator Demodulator) is an electronic device that
enables a computer to transmit data over telephone lines. There are two types
of modems namely, internal modem and external modem.
• RJ45 Connector: The RJ-45 (Registered Jack) connectors are the plug-in
devices used in the networking and telecommunication applications. They are
used primarily for connecting LANs, particularly Ethernet.
• Ethernet card: It is a hardware device that helps in connection of nodes within
a network.
• Hub: It is a hardware device used to connect several computers together.
Hubs can be either active or passive. Hubs usually can support 8,12 or 24
RJ45 ports.
• Switch: A switch (switching hub) is a network device which is used to
interconnect computers or devices in a network. It filters and forwards data
packets across a network. The main difference between a hub and a switch is
that hub replicates what is received on one port onto all the other ports while
switch keeps a record of the MAC addresses of the devices attached to it.
• Router: It is a hardware device which is designed to take incoming packets,
analyse packets, moving and converting packets to the another network
interface, dropping the packets, directing packets to the appropriate locations,
etc.
• Gateway: It is a device that connects dissimilar networks.
• Repeater: It is a network device that amplifies and restores signals for long
distance transmission.
• Wi-Fi card: Connects to your laptop either in your USB port or wider card slot.
This card generally is geared to a particular Wi-Fi network, so to use it you
must be in range of a wireless internet signal dedicated to that network.
Difference between HTML and XML
• WWW: The world wide web or W3 or simply the web is a collection of linked
documents or pages, stored on millions of computers and distributed across the
Internet.
HTML (HyperText Markup Language): It is a computer language that describes
the structure and behavior of a web page. This language is used to create web
pages.
• XML (Extensible Markup Language): It is a meta language that helps to
describe the markup language.
• Domain Name: It is a unique name that identifies a particular website and
represents the name of the server where the web pages reside.
• URL(Uniform Resource Locator): It is a means to locate resources such as web
pages on the Internet. URL is also a method to address the web pages on the
Internet. There are two types of URL namely, Absolute URL and Relative URL.
• Website: A collection of related web pages stored on a web server is known as
a website.
• Web browser: A software application that enables to browse, search and
collect information from the web is known as web browser.
• Web server: The web pages on the Internet are stored on the computers that
are connected to the Internet. These computers are known as web servers.
• Web hosting: Web hosting or website hosting is the service to host, store and
maintain websites on the world wide web.
Website, Webpage, Webserver, static and dynamic website, webpage, Domain
name, URL, IP Address
Switching Techniques
DATABASE MANAGEMENT
DBMS Terminologies
SQL FEATURES:
SQL is easy to learn.
SQL is used to access data from relational database management systems.
SQL can execute queries against the database.
SQL is used to describe the data.
SQL is used to define the data in the database and manipulate it when
needed.
SQL is used to create and drop the database and table.
SQL is used to create a view, stored procedure, function in a database.
SQL allows users to set permissions on tables, procedures, and views .
Super Key – A super key is a group of single or multiple keys which identifies
rows in a table.
Primary Key – is a column or group of columns in a table that uniquely identify
every row in that table.
Candidate Key – is a set of attributes that uniquely identify tuples in a table.
Candidate Key is a super key with no repeated attributes.
Alternate Key – is a column or group of columns in a table that uniquely
identify every row in that table.
Foreign Key – is a column that creates a relationship between two tables. The
purpose of Foreign keys is to maintain data integrity and allow navigation
between two different instances of an entity.
Compound Key – has two or more attributes that allow you to uniquely
recognize a specific record. It is possible that each column may not be unique
by itself within the database.
Data Definition Language (DDL) Commands: All the commands used to create,
modify or delete physical structure of an object like table. e.g., Create, Alter,
Drop.
Data Manipulation Language (DML) Commands: All the commands used to
modify contents of a table comes under this category. e.g., Insert, Delete,
Update
Transaction Control Language (TCL) Commands: These commands are
used to control transaction of DML commands. e.g., Commit, Rollback.
Aggregate functions
Constraints in MYSQL
Correct syntax of given SQL command.
SELECT
NULL
LIKE
ORDER BY
Condition using WHERE CLAUSE
BETWEEN
GROUP BY, HAVING
JOIN
COUNT
DISTINCT
UPDATE
fetchone( ) : It will return one record from the resultset as a tuple, First time, it will
fetch the first record, next time it will fetch the second record and so on.
fetchmany( n ): This method fetches n records in the form of a tuple (i.e. returns the
list of tuples.)
fetchmany( ): It returns all the records retrieved as per query in a tuple form. It will
return the list of tuples. It retrieve all the records and display them.
Rowcount: It is a variable which returns the number of rows retrieved from the last
command.
Commit( ). It lets a user permanently save all the changes made in the transaction of a
database or table.
The following steps to follow while connecting your python program with MySQL
1. Import the package required (import mysql.connector)
2. Open the connection to database
3. Create a cursor instance
4. Execute the query and store it in resultset
5. Extract data from resultset
6. Clean up the environment