Hsslive-Xii-Arike Comp App 2025
Hsslive-Xii-Arike Comp App 2025
in ®
COMPUTER
APPLICATION
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Chapter 1
Review of C++ Programming
Tokens
Fundamental building blocks of C++ program. (Lexical units)
Classification: (POLIK)
1. Punctuators: Special symbols used in C++ program. Eg: # ; ( ] }
2. Operators: Symbols that indicate an operation. Eg: +, <, *, &&
3. Literals(Constants): Constant values used in program.
(a) Integer literals: Whole numbers. Eg: 23, -145
(b) Floating literals: Constants having fractional parts. Eg: 12.5, 1.87E05
(c) Character literals: A character in single quotes. Eg: „a‟, „8‟
(d) String literals: One or more characters within double quotes. Eg: “a”, “score1”
4. Identifiers: Names given to different program elements.
(a) Variable: Name given to memory location.
(b) Label: Name given to a statement.
(b) Function name: Name given to a group of statements.
Rules to form an identifier:
(a) Can have only alphabets(upper and lower),digits and _(underscore).
(b) Cannot be keywords.
(c) Cannot start with digit.
5. Keyword (Reserved word): They convey a specific meaning to the compiler.
Eg: float, if, break, switch
Data types: Used to identify nature and type of data stored in a variable.
Fundamental datatypes:
207
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
const Keyword
The const keyword specifies that the value of a variable does not change throughout the
program.
syntax :const data type variable_ name = value;
Eg:constfloat pi=3.14;
Control Statements
Control statements are used for altering the normal flow of program execution
They are classified into two
Control Statements
The statements provided by C++ for the selected execution are called decision making statements
or selection statements.
if statement
if...else statement
Decision making
statements
nested if
else if ladder
switch statement
208
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
209
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Conditional Operator (? :)
It is a ternary operator (it takes three operands).
The conditional Operator can be used as an alternative of if... else statement
The syntax is: Condition? True-part: false-part;
The condition is true the result is the true part, else the result is the false-part.
Eg: big = (a>b)? a: b;
Iteration statements
Iteration statements or looping statements are used to perform repeated execution of a set of one or
more statements.
C++ provides three looping statements: while loop, for loop and do...while loop.
for loop
Entry control loop
while loop
Iteration/Looping
statements
Entry controlled loop means condition is executed before loop body. The loop will run only if
condition is true
Exit controlled loop means condition is executed after loop body. the loop will run at least once
even if condition is true/false
A Looping statement has four elements:
a) Initialization - statement that gives starting value to loop variable eg:(i=1)
b) Condition – the test expression. eg: (i<=10)
c) updation – statement that changes the value in loop variable eg: (i++)
d) Body of loop- set of statements to execute repeatedly eg:((cout<<i;)
1. while loop
It is an entry-controlled loop.
The condition is checked first and if it is found True the body of the loop will be executed.
The syntax is:
initialization;
while(test expression)
{
body of the loop;
update statement;
}
}
2. for loop
It is an entry-controlled loop.
The condition is checked first and if it is found True the body of the loop will be executed.
The syntax is:
210
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
{
Body of the loop;
}
3. do...while loop
It is an exit controlled Loop.
Here, the test expression is evaluated only after executing body of the loop.
Its syntax is:
initialization;
do
{
body of the loop;
update statement;
} while(test expression);
Nested loop
Placing a loop inside body of another loop is called nested loop.
A nested loop contains an inner loop and an outer loop.
In a nested loop, the inner loop statement will be executed repeatedly as long as the condition of the
outer loop is true.
Example
for( int i=1; i<=5; i++)
{
for(int j=1; j<=i; j++)
{
cout<< i << " " ;
}
cout<<”\n”
}
Jump statements
Jump statements transfers program control from one place to another part of a program
Jump statements
211
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
continue statement is executed in a loop it skips the remaining statements in the loop and start next
iteration of the loop.
Example
for (int i=1; i<=10; i++)
{
if (i==5)
continue;
cout<<i<<",";
}
its output will be 1,2,3,4,6,7,8,9,10
3.goto
goto statement is used for unconditional jump.
goto transfers the control from one part of the program to another
Syntax of goto is
label: ............;
............;
............;
goto label;
............;
Example
int i=1;
start:
cout<<=10)
goto start
its output will be 1 2 3 4 5 6 7 8 9 10
exit( ) helps to terminate a program.
CHAPTER 2 - ARRAYS
Array
Array is a collection of elements of same type placed in contiguous memory location
Each element in an array can be accessed using its position called index number or subscript.
An array index starts from 0
The elements of an array with ten elements are numbered from 0 to 9.
Array declarations
Data_type array name[size];
where size is the number of memory locations in the array.
Eg: int a[10] ;
212
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Declares an array of size 10, where the first element is at a[0] and the last element is at a[9].
Array initialization
Giving values to the array elements at the time of array declaration is known as array initialization.
Eg : int N[10]={12,25,30,14,16,18,24,22,20,28} ;
char word[7]={'V' , 'I' , 'B' , 'G' , 'Y' , 'O' , 'R' } ;
Memory allocation for arrays
Total bytes = size of data type x size of the array
Eg:
o The number of bytes needed to store the array int A[10] is 4 x 10=40 bytes.
o The number of bytes needed to store the array float B[5] is 4 x 5 = 20 bytes.
CHAPTER 3 - FUNCTIONS
Modular Programming / Modularization
The process of breaking large programs into smaller sub programs is called modularization.
213
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Function
Function is a named unit of statements in a program to perform a specific task.
functions are classified into two types
Functions
Arguments / Parameters
A parameter is a named variable passed into a function
Eg: cup=makeCoffee(water,milk,sugar,coffee powder) here makeCoffee is a function name and
water ,milk ,sugar ,coffee powder is arguments
Return value
The result obtained after performing the task assigned to a function. Some functions do not return
any value
Built-in functions
get()
Input Function
Stream functions for I/O getline()
operations
Header file : iostream put()
Output Function
write()
strlen()
strcpy()
String functions
strcat()
Header file : cstring
Predefined functions/
strcmp()
built-in functions
strcmpi()
abs()
Mathematical functions
sqrt()
Header file : cmath
pow()
isupper()
islower()
isalpha()
Character functions
isdigit()
Header file : cctype
isalnum()
toupper()
tolower()
214
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
215
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
4. Mathematical functions
A. abs( )
used to find the absolute value of a number
Header file : cmath
Syntax : int abs( int) ;
Eg : cout<<abs(-5) ; // displays 5
B. sqrt( )
used to find the square root of a number
Header file : cmath
Syntax : double sqrt(double) ;
Eg : cout<<sqrt(16) ; // displays 4
C. pow( )
used to find the power of a number
Header file : cmath
Syntax : double pow(double, double) ;
Eg: cout<<pow(3,2) ; // displays 9
5. Character functions
isupper( )
used to check whether a character is in upper case(capital letter) or not.
216
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
islower( )
used to check whether a character is in lower case(small letter) or not.
Header file : cctype
Syntax : int islower (char) ;
Eg : cout<<islower('A') ; // displays 0
isalpha( )
used to check whether a character is an alphabet or not.
Header file : cctype
Syntax : int isalpha(char) ;
Eg : cout<<isalpha('B') ; // displays 1
cout<<isalpha('8') ; // displays 0
isdigit( )
used to check whether a character is digit or not
Header file : cctype
Syntax : int isdigit(char c) ;
Eg : cout<<isdigit('5') ; // displays 1
cout<<isdigit('r') ; // displays 0
isalnum( )
used to check whether a character is alphanumeric or not.
Header file : cctype
syntax : int isalnum(char) ;
Eg : cout<<isalnum('8') ; // displays 1
cout<<isalnum('+') ; // displays 0
toupper( )
used to convert the given character into its uppercase.
Header file : cctype
Syntax : char toupper(char) ;
Eg : cout<<toupper('b') ; // displays B
tolower( )
used to convert the given character into its lower case.
Header file : cctype
Syntax : chat tolower(char) ;
Eg : cout<<tolower('B') ; // displays b
217
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
function prototype
A function prototype is the declaration of a function by which compiler is provided with the
information about the function such as the name of the function, its return type, the number and
type of arguments, and its accessibility.
Syntax : data_type function_name(argument list);
Ordinary variables are used as formal Reference variables are used as formal
parameters. parameters.
Actual parameters may be constants, Actual parameters will be variables only
variables or expressions.
Exclusive memory allocation isrequired for Memory of actual arguments is shared by
the formal arguments. formal arguments.
The changes made in the formal arguments The changes made in the formal do reflect in
do not reflect in actual arguments actual arguments.
218
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Default argument
A default argument is a value provided in a function declaration that is automatically assigned by the
compiler if the calling function doesn‟t provide a value for the argument.
Scope and life of variables and functions
Local variable -The variables declared within the body of Function are called local variables
Global variable -The variables declared outside any function and which are accessible to all functions are
called global variables
Local function- A function which is declared inside the body of another function is called a local function.
Global function - A function declared outside the function body of any other function is called a global
function
4 - WEB TECHNOLOGY
Website
Web page is a document available on World Wide Web.
A web page contains huge information including text, graphics, audio, video and hyper links.
Website is a collection of web pages.
Web pages are developed with the help of HTML (Hyper Text Markup Language).
Web server
A web server is a powerful computer that hosts websites.
A web server enables us to deliver web pages or services like e-mail, blog, etc.
A web server is a computer that process request and distributes information.
A web server can have single or multiple processors, fast access RAM, high performance hard disks,
Ethernet cards that support fast communication.
Software ports
Software ports are used to connect client computer to server computer.
It is a 16-bit number.
Some of the commonly used ports and services are:
PORT NO SERVICE
20&21 FTP
22 SSH
25 SMTP
53 DNS
80 HTTP
110 POP3
219
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
443 HTTPS
DNS Server
DNS Server used to resolve (Convert) domain name into IP.
The process of translating domain name to IP address is called name resolution.
The internet contains thousands of interconnected DNS servers.
When you type a URL in your browser, the browser contacts the DNS server to find IP address.
Web designing
Web designing is the process of designing attractive web sites.
Any text editor can be used to design web pages. Eg: notepad, geany, sublime text etc..
Scripts
Scripts are program codes written inside HTML pages.
Script are written inside <SCRIPT> and </SCRIPT> tags.
The commonly used scripting languages are java script,VB script,PHP etc
220
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<HEAD> Tag
It is a container tag used to specify the details of a webpage like title, scripts, CSS etc
<TITLE> Tag
The <TITLE> tag defines the title of the HTML document.
<BODY> Tag
The <BODY> Tag defines the body section of HTML document.
The main attributes of <BODY> tag are,
1)Bgcolor:-It specifies the background color of the document.
2)Background:-It specifies the background image for the document.
3)Text:-It specifies the colour of Text displayed on the document.
4)Link:-It specifies the colour of unvisited link.The default colour is blue.
5)Alink:-It specifies the colour of active link.The default colour is green.
6)Vlink:-It specifies the colour of visited link.The default colour is purple.
7)Leftmargin: -Specifies the left margin from where the text in the body appears.
8)Topmargin:-Specifies the top margin from where the text in the body appears.
Headings in HTML
HTML supports headings from <H1> to <H6>.
An important attributes of heading tags is Align.
It has three values Left,Right,Center
<P>Tag
The <P> tag is used to create paragraph
Attributes of <P> tag is Align
It has three value, left,right,center or justify.
<BR> Tag
The <BR> tag is used to insert a line break.
<HR> Tag
The <HR> tag is used to create a horizontal line in HTML.
Attributes of <HR> Tag
221
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<CENTER> Tag
It is a container tag used to display contents to the center of webpage.
The content can be text,image,table etc.
<PRE> Tag
The <PRE> tag defines preformatted text
It is a container Tag used to display a text exactly in its original form that we typed in Text editor
<ADDRESS> tag
It is container tag used to display a postal address
The information may include name, phone numner,e-mail, address etc.
The contents enclosed in <address> tag will be displayed in Italics similar to <i> tags
<MARQUEE> Tag
The <MARQUEE> tag defines the text that scrolls across the user‟s display.
Attributes of <MARQUEE> tag
The important attributes of <MARQUEE> tag are,
Height and Width:-It determines the size of marquee area.
Hspace and Vspace:-It defines the space between marquee and the surrounding text.
Scrollamount and Scrolldelay:-These attributes control the speed and smoothness of scrolling
marquee.
Behaviour:-It defines the type of scrolling. It has three values scroll, slide and alternate.
Loop:-It specifies how many times the marquee text must scroll. The default value is endless.
Direction:-It specifies the direction of scroll.
<DIV> Tag
The <DIV> tag defines a division or a section in an HTML document.
Attributes of <DIV> tag is align,id,style
<FONT> Tag
The <FONT> tag allows to define size,colour,style of text.
Attributes of <FONT> Tag is
Face:-It specifies the font name.
222
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<IMG> tag
The <IMG> tag is used to insert image in a web page.
Attributes of <IMG> tag are,
Src:-It specifies the name of image.
Align:-It controls alignment of the image (TOP,MIDDLE or BOTTOM).
Width:-It specifies the width of the image.
Height:-It specifies the height of the image.
Alt:-It defines the text to be displayed if the browser cannot display the image.
Vspace and Hspace:-Controls the vertical and horizontal spacing between images in the web
page
1. Unordered lists
3. Definition list
1. Unordered lists
Unordered list display a bullet or graphic symbol in front of each item.
<UL> Tag is used to create Unordered List.
Each list item is added using <LI>
Important attribute of UL tag is Type
Values in Type attribute are : Disc , Square, Circle
Eg: <UL Type= "Disk">
223
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<DT>computer :</DT>
<DD> A computer is a digital electronic machine</DD>
Nested lists
A list inside another list is called nested list.
Eg: an ordered list inside another ordered list, an unordered list inside an unordered list, etc
Types of linking
Link
2. Internal Linking
Link to a particular section of same document is known as internal linking.
Name attribute of <A> is used for internal Linking.
Eg: Eg. <a name=”Introduction”> Introduction</a>
Then we can link to this section as
<a href=”#Introduction”> Go to Introduction</a>
E-mail Linking
mailto: protocol is used to create email linking
224
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
225
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Nesting of Framesets
Placing frameset tag inside another frameset tag is known as nesting of frames
<NOFRAMES> tag is used to display some text content in the window if browser does not support
frames
<INPUT> Tag
Its a an empty tag different types form controls
Type , Name ,Value , Size and Maxlenght are attributes of <INPUT>
Value of Type attribute is
Value Description
text Text Box
password checkbox Text box enter to password
checkbox Check box control
radio Radio button control
reset RESET button
submit SUBMIT button
button A standard button
<TEXTAREA> Tag
It is used to create multiline text box.
Important attributes of <TEXTAREA> tag are ,
Name , Rows, Cols
<SELECT> tag
It is used to create Dropdown list (or Select Box) in a form.
Important attributes of <SELECT> tag are
Name , Size, Multiple
<OPTION> allows to add each items to the dropdown list.
<fieldset> tag
The <fieldset> tag is used to group related elements in a form.
The <fieldset> tag draws a box around the related elements.
The <legend> tag is used to define a caption for the <fieldset> element.
226
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<SCRIPT>Tag
<SCRIPT> tag is used to include scripting code in an HTML page.
Important attribute of <script> tag is language and type
Language Attribute – To Specify the Scripting Language.
Example:- <SCRIPT Language="javascript">
...................................................
...................................................
</SCRIPT>
How to design a web page using Java Script
<HTML>
<HEAD> <TITLE> sample title </TITLE> </HEAD>
<BODY>
<SCRIPT Language= "JavaScript">
document.write("Welcome to wayanad.");
</SCRIPT>
</BODY>
</HTML>
This program is saved with .html extension.
document.write ():-This command is used to display a text in the body of a webpage.
227
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Variables in JavaScript
var keyword is used for declaring all type of variable.
Variable is used for storing a value.
Example: var x,y;
X=10;
Y=”wayanad”;
Here, the variable x is number data type and y is String data type
Operators in JavaScript
Arithmetic Operators
Operator Description Example
+ Addition c= a+b
- Subtraction c= a-b
* Multiplication c= a*b
/ Division c= a/b
% Modulus c= a%b
++ Increment c= ++b
-- Decrement c= --b
Assignment Operators
Operator Description Example Meaning
= Assignment A=B
+= Add and Assignment A+=B A=A+B
-= Subtraction and Assignment A-=B A=A-B
*= Multiplication and Assignment A*=B A=A*B
/= Division and Assignment A/=B A=A/B
%= Modulus and Assignment A%=B A=A%B
Relational Operators
Operator Description Example
== Equal to a==b
!= Not equal a!=b
< Less than a<b
> Greater than a>b
<= Less than or Equal to a<=b
>= Greater than or Equal to a>=b
Logical Operators
Operator Description Example
&& AND C= a && b
|| OR C= a || b
! NOT C= !a
228
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Control structures are used to alter the normal sequence of execution of a program.
1) if statement
The if statement executes a group of statements based on a condition.
The syntax is
if(test_expression)
{
Statements;
}
2) Switch statement
The Switch statement is a multi-branching statement,
It is executes statement based on value of the expression.
The syntax is
switch(expression)
{
case value1:statement1;break;
case value2:ststement2;break;
- -----------------------
Default: statement;
}
3) for ............Loop
The for loop executes a group of statements repeatedly.
The syntax is
while(expression)
{
statements;
}
String addition operator (+)
The JavaScript concatenation operator is a plus sign (+).
This operator lets you add the contents of two or more strings together to create one larger string
Example: x = “Java”;
y = “Script”;
z = x + y;
The + operator will add the two strings and the variable z will have the value JavaScript.
229
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
7 - WEB HOSTING
Web Hosting
It is the process of providing storage space in web server for a web site.
The companies that provide web hosting services are called web hosts.
230
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
I. Shared hosting
In this type, more than one web site is stored in a single web server.
This is the most common type of web hosting.
Characteristics
Suitable for small web sites.
Cheaper and easy to use
Less service/performance
Characteristics
Suitable for secure and high performance web sits.
Expensive
More service/fast service
231
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Free hosting
Web hosting service in free of charge is called free hosting (No money).
Limitations:
Limited size of file can be uploaded.
Advertisements from the service provider
Audio/video may not be permitted
Chapter 8
Database management System
Concept of Database
A database is a collection of data.
A DBMS (Data Base Management System) is a set of programs used to create access and maintain a
database
Advantages of DBMS
Advantages of DBMS
Data Data
Redundancy Redundancy Efficient Data Data Data Enforces Crash Sharing of
can be can be data access integrity integrity Security standard Recovery data
avoided avoided
232
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
8) Crash Recovery:-
A DBMS provides a mechanism for data backup and recovery from crash/hardware failure.
Components of DBMS
Components of DBMS
1) Hardware:-
Hardware includes computers (Server, PC etc), storage devices (hard disk, magnetic tape) and
other devices for data storage and retrieval.
2) Software:-
The Software consists of DBMS, application programs and utilities.
Application programs are used to access data in database to generate reports, tabulations, etc.
Utilities are the software tools used to manage the database system.
3) Data:-
The database should contain all the data needed by the organization.
The database contains Metadata (data about data) and operational data.
The data in the DBMS is organized in the form of Field, Record and Files.
Field:-A field is the smallest unit of stored data. Eg. Roll No, Name, Place etc.
Record:-A record is a collection of related fields. For eg. 1001, Rajesh, Kollam
Files:-A files is a collection of records of same type.
4) Users:-
The users access the database by using application programs.
5) Procedure:-
Procedures are rules and instructions that govern the design and use of a database.
Database Abstraction
Abstraction is the process of hiding the complex background details of a DBMS from its users.
1) Physical Level:- view level
It is the lowest level of abstraction. view1,view2,...........view n
It describes how data is actually stored in a secondary storage
medium like magnetic disk or tape. Logical Level
2) Logical Level(Conceptual Level):-
Logical level describes what data are stored in the database and what Physical Level
relationship exists between data.
That is, the data type, format of data etc are hidden from users.
Logical level abstraction is used by database administrator.
3) View Level:-
This is the highest level of database abstraction and is closest to the users.
It is concerned with the way in which individual users view the data.
Data Independence:
Data Independence is the ability to modify the schema (structure of database) at one level without
affecting the database structure at next higher level.
1) Physical data independence:
It is the ability to modify the schema at the physical level without affecting the schema at the
logical level.
2) Logical data Independence:
It is the ability to modify the schema at the logical level without affecting the schema at the
view level.
Different users of database
233
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Application Programmer
Data base users
Sophisticated Users
Naive Users
Database Administrator (DBA):
A database administrator is a person who has central control over the database.
The main duties of a DBA are
Design of the Physical and Logical Schema
Security and Authorization
Data availability and recovery from failure
Application Programmer:-
Application programmers are computer professionals who interact with the database through
application programs written in any languages such as C, C++, Java etc.
They interact with the data base using DML. (Data Manipulation Language).
Sophisticated Users:-
Sophisticated users interact with database through their own queries (request to database) for
their complicated needs.
They include engineers, analyst, scientists etc.
Naive users:-
Naive users interact with database by invoking previously written application programs.
Naive users include billing clerk in a super market, bank, hotel, clerical staff in an office etc.
Relational data model
Database represented as a collection of tables called relation
The database products based on relational model (table) are known as Relational Database
Management System (RDBMS)
Some of the popular RDBMS are Oracle, MYSQL, DB2 etc.
Terminologies in RDBMS
a. Entity
An entity is a person or a thing in the real world that is distinguishable from others.
b. Relation
Relation is a collection of data elements organized in terms of rows and columns.
A relation is also called Table.
c. Tuple
The rows (records) of a relation are generally referred to as tuples.
A row consists of a complete set of values used to represent a particular entity.
d. Attribute
The columns of a relation are called attributes.
AdmNo, Roll, Name, Batch, Marks and Result are attributes of the STUDENT relation.
e. Degree
The number of attributes in a relation determines the degree of a relation.
234
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
The relation STUDENT has six columns or attributes and therefore the degree of the
STUDENT relation is 6.
f. Cardinality
The number of rows or tuples in a relation is called cardinality of the relation.
The relation STUDENT has eight tuples and hence the cardinality of the STUDENT relation
is 8.
g. Domain
A domain is a pool of values from which actual values appearing in a given column are
drawn.
For example, the domain of the column Batch in the relation STUDENT is the set of values
{Science, Humanities, Commerce}.
h. Schema
The description or structure of a database is called the database schema, which is specified
during database design.
i. Instance
An instance of a relation is a set of tuples in which each tuple has the same number of fields
as the relational schema.
Keys
A key is an attribute or a collection of attributes in a relation that uniquely distinguishes each
tuples from other tuples in a given relation.
a. Candidate key
A candidate key is the minimal set of attributes that uniquely identifies a row in a relation.
In the STUDENT relation, AdmNo can uniquely identify row.
Therefore it can be considered as a candidate key.
b. Primary key
A primary key is one of the candidate keys chosen to uniquely identify tuples within the
relation.
As it uniquely identifies each entity, it cannot contain null value and duplicate value.
c. Alternate key
A candidate key that is not the primary key is called an alternate key.
d. Foreign key
A key in a table can be called foreign key if it is a primary key in another table.
RELATIONAL ALGEBRA
The collection of operations that is used to manipulate the entire relations of a database is
known as relational algebra
These operations are performed with the help of a special language called query language
SELECT(σ)
Unary
PROJECT(π)
INTERSECTION(ꓵ)
Binary
SET DIFFERENCE(-)
CARTESIAN PRODUCT(X)
SELECT Operation
Select rows from a relation that satisfies a given condition
Denoted using sigma (σ)
General Format
σ condition (Relation)
Uses various comparison operators
<, >, <=, >=, <>
235
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Structured Query Language (SQL) is a language designed for managing data in relational database
management system (RDBMS).
SQL provides an easy and efficient way to interact with relational databases.
A query is a request to a database.
Simple, Flexible, Powerful
It‟s a relational database language not a programming language
Components of SQL
Components of SQL
236
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
The common DML commands are SELECT, INSERT, UPDATE and DELETE.
Data Control Language
Data Control Language (DCL) is used to control access to the database for security concerns.
The commands GRANT and REVOKE are used as a part of DCL.
GRANT : Allows access privileges to the users to the database.
REVOKE : Withdraws user's access privileges given by using GRANT command.
Creating Database
We use the command CREATE DATABASE for creating a database in MySQL
Syntax:
CREATE DATABASE <database_name>;
Example:
CREATE DATABASE WOHSS;
Opening Database
When we open a database, it becomes the active database in MySql
Syntax:
USE <database_Name>;
SHOW DATABASES;
This command list the entire databases in our system
Data types in MySQL
INT
Numeric Data Types
DECIMAL
CHAR
Data Types String Data types
VARCHAR
DATE
DATE and TIME
TIME
1. Numeric Data types
The most commonly used numeric data types in MySQL are INT or INTEGER and DEC or
DECIMAL.
i. INT or INTEGER
Integers are whole numbers without a fractional part.
They can be positive, zero or negative.
ii. DEC or DECIMAL
Numbers with fractional parts can be represented by DEC or DECIMAL data type.
The standard form of this type is DECIMAL(size,D) or DEC(size,D).
2. String (Text) data types
String is a group of characters. The most commonly used string data types in MySQL are
CHARACTER or CHAR and VARCHAR.
i. CHAR or CHARACTER
Character includes letters, digits, special symbols etc.
The CHAR is a fixed length character data type.
The syntax of this data type is CHAR(x), where x is the maximum number of characters
in the data.
ii. VARCHAR(size)
VARCHAR represents variable length strings.
VARCHAR allocates only required space for a string
3. Date and Time data types
i. DATE
The DATE data type is used to store dates.
The YYYY-MM-DD is the standard format.
237
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
ii. TIME
The TIME data type is used to specify a column to store time values in MySQL.
The standard HH:MM:SS format.
MySQL commands
Creating tables
The DDL command CREATE TABLE is used to define a table
The syntax of CREATE TABLEccommand is:
CREATE TABLE <table_name>
(<column_name><data_type> [<constraint>]
[, <column_name><data_type> [<constraint>,]
..............................
.............................. );
<table_name> represents the name of the table that we want to create
<column_name> represents the name of a column in the table
<data_type>represents the type of data in a column of the table
<constraint> specifies the rules that we can set on the values of a column.
All the columns are defined with in a pair of parentheses, and are separated by commas.
Rules for naming Tables and Columns
The name may contain Letters (A – Z, a -z), Numbers (0-9), Under score (_), Dollar ($) symbol
Must contain at least one character
Must not contains white spaces and special symbols
Must not be an SQL Keyword
Duplication not allowed
Constraints
Constraints are the rules enforced on data that are entered into the column of a table.
Constraints could be column level or table level.
a. Column Constraints
Constraints
238
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Using this constraint, a default value can be set for a column, in case the user does not provide
a value for that column of a record.
b. Table constraints
Table constraint is applied on a group of columns of a table.
The table constraint appears at the end of the table definition.
Example:
CREATE TABLE market(
code CHAR(2) PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
rate DECIMAL(10,2),
qty INT,
UNIQUE (code, name));
Viewing the structure of a table
Use DESCRIBE command
Syntax:
DESCRIBE <table_name>; OR DESC <table_name>;
Example: DESC student;
Inserting data into tables
The DML command INSERT INTO used for inserting tuples into a table
Syntax:
INSERT INTO <table_name> [<column1>,<column2>,……….<column N>]
VALUES(<value1>,<value2>,………<valueN>);
Example:
INSERT INTO student
VALUES(101, „manu‟ , „m‟ , „2008/11/23‟, 540);
Ensure the data type of the value and column matches
CHAR or VARCHAR type of data should be enclosed in single quotes or double quotes
The column values of DATE type columns are to be provided within single quotes
Null values specified as NULL (or null) without quotes
If no data available for all columns, then the column list must be included
Retrieving information from tables
The DML command SELECT is used for retrieving data from table.
Syntax:
SELECT <column_name>[,<column_name>,<column_name>, ...]FROM
<table_name>;
An asterisk (*)symbol can be used to display values from complete list of columns
Eg: SELECT * FROM student; (Display all attributes in table)
Eliminating duplicate values in columns using DISTINCT
Example:
SELECT DISTINCT course FROM student;
The above query will eliminate duplicate values from the column „course‟ Duplicate values can be
eliminated using the keyword DISTINCT
WHERE clause
In certain situations, we need to display only some values from the table.
WHERE clause of SELECT command enables to display values from table that satisfies our
conditions.
The syntax of SELECT command with WHERE clause is:
SELECT <column_name>[,<column_name>,<column_name>, ...]FROM
<table_name>WHERE <condition>;
Eg1: SELECT * FROM student WHERE gender='F';
The condition are expressed with the help of relational operators and logical operators
239
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
operators Description
Relational Operators
= Equal to
<> Not equal to
> Greater than
< Less than
>= Grater than or equal to
<= Less than or equal to
Logical operators
NOT TRUE if the condition is false
AND TRUE if both condition are true
OR TRUE If either of the condition is true
BETWEEN...AND Operators
The SQL operator BETWEEN...AND is used to specify the range
Example:
SELECT name, income FROM student WHERE income BETWEEN 1000 AND 5000;
The above query list the student details whose income fall in the range of Rs 1000/- to Rs 5000/-
IN Operators
To identify value from a given list.
Example:
SELECT * FROM student WHERE course IN(„commerce‟, „science‟);
LIKE operators
It is used to perform Condition based on pattern matching
Patterns are specified using two special wild card characters ‘%’ and ‘_‟ (underscore)
„%‟ matches a substring of characters
„_‟underscore matches a single character
“Ab%” matches any string beginning with “Ab”
“%cat” matches any string containing “cat” as substring Eg: education
“_ _ _ _” matches any string of exactly four characters with out any space between them
“_ _ _%” matches any string of at least three characters
Example:
SELECT name FROM student WHERE name LIKE „%ar‟;
SELECT name FROM student WHERE name LIKE „Div_ _ar‟;
The operator IS NULL used to find rows containing null values in a particular column
Example:
SELECT name, course FROM student WHERE income IS NULL;
If we want to retrieve the records containing non-null values in the income column, the below query
can be used
SELECT name, course FROM student WHERE fincome IS NOT NULL;
ORDER BY clause
The ORDER BY clause is used to sort the result of SELECT query in ascending or descending
order
The default order is ascending
We use the keywords „ASC‟ for ascending and „DESC‟ for descending
240
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Examples:
SELECT * FROM student ORDER BY name;(For ascending order the keyword „ASC‟ is not
necessary)
SELECT * FROM student ORDER BY name DESC;
Aggregate Functions
SUM( ) - Total of the values in the column specified as argument
AVG( ) - Average of the values in the column specified as argument
MIN( ) - Smallest values in the column specified as argument
MAX( ) - Largest of the values in the column specified as arguments
COUNT( ) - Number of non NULL values in the column specified as argument
GROUP BY clause
The GROUP BY clause used to group rows of a table based on a column value
Example:
SELECT course, COUNT(*) FROM student GROUP BY course;
We can apply conditions here by using HAVING clause
Example:
SELECT course, COUNT(*) FROM student GROUP BY course HAVING course=‟science‟;
Modifying data in tables
Use the DML command UPDATE
It changes values in one or more columns of specified rows
Changes may be affected in all or selected rows of the table
The new data of the columns are given using SET keyword
UPDATE <table_name>SET <column_name> = <value>[,<column_name> = <value>,...]
[WHERE <condition>];
Eg: UPDATE student SET income=7000 WHERE name='manu';
241
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
VIEWS
A view is a virtual table that not really does not exist in the DB
It is derived from one or more table
The table or tables from which the tuples are collected to create a view is called base table(s)
Created using the DDL command CREATE VIEW
Syntax:
CREATE VIEW <view_name>
AS SELECT <column_name1> [, <column_name2], ……]
FROM <table_name>
[WHERE <condition>];
This module collects financial data from various departments and Productio
n
Marketin
g
generates financial reports like balance sheets, general ledger, trial
balance, financial statements, etc. HR
2. Manufacturing module
242
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
BPR CURRENT
ANALYZE
NT
Processing: Set of activities or stages of operations to get IMPROVE
MENTS
PROCESS
an output.
Outcome: It is the output of processing steps. DESIGN,
PROCESS,
The different phases of ERP implementation are given below. IMPROVE
MENTS
243
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
244
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
It begins with collecting raw materials and ends with receiving the goods by the consumer
5. Decision Support System (DSS)
It is a computer program application that analyses business data and presents it so that users can
make business decisions more easily.
DSS is only a support in nature, but human
decision makers still retain their supremacy. INPUT DATA
DSS DECISIONS
DSS needs an effective DBMS to provide DATABASE,SOFTWARE
the support in decision making.
245
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
ICT in Business
Some major developments in business through the use of ICT are
o Social Network and big data analytics
o Business Logistics
Social Network and big data analytics
Big data analysis is the process of examining large data sets containing a variety of data to uncover
hidden patterns, market trends, customer preferences etc.
Business Logistics
It is the management of the flow of goods in a business between the point of origin and to the point
of consumption in order to meet the customer requirements.
RFID(Radio Frequency Identification)
This Technology can be used to identify, track or detect a wide variety of objects in logistics.
RFID consists of tag and reader.
The tag contains a microchip for storing data and an antenna for sending and receiving data.
Information Security
1. Intellectual Property Right (IPR)
Intellectual Property Right
246
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
It protects
o Patents to inventions
o Trademarks
o Industrial designs
o Geographical indications.
Patents
It is the exclusive rights granted for an invention.
To be patentable an invention must
o Relate to a process or product.
o be new
o involve an inventive step
o be capable of industrial use
o Not to be developed with the intention to harm others.
The term for every patent in India is 20 yrs from the date of filing patent application.
Trademarks
It is a distinctive sign or logo that identifies certain goods or products by an individual
or a company.
The initial term for registration is 10 years there after it can be renewed.
Industrial designs
Industrial design right protects the visual design of objects.
Geographical indications
Geographical indications are signs used on goods having a specific geographic origin
and possess qualities due to that place of origin.
eg. Palakkadan Matta Rice, Aranmula Kannadi etc.
B. Copy Right
It is a legal right given to the creators for an original work usually for a limited period of time.
This work can be any form like books, music, painting, films, s/w etc.
Under Indian copy right act a work is automatically protected by copy right when it is created.
The copyright lasts for 60 years after the death of its Author.
DIFFERENCES IN THE REGISTRATION OF RIGHTS OF INTELLECTUAL PROPERTY
Patent Trademark Copyright
Refers to Product, Name, Logo, Creative, intellectual or artistic forms of work
process Symbols
Registration Required Required Automatic, can be registered
Duration 20 years 10 years Until 60 years after the death of the last
surviving author.
Renewable No Yes No
2. Infringement
Unauthorized use of intellectual property right such as patents, trademark, copyrights etc are
called Intellectual Property Infringement.
3. Cyber Space
It is a virtual environment created by computers and other devices connected to internet.
4. Cyber Crime
Cyber crime is defined as criminal activity in which computer or computer network is used as a tool,
target or a place of criminal activity.
Cyber Crimes
Cyber crimes against individuals Cyber crime against property Cyber Crime against Government
Identity theft Credit card fraud Cyber terrorism
Harassment Intellectual Property theft Website defacement
Impersonation and cheating Internet time theft Attacks against e-
Violation of privacy governance websites
Dissemination of obscene materials
247
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
i. Identity theft
Here a person uses another person‟s identifying information like their name, user id,
credit card number etc without their permission to commit fraud activities.
ii. Harassment
Harassment involves posting humiliating comments on gender, race, religion etc.
The use of vulgur (indecent) language is also considered as harassment.
The use of internet to harass someone is called cyber stalking.
iii. Impersonation and cheating
Impersonation is an act of pretending to be another person for harming the victim.
iv. Violation of privacy
Violation of privacy is the intrusion into personal life of another, without a valid
reason.
v. Dissemination of obscene materials
Distributing and posting sexual material is a cyber crime.
It is also known as pornography.
b. Cyber crime against property
i. Credit cards fraud
Credit card fraud involves unauthorized usage of another person‟s credit card
information for purchase or fund transfer.
ii. Intellectual property theft
An intellectual property theft is the infringement or violation of an intellectual
property right.
Copying of another person‟s language, thoughts and ideas and presenting them as
one‟s own original work is called Plagiarism and it can be easily detected using
online tools..
iii. Internet time theft
The use of internet time by unauthorized persons without permission of the person
who pay for it is called internet time theft..
c. Cyber crime against government
i. Cyber terrorism
Cyber terrorism is a cyber attack against sensitive computer networks like nuclear
power plant, air traffic control, telecom etc.
ii. Website defacement
Hacking of govt. websites and posting hateful comments about govt. in those
websites.
iii. Attacks against e-governance websites
These types of attack deny a particular online government service.
This is done by using DDoS(Distributed Denial of Service) attack.
5. Cyber Laws
They are the rules that govern the use of computer and internet.
Cyber crimes are subject to Indian Penal Code, Information Technology Act, 2000 and IT Act
Amendment Bill 2008.
6. Cyber Forensics
Cyber forensics is the discipline that combines law and computer science to collect and analyze
data from computer systems, networks, communication systems and storage device and to
present this evidence to courts.
7. Infomania
Infomania refers to problems created by information overloading.
Infomania is the excess enthusiasm for collecting knowledge. This may result in neglecting more
important things like family, duties etc.
248