Professional Documents
Culture Documents
Hsslive Pyq Cs Xii
Hsslive Pyq Cs Xii
in ®
Chapter 1
Structure & Pointers
Structure
1. Define Structure.
OR
What is the use of structure data type in C++ programs ? 2
Structure is a user-defined data type to represent a collection of logically related data
items, which may be of different types, under a common name.
5. Define a structure named ‘Time’ with elements hour, minute and second. 2
struct Time
{
int hour;
int minute;
int second;
};
Answer.
struct student
{
int regno;
char name[20];
float mark;
};
(a) complex x;
(b) x.real=15;
{
short day;
short month;
short year;
};
struct student
{
int adm_no;
char name[20];
date dt_adm;
float fee;
};
Array Structure
Derived data type User-defined data type
A collection of same data type A collection of same or different data type
Elements are referenced using subscripts Elements are referenced using dot operator
When an element of an array becomes another array, multi When an element of a structure becomes another structure,
dimensional array. nested structure.
Array of structures is possible. Structure can contain arrays
Pointers
1. What is a pointer in C++? Write the syntax or example to declare a pointer variable. 2
Pointer is a variable that can hold the address of a memory location.
Syntax
data_type * variable;
Example
int *ptr1;
2. What is a pointer in C++? Declare a pointer and initialize with the name of your country. 3
Pointer is a variable that can hold the address of a memory location.
Example
char *ptr1=”India”;
3. If int num = 5; write C++ statements to declare a pointer variable and store the address of num into it. 2
int *ptr;
ptr = #
5. If ‘ptr’ is a pointer to the variable ‘num’, which of the following statement is correct? 1
(i) ‘ptr’ and ‘num’ may be of different data types.
(ii) If ‘ptr’ points to ‘num’, then ‘num’ also points to ‘ptr’.
(iii) The statement num = &ptr is valid.
(iv) *ptr will give the value of the variable ‘num’.
Ans. (iv) *ptr will give the value of the variable ‘num’.
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Ans. variable ‘a’ and pointer ‘p’ belongs to different data types. To store the address of ‘a’, the data type of ‘p’
also must be int.
int a = 5;
int *p;
p = &a;
cout << p;
(a) 5
(b) 6
(c) 10
(a) 20
(b) 13
3. What is the difference between the two declaration statements given below. 2
(a) int *ptr = new int(10);
(b) int *ptr = new int[10];
(a) A memory is dynamically allocated and initialized with the value 10;
(b) An integer array of size 10 is created dynamically.
Chapter 2
Concepts of Object Oriented Programming
Programming paradigm
1. What is Procedural Oriented Programming? What are its disadvantages? 3
Procedure-Oriented Programming specifies a series of well-structured steps and procedures to compose a program.
In this paradigm, when the program becomes larger and complex, the list of instructions is divided and grouped
into functions. To further reduce the complexity, the functions associated with a common task are grouped into modules.
Disadvantages
a. Data is undervalued.
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Classes
1. What is the difference between structure and class? 2
Structure Class
Specification only about data about data and functions
Declaration using the keyword struct Using the keyword class
Data Abstraction
1. ________ protect data from unauthorized access. 1
(a) Polymorphism (b) Encapsulation (c) Data abstraction
3. Showing only the essential features and hiding complexities from outside world refers to ________ 1
Data abstraction
Data Encapsulation
1. Differentiate between Data Abstraction and Data Encapsulation. 3
Data Abstraction refers to showing only the essential features and hiding the details from the outside world.
Encapsulation binds together the data and functions that manipulate the data, and keeps both data and function safe
from outside interference and misuse.
2. How do the access labels of class data type implement data hiding? 2
Members declared under private section are not visible outside the class.
Members declared as protected are visible to its derived class, but not outside the class.
Members declared as public are accessible anywhere in the program.
Inheritance
1. What do you mean by Inheritance in C ++ ? 2
Inheritance is the process by which objects of one class acquire the properties and functionalities of another class.
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
3. Identify the type of inheritance that has two base classes and one derived class. 1
(a) Multi level inheritance (b) Multiple inheritance
(c) Hierarchical inheritance (d) Hybrid inheritance
5. Which type of inheritance has one base class and two or more sub-classes ? 1
Hierarchical inheritance
Polymorphism
1. The ability of data to be processed in more than one form is called _____________ 1
Polymorphism
3. The ability of a message or data to be processed in more than one form is called ________. 1
(a) Polymorphism (b) Encapsulation
(c) Data abstraction (d) Inheritance
(a) Polymorphism
------------------------------------------------------------------------------------------------------------------------------
Chapter 3
Data Structures and Operations
Data Structure
1. What is data structure? How are they classified? 2
Data structure is a particular way of organising similar or dissimilar logically related data items which can be
processed as a single unit.
Data structures are classified as
a. static data structures
b. dynamic data structures.
(For static data structure, the required memory is allocated before the execution of the program and the memory
space will be fixed throughout the execution.
Eg. Data structures designed using Arrays
For dynamic data structure, memory is allocated during execution. It grows or shrinks during run-time as per user's
desire.
Eg. Data structures designed using linked list.)
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
4. The process of combining all the elements of two sorted data structure is called ______. 1
Merging
Stack
The data structure that follows LIFO principle is known as stack. It is an ordered list of items in which all
insertions and deletions are made at one end, usually called Top.
1. Name the data structure that follows LIFO principle to organize data. 1
Stack
2. In ________ data structure, the element added atlast will be removed first. 1
Stack
Step 1 : Start
Step 2 : If (TOS < N) Then //Overflow checking
Step 3 : TOS = TOS + 1
Step 4 : STACK[TOS] = VAL
Step 5 : Else
Step 6 : Print ""Stack Overflow "
Step 7 : End of If
Step 8 : Stop
Step 1 : Start
Step 2 : If (TOS > -1) Then // Underflow checking
Step 3 : VAL = STACK[TOS]
Step 4 : TOS = TOS - 1
Step 5 : Else
Step 6 : Print ""Stack Underflow "
Step 7 : End of If
Step 8 : Stop
Queue
1. The _______ data structure follows First In First Out (FIFO) principle. 1
Queue
Step 1 : Start
Step 2 : If (Rear == -1) Then //(Underflow checking)
Step 3 : FRONT=REAR=0
Step 4 : QUEUE[REAR} = VAL
Step 5 : Else If(REAR<N) Then
Step 6 : REAR=REAR+1
Step 7 : QUEUE[REAR] = VAL
Step 8 : Else
Step 9 : Print “Queue Overflow”
Step 10 : End of If
Step 11 : Stop
50
0 1 2 3 4
Consider a queue as shown above. The value of REAR and FRONT will be 4. It is not possible to insert a data in
this queue using the algorithm even though there are 4 spaces.
This limitation of linear queue can be overcome by circular queue. It is a queue in which the two end points meet.
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Linked list
1. Illustrate Linked List with suitable diagram. 2
A linked list is a collection of nodes, where each node consists of a data and a link - a pointer to the next node in
the list. That is, the first node in the list contains the first data item and the address of the second node; the second node
contains the second data and the address of the third node; and so on. The last node at a particular stage contains the last
data in the list and a null pointer.
3. In a linked list, the link part of the last node contains ___________ data. 1
NULL pointer
--------------------------------------------------------------------------------------------------------------------------------------
Chapter 4
Web Technology
Communication on the web
1. Name the different types of communication on the web and explain briefly. 3
Communication on the web are
Client to web server communication
Web server to web server communication
In Client to web server communication, usually HTTP protocol is used. But for security reason, in banking
applications and email services HTTPS protocol is used now. It encrypts data and send to the server.
Web server to web server communication also may be required in certain web applications. For example, the
communication between the web server of an online shopping site and a bank web server. Here a special server called
Payment gateway acts as a bridge between merchant server and bank server and transfers money in an encrypted format
Scripts
1. ________ tag is used to include scripting code in an HTML page. 1
<SCRIPT>
a) Scripts are program codes written inside HTML pages. There are two types of scripts.
a. client side scripts Eg. vbscript, javascripts
b. server side scripts. Eg. PHP, Perl, ASP
b)
Client side scripting Server side scripting
Script is copied to the client browser Script remains in the web server
Script is executed in the client browser Script is executed in the web server and the web page
produced is returned to the client browser
mainly used for validation of data at the client. usually used to connect to databases and return data from the
web server
Users can block Users can not block
type and version of the web browser affects the working of type and version of the web browser does not affects the
client side scripts. working of client side scripts.
Javascript
It is the most popular client scripting language, because it works in almost every browser. JavaScript can be
inserted inside HTML code or can be written as an external file. Extension of a javascript file is ‘.js’
vbscript
VBScript is a scripting language developed by Microsoft Corporation. It is used either as a client side as well as
server side scripting language.
Server side scripting Languages - Server side scripts are used to create dynamic web pages.
PHP
PHP stands for 'PHP: Hypertext Preprocessor'. The main objective of PHP is to develop dynamic web pages at ease.
Extension of a php file is ‘.php’.
JSP
JSP is a simple and fast way to create dynamic web page. JSP files have the extension ‘.jsp’.
7. What is meant by empty tag in HTML? Write any three empty tags. 3
Tags that require only opening tag is known as empty tags.
Eg: <BR>, <IMG>, <HR>
Attributes are parameters frequently included within the opening tag. It provide additional information such as
colour, alignment etc to browser.
A 3B 5
A<SUP>3</SUP>B<SUB>5</SUB>
(a) H<SUB>2</SUB>O
(b) a<SUP>2</SUP>+<b<SUP>2</SUP>
8. Write any two attributes of <FONT> tag and their effects in the web page. 2
Color – specifies the colour of the font.
Size - Specifies the size of the font.
Face - specifies the font face.
9. Write the HTML statement to scroll the text "God's own country". 1
<MARQUEE> God’s own country</MARQUEE>
10. List and explain the following tags with two attributes : 3
(a) <BODY> (b) <MARQUEE> (c) <FONT>
(b) <MARQUEE> - displays a piece of text or image scrolling horizontally or vertically in the web page.
Height - specifies height of the marquee.
Width - specifies width of the marquee.
x > y
Inserting images
1. Which tag is used to insert an image into a web page. 1
<IMG>
3. Write the HTML code to insert an image “Profile.jpg” aligned in center of a web page. 2
<CENTER> <IMG Src=”Profile.jpg”> </CENTER>
Chapter 5
Web Designing using HTML
Lists
1. Explain about various kinds of Lists in HTML with example. 5
There are three kinds of lists in HTML. They are
1. unordered lists
2. ordered lists
3. definition lists.
Unordered lists
Unordered lists display a bullet or other graphic in front of each item. An unordered list can be created with
the tag pair <UL> and </UL>. Each item in the list is presented by using the tag pair <LI> and </LI>.
The attribute of <UL> tag is Type.
Example. • Science group
• Humanities group
• Commerce group
Ordered lists
Ordered lists display a list of items in some numerical or alphabetical order. An ordered list can be created with
the tag pair <OL> and </OL>. Each item in the list is presented by using the tag pair <LI> and </LI>.
The attributes of <OL> tag are Type and Start.
Example 1. Science group
2. Humanities group
3. Commerce group
Definition lists
A definition list is a list of terms and the corresponding definitions. No bullet symbol or number is provided for
the list items. A definition list is created using the tag pair <DL> and </DL>. Each term in the list is created using the
tag <DT>. Each definition is created using the tag <DD>.
Example Science group
Subjects are Physics, Chemistry, Maths, Biology
Humanities group
Subjects are Political Science, History, Geography, Economics
Commerce group
Subjects are Accountancy, Business Studies, Economics
2. The HTML tag used to specify a data item in a definition list in a web page is ______. 1
<LI>
In <UL> tag, ‘Type’ attribute is used to specify the symbol used before each item. The possible values are
Disc(Default), Disc and Circle.
In <OL> tag, ‘Type’ attribute is used to specify the numbering system. The possible value are 1(Default), A, a, I, I.
4. ________ attribute of <OL> tag enables to change the beginning value of the list. 1
start
<OL>
<LI>RAM</LI>
<LI>Registers</LI>
<LI>Mother Board</LI>
</OL>
7. Write the two tags associated with <DL> tag and the use of each in making a definition list. 2
<DT> - to create each term
<DD> - to create each definition
Link
1. What is a hyperlink? Explain about the different types of hyperlinks available in HTML. 3
Hyperlink is an element, a text, or an image in a web page that we can click on, and move to another
document or another section of the same document.
The two types of hyperlinks are
a. Internal hyperlink
b. external hyperlink
Internal linking
A link to a particular section of the same document is known as internal linking.
External linking
The link from one web page to another web page is known as external linking.
3. Which attribute is used with <A> tag to specify the name of the web page to be linked ? 1
Href
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
EMBED
1. What is the use of <EMBED> tag in HTML ? 2
<EMBED> tag is used add music or video to the web page. The main attribute of the <EMBED> tag is Src,
which specifies the URL of the music or video files to be included.
Example : <EMBED Src= "song1.mp3" Width= "300" Height= "60">
</EMBED>
Table
1. Explain the HTML tag <table> and its attributes. 3
<TABLE> tag is used to create tables.
Main attributes are:
Border – specifies the thickness of the border.
Bordercolor – spaecifies the border colour.
Align – specifies the alignment of the table in the web browser.
Bgcolor – specifies the background colour of the table.
Background – specifies background image for a table.
Width – specifies width of a table.
Height – specifies height of a table.
Cellspacing – specifies the space between cells.
Cellpadding – specifies the space between the content and cell border.
2. Write short note about the tags used to create a table in HTML. 3
<Table> - used to create table.
<TR> - used to create a row in a table.
<TH> - Used to create a heading cell.
<TD> - Used to create a data cell.
3. Distinguish between Rowspan and Colspan used in the creation of tables in web pages. 2
rowspan - specifies the number of rows to be spanned by the cell.
Colspan - specifies the number of column to be spanned by the cell.
4. The space between the content and cell border in a table can be changed using ________ attribute. 1
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
cellpadding
<HTML>
<HEAD>
<TITLE> Table</TITLE>
</HEAD>
<BODY>
<TABLE Border=”1”>
<TR>
<TH>2021</TH>
<TH>Science</TH>
<TH>Humanities</TH>
<TH>Commerce</TH>
</TR>
<TR>
<TD>Std.XI</TD>
<TD>165</TD>
<TD>58</TD>
<TD>109</TD>
</TR>
<TR>
<TD>Std.XII</TD>
<TD>173</TD>
<TD>64</TD>
<TD>112</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<TABLE Border=”1”>
<TR>
<TH>Year</TH>
<TH>Computer Science</TH>
<TH>Comp.Appl. <BR> (Commerce) </TH>
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<TABLE Border=”1”>
<CAPTION> <B> STUDENT MARK LIST </B></CAPTION>
<TR>
<TH> ID </TH>
<TH> SUBJECT </TH>
<TH> MARK </TH>
</TR>
<TR>
<TD>101</TD>
<TD>Physics</TD>
<TD>45</TD>
</TR>
<TR>
<TD>102</TD>
<TD>Chemistry</TD>
<TD>55</TD>
</TR>
<TR>
<TD>103</TD>
<TD>Computer Science</TD>
<TD>52</TD>
</TR>
</TABLE>
<html>
<head>
<title>Table</title>
</head>
<body>
<table border="1">
<caption><B>Result of ABC school</B></caption>
<tr>
<th rowspan="2">Year</th>
<th colspan="2">Students</th>
<th rowspan="2">Pass <BR> Percentage</th>
</tr>
<tr>
<th>Registered</th>
<th>Passed</th>
</tr>
<tr align="center">
<td>2014</td>
<td>200</td>
<td>130</td>
<td>65</td>
</tr>
<tr align="center">
<td>2015</td>
<td>200</td>
<td>150</td>
<td>75</td>
</tr>
</table>
</body>
</html>
9. Write the HTML code to create a web page which includes, the following table. 3
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<HTML>
<HEAD>
<TITLE>Table</TITLE>
</HEAD>
<BODY>
<TABLE Border="1">
<TR>
<TH colspan="3">No. of Student</TH>
</TR>
<TR>
<TD rowspan="2">Boys</TD>
<TD>XI</TD>
<TD>140</TD>
</TR>
<TR>
<TD>XII</TD>
<TD>60</TD>
</TR>
<TR>
<TD rowspan="2">Girls</TD>
<TD>XI</TD>
<TD>75</TD>
</TR>
<TR>
<TD>XII</TD>
<TD>125</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Frameset
1. What is meant by nesting of <FRAMESET>? Explain its need. 3
Inserting a frameset within another frameset is called nesting of frameset.
Using nested frameset we can divide the browser window and include more web pages in a browser window.
3. Write notes on the different tags used to divide the browser window into different sections. 2
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<FRAMESET> - for partitioning the browser window into different frame sections.
<FRAME> - defines the frames inside the <FRAMESET> .
Form
1. Name and explain any two attributes of FORM tag. 2
Action - specifies the URL of the Form handler.
Method - specifies the method used to upload data. The most frequently used Methods are
Get and Post.
Target - specifies the window or frame where the result of the script will be displayed.
3. Which attribute of <input> tag is used to make different kinds of controls like Text box, Radio button, Submit button. 1
type
4. List any three values provided to Type attribute of <INPUT> tag and specify the use of each. 3
text - creates a text box
password – creates a password box.
checkbox - creates a checkbox where user can enter Yes or No values
radio – creates radio button.
reset – creates a reset button.
submit – creates a submit button.
5. Check the given HTML code. Fill the missing code to generate an output as shown in the figure. 3
<HTML>
<body>
<form name=’loginForm’>
username:
<input type=”text”>
password:
………………………….
<input type=”………..” value=”Login>
………………………….
</form>
</body>
</html>
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
<HTML>
<body>
<form name=’loginForm’>
username:
<input type=”text”>
password:
<input type=”passwd”>
<input type=”submit” value=”Login”>
<input type=”reset” value=”RESET”>
</form>
</body>
</html>
Miseallaneous
1. Identify errors in the following HTML codes. 5
a. <UL Type=”A” start=5>
b. <h1><b>web programming </b></i></h1>
c. <img src=’Profile.jpg’ size=50>
d. <a href=”Contact@gmail.com”>
e. <frameset rows=”50%,25%,25%”>
<frame src=”1.html”>
<frame src=”2.html”>
</frameset>
Chapter 6
Client Side Scripting Using JavaScript
<SCRIPT tag>
1. ________ tag is used to include scripting code in an HTML page. 1
<SCRIPT>
a. String
b. String
c. Number
3. Classify the following values in Java script into suitable data types ? 3
(27.4, false, “true”, 25)
27.4 - Number
false – Boolean
“true” - String
25 – Number
(d) true
67.4 - Number
“true” - String
false - Boolean
0 - Number
Variables in JavaScript
1. Name the keyword used to declare a variable in JavaScript.
1
var
Operators in JavaScript
1. Write any four comparison operators in JavaScript. 2
> >= < <= == !=
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
for
for is a loop. It is used to execute a group of instructions repeatedly.
Example : for(i=1;i<=10;i++)
{
document.write(i);
document.write(“ ”);
}
while
while loop is a simple loop that repeatedly execute a group of statements based on a condition.
Example:
int i=1;
while(i<=10)
{
document.write(i);
document.write(“ ”);
i++;
}
3. The JavaScript function given below is used to display the sum of digits of a given number. Fill in the blanks to complete
the function. 2
<sript language=”JavaScript”>
______________ sumdigit()
{var n,s;
n=document.frm.txt1.________________;
for(s=0;________________ ; n=n/10)
s=s+_________ ;
document.frm.txt2.value=s;}
</script>
<sript language=”JavaScript”>
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
function sumdigit()
{var n,s;
n=document.frm.txt1.value;
for(s=0;_n>0; n=n/10)
s=s+n;
document.frm.txt2.value=s;}
</script>
Built-in functions
1. Write the JavaScript code to display “Welcome to Kerala” inside the <h1> tag as shown in the HTML page.
2
<HTML>
<body>
<Script lang=”JavaScripit”>
<h1> ………………………. </h1>
</script>
</body>
</html>
<h1>document.write(“Welcome to Kerala”);</h1>
5. Consider a string “Gandhiji”. Write JavaScript code fragment to do the following tasks. 3
a. Convert the string to upper case.
b. Find the length of the string.
c. display the 3rd letter in the string.
a. “Gandhiji”.toUpperCase();
b. “Gandhiji”.length;
c. “Gandhiji”.charAt(2);
6. Explain the working of the following JavaScript functions and specify the output of each. 3
(a) isNaN("254")
(b) "Covid-19".charAt(3)
(c) "MASK".toUpperCase()
(a) false
(b) I
(c) MASK
Miscellaneous
1. Consider two strings “education is the most powerfull weapon” and “you can use to change the world”. 2
Write JavaScript code to
a. Store these strings in two variables.
b. Combine the two string variables.
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
a.
var x, y,z;
x = ”education is the most powerfull weapon”;
y = “you can use to change the world”;
b.
z = x + y;
------------------------------------------------------------------------------------------------------------------------------------------------
Chapter 7
Web Hosting
Web hosting
1. What is web hosting ? 1
Web hosting is the service of providing storage space in a web server.
Free hosting
1. What is meant by free hosting ? 2
Providing storage space in a web server free of charge is called free Hosting. The service provider displays
advertisements in the websites to meet the expenses. Free web hosting is useful for those who are not able to spend money
on web hosting.
Chapter 8
Database Management System
Advantages of DBMS
1. List any four advantages of DBMS. 2
1. Controlling data redundancy.
2. Data consistency.
3. Sharing of data.
4. Crash Recovery.
5. Data Integrity.
6. Data Security.
Components of DBMS
1. List down the components of DBMS. 2
1. Hardware
2. Software
3. Data
4. Users
5. Procedures
1. Hardware - It is the actual computer system used for storage and retrieval of the database.
2. Software – It consists of the actual DBMS, application programs and utilities.
3. Data - It is the most important component of DBMS. For effective storage and retrieval of
information, data is organized as fields, records and files.
4. Users - The different users of DBMS are Database Administrator (DBA), Application
Programmers, Sophisticated users and Naive Users.
5. Procedures - Procedures refer to the instructions and rules that govern the design and use of the
database.
Database Abstraction
1. With suitable diagram, explain the levels of database abstraction. 3
2. The level of data abstraction in DBMS that is closest to the user is known as _______. 1
(a) Physical level (b) Logical level (c) View level (d) Conceptual level
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Data Independence
1. What is Data independence? Explain different types of data independence. 3
The ability to modify the schema definition in one level without affecting the schema definition at the next higher
level is called data independence.
There are two levels of data independence,
a. Physical data independence.
b. Logical data independence.
a. Physical data independence - Physical data independence refers to the ability to modify physical level without
affecting conceptual (logical) level.
b. Logical data independence - Logical data independence refers to the ability to modify a conceptual (logical)
schema without affecting view level.
Users of Database
1. List and explain different database users in DBMS.
The database user are database Administrator, Application Programmers, Sophisticated users and Naive Users. 3
a. Database Administrator - The person who is responsible for the control of database is the
Database Administrator (DBA).
b. Application programmers - Application programmers are computer professionals who interact with the DBMS
through application programs.
c. Sophisticated users - Sophisticated users include engineers, scientists etc who interact with the DBMS through
their own queries.
d. Naive users - Naive users interact with the DBMS by invoking pre written application programs.
Terminologies in RDBMS
1. Define the following terms. 3
a. Relation
b. Candidate key
c. Tuples and attribute
a. Degree – 4
Cardinality - 5
Degree – 4
Cardinality – 3
6. If a table has 10 rows and 5 columns, what will be its degree and cardinality ? 2
Degree – 5
cardinality – 10
Keys
1. What is a Primary Key? What is the significance of primary key in a relation? 2
A primary key is one of the candidate keys chosen by the database designer. It is a set of one or more
attributes that can uniquely identify tuples within the relation.
2. A ________ key is set of one or more attributes that can uniquely identify tuples within the relation. 1
Primary Key
4. In RDBMS, the minimal set of attributes that uniquely identifies a row in a relation is called ________. 1
Candidate Key
Relational Algebra
1. Consider the given table SPORTS and write relational expressions for the following questions: 2
a. π Name (SPORTS)
b. π Name, Goals(ϭ Goals>70(SPORTS))
2. Explain about UNION, INTERSECTION and SET DIFFERENCE Operations in Relational Algebra. 3
UNION - UNION operation returns a relation containing all tuples appearing in both of the
two specified relations. The symbol of this operation is U.
INTERSECTION - INTERSECTION operation returns a relation containing the tuples appearing in both of the
two specified relations. It is denoted by ∩.
SET DIFFERENCE - it returns a relation containing the tuples appearing in the first relation but not in the second
relation. It is denoted by – (minus).
a. ARTS ∩SPORTS
b. ARTS U SPORTS
c. SPORTS – ARTS
a. Arts ∩ Sports
b. Arts U Sports
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
a. Explain UNION operation with the help of the above two tables.
b. What will be the result if INTERSECTION operation is performed on these tables?
c. Which operation is to be performed to get the list of students in Football from class 12A?
a. UNION operation returns a relation containing all tuples appearing in both of the two specified relations.
Football U Athletics
PCode PName Class
101 Rahul 12 C
105 John 11 A
107 Noufal 12 A
103 Renjith 12 B
110 Irfan 12 A
b. Football ∩ Athletics
c. Selection
5. If a table STUDENT has 5 columns and another table TEACHER has 3 columns, the Cartesian product
STUDENT X TEACHER will have ______columns. 1
8
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Chapter 9
Structured Query Language
Components of SQL
1. Distinguish between DDL and DML and give examples for each type. 5
The DDL commands are used to create, modify and remove the database objects such as tables, views and keys.
The common DDL commands are CREATE, ALTER, and DROP.
DML commands are used to insert data into tables, retrieve existing data, delete data from tables and modify the
stored data. The common DML commands are SELECT, INSERT, UPDATE and DELETE.
3. Classify the following commands into DDL, DML and DCL in SQL : 2
Delete, Drop, Restore, Update
DDL – Drop
DML – Delete, Update
DCL - Restore
Datatypes in SQL
1. Write short note about data types in SQL. 3
SQL data types are classified into three. They are numeric data type, string (text) data type, and date and
time data type.
The most commonly used numeric data types in MySQL are INT or INTEGER and DEC or DECIMAL.
The most commonly used string data types in MySQL are CHARACTER or CHAR and VARCHAR.
The data type used to store date type value is DATE and to store time value is TIME.
2. Name the most appropriate SQL datatype required to store the following data. 3
a. Name of a student (maximum 70 characters)
b. Date of Birth of a student.
c. Percentage of marks obtained (correct to 2 decimal places)
a. varchar
b. date
c. dec
The syntax of this data type is CHAR(x), where x is the maximum number of characters.
Eg. Name char(25)
VARCHAR
VARCHAR represents variable length strings. It is similar to CHAR, but the space allocated for the data
depends only on the actual size of the data, not on the declared size of the column.
Eg. Name varchar(25)
5. Write short note about numeric and string data types of SQL. 3
The most commonly used numeric data types in MySQL are INT or INTEGER and DEC or DECIMAL.
INT or INTEGER - Integers are whole numbers without a fractional part.
Eg. 69, 0, -112
DEC or DECIMAL – Decimals are numbers with fractional part.
Eg. -999.65
The most commonly used string data types in MySQL are CHARACTER or CHAR and VARCHAR.
CHAR or CHARACTER – Character represents fixed length string. Character includes letters, digits, special symbols
etc.
VARCHAR(size) - VARCHAR represents variable length strings. It is similar to CHAR, but the space allocated for the
data depends only on the actual size of the data, not on the declared size of the column.
Constraints
1. What is meant by column constraints? Write any 4 column constraints in SQL. 3
Constraints are the rules enforced on data that are entered into the column of a table.
The column constraints are
1. NOT NULL
2. AUTO_INCREMENT
3. UNIQUE
4. PRIMARY_KEY
5. DEFAULT
i. NOT NULL - This constraint specifies that a column can never have NULL values.
ii. AUTO_INCREMENT - If no value is specified for a column, then MySQL will assign serial numbers automatically.
iii. UNIQUE - It ensures that no two rows have the same value in the column specified.
iv. PRIMARY KEY - This constraint declares a column as the primary key of the table.
v. DEFAULT – This constraint is used to set default value for a column.
Aggregate Functions
1. Explain the use of any three aggregate functions in SQL. 3
Miscellaneous
1. Null values in in tables are specified as “null”. State whether true or false. 1
false. “null” is a string
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
2. What is the use of SELECT command in SQL? Write down its syntax of usage. 2
SELECT is used to retrieve information from specified columns in a table.
Syntax - SELECT <column_name>[,<column_name>,<column_name>, …] FROM <table_name>;
Example – SELECT name FROM student;
3. Briefly describe three optional clauses used with SELECT command in SQL. 3
a. WHERE - used to select specific rows.
b. ORDER BY – used to sort the result of a query.
c. FROM – It is an essential clause with SELECT command. Used to specify the table name.
HAVING is used along with GROUP BY clause. The condition in HAVING clause is applied to form groups of
records.
Eg. SELECT course, COUNT(*) FROM student
GROUP BY course
HAVING COUNT(*) > 3;
8. Differentiate DELETE and DROP in SQL. Write the syntax of DELETE and DROP. 3
DELETE
used to remove individual or a set of rows from a table. It is a DML command.
Syntax
DELETE FROM <table_name> [WHERE <condition>];
Eg
DELETE FROM student WHERE RollNo=1027;
DROP
used to remove a table from the database permanently. It is a DDL command.
Syntax
DROP TABLE <table_name>;
Eg
DROP TABLE student;
10. Write SQL queries based on the table PRODUCT given below. 5
11. Consider the given table ‘Bill’ and write SQL statements for the following questions. 5
a. UPDATE bill
SET total = unitprice * quantity;
b. SELECT * FROM bill;
c. INSERT INTO bill VALUES(1118, ‘Brown Rice’, ‘05-03-2020’, 42, 6, NULL);
d. SELECT MAX(unitprice) FROM bill;
e. DELETE FROM bill
WHERE itemcode = 1008;
12. A table named STUDENT with fields RollNo, Name, Batch, Mark, Grade is given. Write SQL statements for the
following. 5
a. To display the details of all students in ‘Science’ batch.
b. To display the details of these students having grade A or A+.
c. To count the number of students in each batch,
d. To change the grade of the student to A+ whose RollNo is 50.
e. Remove the details of student whose RollNo is 10.
Chapter 10
Server Side Scripting Using PHP
Overview
1. PHP stands for _______. 1
PHP Hypertext Preprocessor
Benefits
1. What is the difference between PHP and Javascript. 2
Javascript PHP
Client side Scripting Language Server side Scripting Language
Depends on the browser Does not depend on the browser
Code is visible to the user, so less secure Code is stored and executed in the server. So
user can not access the code. Therefor it is
secure.
Basics
1.What is the expansion of LAMP? 1
Linux, Appache, MySQL, PHP
Output statements
1. What is the difference between echo and print in PHP. 3
or
2. Compare echo and print commands in PHP with suitable examples. 3
echo print
Can take more than one parameter when Takes only one parameter
used without parenthesis
Does not return any value Returns TRUE (1) on successful output
Returns FALSE (0) on unsuccessful output
Faster than print Slower than echo
echo “Hi Welcome”; print “Hi Welcome”;
echo (“Hi Welcome”); print (“Hi Welcome”);
echo “Hi”, “Welcome”;
Variable
1. In PHP, the name of a variable starts with _____________ sign. 1
$
Datatypes
1. Prepare a short note about different Data types used in PHP. 3
The data types in PHP are divided into two
a. Core Data types
b. Special Data Types
Core data Types
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Operators
1. Briefly explain about operators in PHP. 3
Assignment Operators
Used to assign a value to a variable. = is the assignment operator.
Eg. $mark=80;
Arithmetic Operators
Used to perform arithmetic operations. Arithmetic operators are +, -, *, /, %
Relational Operators
Used to compare values. Relational operators are ==, !=, >, >=, <, <=. The result of relational operators
are TRUE or FALSE.
Logical Operators
Used to perform logical operations. Logical operators are &&, ||, !, xor
Increment / Decrement Operators
Used to increment the value of a variable by 1. The operators are ++, --
Control Structures
1. Write a PHP program to find the biggest of three numbers. 3
<?php
$a = 10;
$b = 50;
$c = 30;
2. Write the syntax of for loop in PHP and explain its working. 3
Syntax
for(initialization; condition; update statement)
{
body of the loop;
}
Firstly loop control variable is initialized. Then condition is evaluated. If it returns TRUE, body of the code will be
executed. Then Update statement is executed which changes the value of loop control variable. Again condition is
evaluated.
This process continues till the test expression evaluates to FALSE.
Arrays
1. Name different types of arrays in PHP. Explain with examples. 3
In PHP there are three types of arrays
a. Indexed Arrays
b. Associative Arrays
c. Multidimensional Arrays
Indexed Arrays
Arrays with numeric index are called Indexed Arrays. They use non- negative integers are keys.
Eg. $regno = array(1000,1001,1002);
Here $regno[0] is 1000, $regno[1] is 1001 etc
Associative Arrays
Arrays with named keys are called Associative Arrays.
Eg. $result = array(“Arun” => “35”, “Binu” => “80”, “Deepu => “60”);
Here $result[“Arun”] is 35, $result[“Binu”] is 80
Functions
1. Write a function in PHP to find the factorial of a number. 3
function fact($num)
{
$fact=1;
for($i = 1; $i<=num; $i++)
{
$fact = $fact*$i;
}
return $fact;
}
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
606
3. Write the uses of any three string functions in PHP with syntax. 3
strlen() = returns the length of a string.
strcmp() = used to compare two strings.
Strpos() = finds the position of the first occurrence of a string inside another string.
Chapter 11
Advances in Computing
Distributed Computing
1. What are the advantages of distributed computing ? 2
Economical, Speed, Reliability, scalability
Parallel Computing
1. Compare serial and parallel computing. 3
Grid Computing
1. Write any two advantages of grid computing. 2
1. capable to solve larger, more complex problems in a short time.
2. Makes better use of existing hardware.
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
3. Scalable
Cluster Computing
1. A widely used Operating system for cluster computers is _______________ 1
Linux
Cloud Computing
1. What is Cloud Computing? Write any two advantages of Cloud Computing. 2
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.
Cost savings
Reliability
Scalability
Maintenance
Disadvantages
Security and Privacy – Data is sent on a publicly accessible network and is stored in a shared disk system. So there
is a danger of stealing and corrupting data.
Lack of standards – Clouds have no standards. So they are interoperable.
Artificial Intelligence
1. NLP is _________________ 1
Natural Language Processing
Join Now: https://join.hsslive.in Downloaded from https://www.hsslive.in ®
Computational Intelligence
1. The study of control and communication between man and machine is called ______. 1
Cybernetics
4. Name the application of computational intelligence that refers to metrics related to human characteristics and traits. 1
Biometrics
Chapter 12
ICT and Society
ICT
1. Expand ICT. 1
Information and Communication Technology
e-Governance
1. What is e-Governance ? Briefly describe the three components of e-Governance. 4
e-Governance is the application of ICT for delivering government services to citizens in a convenient and
transparent manner.
The components of e-Governance are
a. State Data Centre (SDC)
b. State Wide Area Network (SWAN)
c. Common Service Centres (CSC)
State Data Centre (SDC) - State Data Centre provides several functionalities. These include securing data storage,
online delivery of services, citizen information/services portal, disaster recovery, etc.
e-Business
1. A system of financial exchange between buyers and sellers in an online environment is called _____. 1
Electronic Payment System (EPS)
a. industrial property
b. copyright.
Industrial property right applies to industry, commerce and agricultural products.
Eg. Patent, Trademark,
Copyright applies to a wide range of creative, intellectual or artistic forms of works.
3. Explain Infringement. 3
Unauthorised use of intellectual property rights are called intellectual property infringement.
Patent infringement - Using or selling a patented invention without permission from the patent holder.
Trademark infringement - Use of a trademark that is identical to a trademark owned by another party, where both the
parties use it for similar products or services.
Copyright infringement - Reproducing, distributing, displaying or adapting a work without permission from the copyright
holder. It is often called piracy.
Cyberspace
1. What is cyberspace? How cyberspace has influenced our life? 2
Cyber space is a virtual environment created by computer systems connected to the Internet.
Formerly, communication was mainly dependent on postal service. Nowadays e-mail has gained wide acceptance
and legal validity for communication.
Social movements organised over social media.
Today, many people prefer to purchase these goods online from e-commerce websites.
Almost all banks offer Internet banking facilities to its customers.
Cyber Crimes
1. Briefly describe about any three types of Cyber crimes against individuals. 3
i. Identity theft: - Use of another person's identifying information, like their name, credit card number, etc. without
their permission to commit fraud or other crimes.
ii. Harassment: - Posting humiliating comments focusing on gender, race, religion, nationality at specific
individuals in chat rooms, social media, e-mail, etc.
iii. Impersonation and cheating: - Impersonation is an act of pretending to be another person for the purpose of
harming the victim.
iv. Violation of privacy: Violation of privacy is the intrusion into the personal life of another, without a valid
reason.
Cyber Ethics
1. Write any two ethical practices can be followed when using internet. 2
Do not respond or act on e-mails sent from unknown sources.
Avoid the use of unauthorised software.
Do not use bad or rude language in social media and e-mails.
Cyber forensics
1. Write a short note on ‘Cyber Forensics’. 3
Traditional law enforcement tools and methodologies do not successfully address the detection, investigation
and prosecution of cyber crime.
Forensics is the process of using scientific knowledge for identifying, collecting, preserving, analyzing and
presenting evidence to the courts.