Hsslive XII CS Short Notes Joy John
Hsslive XII CS Short Notes Joy John
Chapter 1
Structures and Pointers
Structure is a user-defined data type to represent a collection of different types of data under a
common name.
The dot operator (.) connects a structure variable and its element.
Self referential structure is a structure in which one of the elements is a pointer to the same
structure.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Chapter 2
Concepts of Object Oriented Programming
Procedural paradigm V/s OOP
Procedural paradigm Object Oriented Paradigm
Data is undervalued. Data is given importance.
Procedure is given importance. Procedure is driven by data.
Class V/s Structure
Class Structure
1. Contains data and functions as members. 1. Contains only data as members.
2. Access specifiers are used for members. 2. No access specifiers are used.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Chapter 3
Data Structures and Operations
Data structure is a way of organising logically related data items which can be processed as a single
unit.
Classification of data structures:
Operations on Data Structures: Traversing, searching, inserting, deleting, sorting and merging.
Stack: Data structure that follows LIFO (Last In First Out) principle.
Push Operation: Inserting a new data item into the stack at Top position. Attempt to insert an item
in a filled stack is stack overflow.
Pop Operation: Deleting an element from the top of a stack. Attempt to delete an item from an
empty stack is stack underflow.
Queue: Data structure that follows the FIFO (First In First Out) principle. A queue has two end points
- Front and Rear.
Linked list: It is a collection of nodes, where each node consists of two parts – a data and a link.
Linked list is a dynamic data structure. It is created with the help of self referential structures.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Chapter 4
Web Technology
Web server: A powerful computer that hosts websites. It is always switched on and connected to a
high bandwidth Internet connection. Example for server operating systems – Linux (Ubuntu).
Example for web server package – Apache Server.
HTML Tags
Tags Use Attributes Values and Purpose
<HTML> To start an HTML document
<HEAD> To specify the head section of an HTML document.
<TITLE> This tag pair contains the text to be displayed in the title bar of browser.
Bgcolor Colour for the background of a web page.
Background Image as the background of a web page.
Defines the body
Text Colour of the text in the web page.
<BODY> section of the web
Link To specify the colour for the link unvisited.
page.
Alink To specify the colour for the link on click.
Vlink To specify the colour for the link visited.
Links in HTML
A hyperlink (or simply link) is a text or an image in a web page, on clicking which another document
or another section of the same document will be opened. The <A> tag, called anchor tag is used to
give hyperlinks. Href is the main attribute of <A> tag. The URL (address of the web page/site) is given
as its value. There are two types of linking – internal linking and external linking.
The following is an example for e-mail linking:
<A Href= mailto: "scertkerala@gmail.com"> SCERT</A>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Operators
Arithmetic operators + – * / %
Increment, decrement ++ ––
Assignment operators = += –= *= /= %=
Relational operators < <= > >= == !=
Logical operators || && !
String concatenation +
Control Statements
if (test_expression)
Statement;
if (test_expression)
statement_1;
else
statement_2;
if (test_expression1)
if statements
statement_1;
else if (test_expression2)
statement_2;
:
:
else
statement_n;
switch (variable/expression)
{
case value1: statement1; break;
switch case value2: statement2; break;
statement :
:
default: statement;
}
for (initialization; test; update)
for loop
body;
initialization;
while (test_expression)
{
while loop
body;
update;
}
Stages of web hosting: (i) Selection of hosting type (ii) Purchase of hosting space (iii) Registration of
domain name and (iv) Transfer of files to the server using FTP.
Free Hosting: Provides web hosting services free of charge. The size of the files that can be uploaded
may be limited.
Content Management System: CMS refers to a web based software system which is capable of
creating, administering and publishing websites. Advantages: Provides standard security features,
CMS is economical. Eg: WordPress, Drupal and Joomla!
Responsive web design: Responsive web design is the custom of building a website suitable to work
on every device and every screen size, no matter how large or small, mobile phone or desktop or
television.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Chapter 8
Database Management System
Database is an organized collection of inter-related data stored together with minimum redundancy,
which can be retrieved as desirable.
Relation: A relation is also called Table. Data are organized in the form of rows and columns
Tuple: The rows (records) of a relation are known as tuples.
Attribute: The columns of a relation are called attributes.
Degree: The number of attributes in a relation determines the degree of a relation.
Cardinality: The number of rows (records) or tuples in a relation is called cardinality of the relation.
Domain: It is a pool of values in a given column of a table.
Schema: The description or structure of a database is called the database schema.
Instance: An instance of a relation is a set of tuples in it.
Relational algebra
The fundamental operations in relational algebra are SELECT(σ), PROJECT (), UNION,
INTERSECTION, SET DIFFERENCE, CARTESIAN PRODUCT, etc.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Chapter 9
Structured Query Language
Components of SQL: Data Definition Language (DDL), Data Manipulation language (DML) and Data
Control Language (DCL).
DDL commands: CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE VIEW, DROP VIEW.
DML commands: INSERT INTO, SELECT, UPDATE, DELETE FROM.
DCL commands: GRANT, REVOKE.
SQL Data Types: INT or INTEGER, DEC or DECIMAL, CHAR or CHARACTER, VARCHAR, DATE, TIME.
Operator/
Purpose Example
Function
LIKE To identify pattern matching. SELECT * FROM Student
WHERE Name LIKE “%Kumar”;
BETWEEN To identify value that falls in a SELECT * FROM Employee
... AND given range. WHERE Salary BETWEEN 10000 AND 20000;
IN To identify value from a given list. SELECT * FROM Bank
WHERE Branch IN (“Trivandrum”,
“Ernakulam”, “Kozhikode”);
IS To identify null values in a column. SELECT * FROM Stock
WHERE Tax IS NULL;
AND To select rows when two or more SELECT * FROM Student
conditions are TRUE. WHERE Batch = “Science” AND Marks > 50;
OR To select rows when any one of the SELECT * FROM Players
conditions is TRUE. WHERE Game = “Cricket” OR Game = “Hockey”;
NOT To select rows when the given SELECT * FROM Stock
condition is FALSE. WHERE Tax IS NOT NULL;
Aggregate Functions
COUNT() To count the non-null values of a column. SELECT COUNT(Fee) FROM Student;
Also used to get number of rows SELECT COUNT(*) FROM Student;
SUM() To find the sum of values in a column. SELECT SUM(Fee) FROM Student;
AVG() To find the average of values in a column. SELECT AVG(Salary) FROM Employee;
MAX() To find the highest value in a column. SELECT MAX(Marks) FROM Student;
MIN() To find the lowest value in a column. SELECT MIN(Marks) FROM Student;
View: It is a virtual table that does not really exist in the database, but is derived from one or more
tables.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Variables in PHP
A variable in PHP starts with the $ sign, followed by the name of the variable.
Arrays: (i) Indexed arrays, (ii) Associative arrays and (iii) Multi-dimensional arrays.
Indexed arrays: Arrays with numeric index are called indexed arrays. The function array() can be
used to create an array.
Associative arrays: Arrays with named keys are called associative arrays.
$array_name = array(key=>value, key=>value, key=>value, etc.);
Eg: $marks = array(“hari”=>54, “ravi”=>45, “mini”=>56);
echo $marks[“hari”]; gives 54 as output.
foreach loop
It is used when we have an array with unknown number of elements. The foreach loop works only
on arrays and has two formats.
foreach ($array as $value)
{
//code to be executed;
}
Built-in Functions
Grid Computing
It is a world in which computational power (resources, services, data) are readily available which we
can access as required. Grid computing is mainly used in disaster management, weather forecasting,
market forecasting, bio-informatics etc.
Cluster Computing
It is a form of computing in which a group of personal computers, storage devices, etc. are linked
together through a LAN so that they can work like single computer
Cloud Computing
It refers to the use of computing resources that reside on a remote machine and are delivered to the
end user as a service over a network
Cloud services are grouped into three – Software as a Service (SaaS), Platform as a Service (PaaS) and
Infrastructure as a Service (IaaS).