Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
KENDRIYA VIDYALAYA SANGATHAN
BLUE PRINT
INFORMATICS PRACTICES – CLASS XII
Design of Question Paper
Type of
Questions
Marks per
Question
Total no. of
Questions
Total Marks
SA I 1 20 20
SA II 2 16 32
LA 6 3 18
Total 39 70
Blue Print of the Question Paper
TOPIC SA I
(1)
SA II
(2)
LA (6) Total
1 Networking and Open Source
Software
4 (4) 3 (6) 7 (10)
2 Programming in Java 5 (5) 7 (14) 1 (6) 13 (25)
3 RDBMS 10 (10) 4 (8) 2 (12) 16 (30)
4 IT Applications 1 (1) 2 (4) 3 (5)
Total 20 (20) 16 (32) 3 (18) 39 (70)
NOTE: Marks are given inside the bracket and the number of questions outside the bracket.
MODEL QUESTION PAPER
SUB: INFORMATICS PRACTICES (065)
CLASS – XII
MM: 70 TIME: 3 Hrs
1 (a) Two engineers in the same room have connected their Palm-tops using Bluetooth for
working on a Group presentation. Out of the following, what kind of Network have
they formed?
LAN, MAN, PAN, WAN
Also define the term Bluetooth.
(2)
(b) Diagrammatically show how would you connect 4 PCs, 1 server, 1 printer in :
i. Star topology ii. Bus topology
(2)
(c) Justify that free software is not open source software. (2)
Free software can be copied, distributed, and used freely.
Whereas an Open Source Software comes with its Source code so that it can be
modified.
Like
(d) How is a domain name different from a URL? Give examples of domain names and
URLs.
(2)
(e) What do you mean by Intrusion Problem? Give two examples of Intrusion Problem. (2)
Intrusion Problems: An Intrusion problem is an attempt to mischievously steal some
information from someone's computer. Examples of Intrusion are:
Snooping refers to gaining unauthorized access to another person's or organization's
data.
Eavesdropping refers to gaining unauthorized access to another person's or
organization's data while the data is on its way on the network.
2 (a) Identify the odd one out of the following statements. State reason for your choice.
i) break ii) switch iii) continue iv) return
(1)
(b) What is the difference between setVisible() and setEnabled() methods? (1)
(c) Consider the following code snippet :
int anumber=14;
if (anumber >=10)
if (anumber == 10)
jLabel1.setText("first string");
else jLabel1.setText("second string");
jLabel2.setText("third string");
What will be the output when anumber=14
(1)
(d) Write Java code to assign the value 500 to variable x. Increase the value of x by 50
and store it in variable y.
(1)
(e) Differentiate between XML and HTML. (2)
(f) Mention the tags that are required to be used to create the given table.
Name Age Gender
Nishi 14 Female
Rajat 16 Male
(2)
(g) Write java code that takes the cost of a pencil from jTextField1 and number of pencil (2)
from jTextField2 and calculate total amount as cost*number to be displayed in
jTextField3 and 20% service tax out of total amount in jTextField4.
3 (a) Give full form of DDL and DML. (1)
(b) Charvi is trying to open a database named “School” that exists, but an error is being
displayed. Write the correct SQL statement.
USE DATABASE SCHOOL;
(1)
(c) Pavan has created a table SHOE to store details of shoes. One of the column of the
SHOE table is CODE. Later he decided to make CODE column as primary key. Write
SQL command to add the Primary Key constraints to the column CODE of table
SHOE.
(1)
(d) Pradeep created a table “Class”. Grade is one of the columns of this table. To find the
details of students whose Grades have not been entered, he wrote the following
MySql query, which did not give the desired result.
SELECT * FROM CLASS WHERE GRADE=”NULL”;
write the correct command for Pradeep.
(1)
(e) Consider the table:
Table: Company
SID SALES
S101 20000
S103 NULL
S104 10000
S105 15000
What output will be displayed by the following SQL statement?
(i) SELECT AVG(SALES) FROM COMPANY;
(ii) SELECT COUNT(SID) FROM COMPNY
(2)
(f) Given below is the ‘CUSTOMER’ table:
CustomerID CustomerName CustAddress CustPhone
1 Akhilesh Narang C4,Janak Puri,Delhi 9811078987
2 Purnima Williams B1, Ashok
Vihar,Delhi
9678678711
3 Sumedha Madaan 33, South Ext.,Delhi 6767655412
The following Statements are entered:
SET AUTOCOMMIT = 0;
INSERT INTO CUSTOMER VALUES(4,'Pavan Pandey', ‘C-5, Gomti Nagar,
Lucknow’, 9977453210);
COMMIT;
UPDATE CUSTOMER SET CUSTOMERNAME='Purnima Thapar' WHERE
CUSTOMERID= 2;
INSERT INTO CUSTOMER VALUES(6,'CRISTINA PAUL', ‘223, Jal Vihar,
Udaypur’, 9876230112);
SAVEPOINT A;
DELETE FROM CUSTOMER WHERE CUSTOMERID = 2
SAVEPOINT B;
INSERT INTO CUSTOMER VALUES(5,'FAUZIA ALAM', ‘Mubarak pur,
Bhopal’, 7658792310);
(2)
SAVEPOINT C;
ROLLBACK TO B;
Now what will be the output of the following statement:
SELECT * FROM CUSTOMER ;
(g) The LastName column of a table "Directory" is given below:
Name
Kalpana
Moksha
Latika
Nisha Devi
Shruti
Based on this information, find the output of the following queries:
i) SELECT name FROM Directory WHERE name like "_a%";
ii) SELECT name FROM Directory WHERE name not like "%a";
(2)
4 (a) Define a class with reference to object oriented programming. (1)
(b) What do you mean by Inheritance? Which keyword is used to inherit a class form its
parents.
(2)
(c) Carefully study the code given below:
String Message = "Hello! How are you?", Msg1, Msg2;
Msg1 = Message.substring(7);
Msg2 = Message.substring(0,5);
What will be the contents of the variables Msg1 and Msg2 after the above statements
are executed?
(2)
(d) int a=5, b=10, i;
for (i=0; i<10, i++)
if i = = a
b++; a-- ;
else
b--;
(2)
(e) Rewrite the following code using for loop:
int sum = 0, i= 9;
while (i>=1)
{
if(i%3==0)
sum = sum + i;
else
sum = sum i;
i--;
}
(2)
(f) K.K.Group of hotels has computerized it booking system. The following is the
Booking From along with details: (you may assume default names in sequence or
suitable name for controls).
(6)
Write Java program for the following:
(i) When the command button Calculate Charges is clicked all the charges along with
discount & Total computed and displayed.
Then criterion for the calculation of charges is given below:
Total = (Room charges + fooding charges - discount)
Rates for various services are as follows: Single Room rent: Rs.400 per day, Double
Room rent: Rs.700 per day, Breakfast: Rs.100 per day, Lunch: Rs.180 per day,
Dinner: Rs.200 per Day, Gold card member will be given 20% discount on total
charges.
3
(ii) When ‘CLEAR’ button is clicked, all text fields and checkbox should be cleared. 2
(iii) When ‘CLOSE’ button is clicked, the application should close. 1
5 (a) Consider the two tables given below and answer the questions:
Table : Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30
Table : Department
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7
(2)
(i) What will be the degree and cardinality of the cross – join product of above two
tables?
(ii) Identify the Foreign Keys (if any) of these tables. Justify your choices.
(b) Write the output of the following SQL queries: (2)
(i) SELECT ROUND(543.5694,-1);
(ii) SELECT INSTR(‘INFORMATIONFORM’, ‘FOR’);
(iii) SELECT DAYOFYEAR(‘2016-08-02’);
(iv) SELECT CONCAT("SHEIKH", " HAROON") "FULL NAME";
(c) Write commands in SQL for (i) to (iv) and output for (v) and (vi).
Table: Loans
AccNo Cust_Name Loan_Amount Installments Int_Rate Start_Date
1 RK Gupta 300000 36 12.00 19-07-2009
2 SP Sharma 500000 48 10.00 22-03-2008
3 KP Jain 300000 36 NULL 08-03-2007
4 MP Yadav 800000 60 10.00 06-12-2008
5 SP Sinha 200000 36 12.50 03-01-2010
6 PD Sharma 700000 60 12.50 05-06-2008
7 KS Dhall 500000 48 NULL 05-03-2008
(6)
(i) Display the customer name, loan amount, interest rate and no. of installments in the
descending order of their Start_Date.
(ii) Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the
Cust_Name does not contain 'P'.
(iii) Display the Int_Rate of all the loans started after 01-04-2009.
(iv) To display total loan amount of each no. of installments along with number of
installments.
(v) SELECT DISTINCT Installments FROM Loans;
(vi) SELECT Cust_Name, LENGTH(Cust_Name), Left(Cust_Name, 2) FROM
Loans where Installments = 36;
6 (a) Write an MySQL query to create the table ‘Menu’ with the following structure:
Field Type Constraint
ItemCode Varchar(5) Primary Key
ItemName Varchar(20) Not null
Category Varchar(20) default =
Chinese
Price Decimal(5,2)
(2)
(b) Consider the tables PEOPLE and PROPERTIES given below:
PEOPLE
Name Phone PID
AISHA 9411223344 1
KARAN 9422114455 2
ROSY 9433112244 3
PROPERTIES
PID SPID Farm_Name City
1 1 OLD HOUSE
FARM
DELHI
3 2 NANADA’S FARM FARIDABAD
2 3 WILL’S AGRO GURUGRAM
3 4 TALL FARM DELHI
1 5 THE FLORIST FARIDABAD
(2)
(i) Which column is used to relate the two tables?
(ii) Is it possible to have a primary key and a foreign key both in one table? Justify your
answer with the help of table given above.
(c) With reference to the above given tables, write commands in SQL for (i) and (ii) and
output for (iii) :
(6)
(i) To display the name of farm owner, Farm Name, and Phone number of farms in
Delhi.
(ii) To display PID, SID, Names of Owner, and Farm Names of all those people whose
name does not contains ‘A’.
(iii) SELECT NAME, PHONE
FROM PROPERTIES, PEOPLE
WHERE PROPERTIES.PId = PEOPLE.PId
AND RIGHT(FARM_NAME, 4) <> ‘FARM’;
7 (a) Write two advantages of e-Learning sites. (1)
(b) Which of the following statements is NOT true in e-Governance? Rewrite the
statement after correcting it.
(i) Online applications and tracking of status of applications should be provided.
(ii) Citizens should not be required to submit documents in physical form.
(iii) On line Forms should be made tricky so that only well-educated users can enter
data.
(iv) Government should interact with citizens and enlighten them about different
schemes through social media and web based platforms.
(2)
(c) Mr. Pandey is creating a form for accepting school admission applications. Help him
to choose most appropriate controls out of ListBox, ComboBox, TextField, TextArea,
RadioButton, CheckBox, Label and Command Button for the following entries.
S.No Control used to Control
1 Enter Admission No
2 Enter Gender
3 Choose subjects from list of
subjects
4 Clear the form
(2)
INFORMATICS PRACTICES (065)
ANSWER KEY
1 (a) Two engineers in the same room have connected their Palm-tops using Bluetooth for
working on a Group presentation. Out of the following, what kind of Network have
they formed?
LAN, MAN, PAN, WAN
Also define the term Bluetooth.
(2)
PAN – Personal Area Network
Bluetooth - Bluetooth technology uses radio waves in the frequency range of 2.402
GHz to 2.480 GHz. This technology is used for short range communication (approx.
10m) in a variety of devices for wireless communication.
(1 marks for PAN and 1 Marks for Bluetooth correct answer)
(b) Diagrammatically show how would you connect 4 PCs, 1 server, 1 printer in :
i. Star topology ii. Bus topology
(2)
Star Topology
Bus Topology
(1 marks for each correct diagram)
(c) Justify that free software is not open source software. (2)
Free software can be copied, distributed, and used freely.
Whereas an Open Source Software comes with its Source code so that it can be
modified.
Like
(1 marks each for 2 difference)
Note: Award marks on correct definition of both if difference is not given.
(d) How is a domain name different from a URL? Give examples of domain names and
URLs.
(2)
URL stands for Uniform Resource Locator. It is a web address i.e. a reference to a
web resource that specifies its location on a computer network and a mechanism for
retrieving it.
Domain names are used in URLs to identify particular Web servers.
For example, in the URL http://www.cbse.nic.in/welcome.htm, the domain name is
www.cbse.nic.in.
A domain name usually has more than one parts: top level domain name or primary
domain name and sub-domain name(s). For example, in the domain name, in is the
primary domain name; nic is the sub-domain of in; cbse is the sub-domain of nic.
There are only a limited number of top level domains, and these are divided into two
categories: Generic Domain Names (.com, .net, .edu) and Country-Specific Domain
Names (.in, .uk, .au).
(1 marks for domain name and 1 marks for URL correct answer)
(e) What do you mean by Intrusion Problem? Give two examples of Intrusion Problem. (2)
Intrusion Problems: An Intrusion problem is an attempt to mischievously steal some
information from someone's computer. Examples of Intrusion are:
Snooping refers to gaining unauthorized access to another person's or organization's
data.
Eavesdropping refers to gaining unauthorized access to another person's or
organization's data while the data is on its way on the network.
(1 marks for Intrusion problem)
(½ marks each for snooping and eavesdropping as example)
2 (a) Identify the odd one out of the following statements. State reason for your choice.
i) break ii) switch iii) continue iv) return
(1)
ii) switch
switch is a selection statement but others are jump statements.
(½ marks for identifying)
(½ marks for reason)
(b) What is the difference between setVisible() and setEnabled() methods? (1)
setVisible() sets the visibility of a component i.e. whether the component will be
visible or hidden on form. setEnabled() sets whether the component can trigger an
event or not.
(1 mark for correct answer)
Note: Full 1 mark to be allotted if difference explained with the help of example.
(c) Consider the following code snippet :
int anumber=14;
if (anumber >=10)
if (anumber == 10)
jLabel1.setText("first string");
else jLabel1.setText("second string");
(1)
jLabel2.setText("third string");
What will be the output when anumber=14
The output will be:
second string
third string
(1 marks for correct answer)
Note: Award ½ marks if third string is missing in output.
(d) Write Java code to assign the value 500 to variable x. Increase the value of x by 50
and store it in variable y.
(1)
int x=500;
x=x+50;
int y= x;
( ½ marks to declare and sore 500 to x, ½ marks to increase x and store it to y)
(e) Differentiate between XML and HTML. (2)
XML HTML
Defines, stores and retrieves the
data
Defines how webpage is displayed
XML tags are not predefined HTML tags are predefined
New tags can be created as per
need
New tags cannot be defined
XML tags must have a closing tag. HTML tags may not have closing
tag
XML tags are case-sensitive. HTML tags are not case-sensitive.
(½ marks each for any two correct differences)
(f) Mention the tags that are required to be used to create the given table.
Name Age Gender
Nishi 14 Female
Rajat 16 Male
(2)
<TABLE> … </TABLE>
<TR> … </TR>
<TH> … </TH>
<TD> … </TD>
( ½ marks for each tags)
(g) Write java code that takes the cost of a pencil from jTextField1 and number of pencil
from jTextField2 and calculate total amount as cost*number to be displayed in
jTextField3 and 20% service tax out of total amount in jTextField4.
(2)
double cost=Double.parseDouble(jTextField1.getText());
int n = Integer.parseInt(jTextField2.getText());
double amount=cost * n; jTextField4.setText(Double.toString(amount));
jTextField5.setText (Double.toString(amount * 0.20));
( ½ marks each for fetching the cost and number of pencils from jTextFiled1 and
jTextfield2 respectively, and ½ marks each for calculating and storing total amount
and service tax in jTextField3 and jTextfield4)
3 (a) Give full form of DDL and DML. (1)
DDL – Data Definition Language
DML – Data Manipulation Language
( ½ marks each for correct full form)
(b) Charvi is trying to open a database named “School” that exists, but an error is being (1)
displayed. Write the correct SQL statement.
USE DATABASE SCHOOL;
USE SCHOOL;
(1 marks for correct answer)
(c) Pavan has created a table SHOE to store details of shoes. One of the column of the
SHOE table is CODE. Later he decided to make CODE column as primary key. Write
SQL command to add the Primary Key constraints to the column CODE of table
SHOE.
(1)
ALTER TABLE SHOE ADD PRIMARY KEY(CODE);
( ½ marks for ALTER TABLE and ½ marks for PRIMARY KEY)
(d) Pradeep created a table “Class”. Grade is one of the columns of this table. To find the
details of students whose Grades have not been entered, he wrote the following
MySql query, which did not give the desired result.
SELECT * FROM CLASS WHERE GRADE=”NULL”;
write the correct command for Pradeep.
(1)
SELECT * FROM CLASS WHERE GRADE IS NULL;
(1 marks for correct answer)
Note: ½ mark to be allotted if only error is identified.
(e) Consider the table:
Table: Company
SID SALES
S101 20000
S103 NULL
S104 10000
S105 15000
What output will be displayed by the following SQL statement?
(i) SELECT AVG(SALES) FROM COMPANY;
(ii) SELECT COUNT(SID) FROM COMPNY
(2)
(i) SELECT AVG(SALES) FROM COMPANY;
(ii) SELECT COUNT(SID) FROM COMPNY
(1 marks for each correct answer)
(f) Given below is the ‘CUSTOMER’ table:
CustomerID CustomerName CustAddress CustPhone
1 Akhilesh Narang C4,Janak Puri,Delhi 9811078987
2 Purnima Williams B1, Ashok
Vihar,Delhi
9678678711
3 Sumedha Madaan 33, South Ext.,Delhi 6767655412
The following Statements are entered:
SET AUTOCOMMIT = 0;
INSERT INTO CUSTOMER VALUES(4,'Pavan Pandey', ‘C-5, Gomti Nagar,
Lucknow’, 9977453210);
COMMIT;
UPDATE CUSTOMER SET CUSTOMERNAME='Purnima Thapar' WHERE
CUSTOMERID= 2;
INSERT INTO CUSTOMER VALUES(6,'CRISTINA PAUL', ‘223, Jal Vihar,
(2)
Udaypur’, 9876230112);
SAVEPOINT A;
DELETE FROM CUSTOMER WHERE CUSTOMERID = 2
SAVEPOINT B;
INSERT INTO CUSTOMER VALUES(5,'FAUZIA ALAM', ‘Mubarak pur,
Bhopal’, 7658792310);
SAVEPOINT C;
ROLLBACK TO B;
Now what will be the output of the following statement:
SELECT * FROM CUSTOMER ;
CustomerID CustomerName CustAddress CustPhone
1 Akhilesh Narang C4,Janak Puri,Delhi 9811078987
3 Sumedha Madaan 33, South Ext.,Delhi 6767655412
4 Pavan Pandey C-5, Gomti Nagar,
Lucknow
9977453210
6 CRISTINA
PAUL
223, Jal Vihar, Udaypur 9876230112
(½ mark for each row)
(g) The LastName column of a table "Directory" is given below:
Name
Kalpana
Moksha
Latika
Nisha Devi
Shruti
Based on this information, find the output of the following queries:
i) SELECT name FROM Directory WHERE name like "_a%";
ii) SELECT name FROM Directory WHERE name not like "%a";
(2)
i)
Name
Kalpana
Latika
ii)
Name
Nisha Devi
Shruti
(1 marks for each correct answer – ½ marks for each correct name)
4 (a) Define a class with reference to object oriented programming. (1)
A class is a template definition of the methods and variables in a particular kind of
object. An object is a specific instance of a class.
(1 marks for correct answer)
(b) What do you mean by Inheritance? Which keyword is used to inherit a class form its
parents.
(2)
The concept of Inheritance allows reusability of code by including features of already
existing class (called the base class) in a new class (called the derived class).
The extends keyword is used to inherit data members and methods of the base class
and allows the derived class to use these methods.
(1 marks for each correct answer)
(c) Carefully study the code given below:
String Message = "Hello! How are you?", Msg1, Msg2;
Msg1 = Message.substring(7);
Msg2 = Message.substring(0,5);
What will be the contents of the variables Msg1 and Msg2 after the above statements
are executed?
(2)
Msg1 = How are you?
Msg2 = Hello
(1 marks for each correct answer)
(d) int a=5, b=10, i;
for (i=0; i<10, i++)
if i = = a
b++; a-- ;
else
b--;
(2)
int a=5, b=10, i;
for (i=0; i<10 ; i++)
if ( i = = a )
{
b++;
a-- ;
}
else
b--;
(½ mark for correcting each error)
OR
(1 mark for only identifying any four errors)
(e) Rewrite the following code using for loop:
int sum = 0, i= 9;
while (i>=1)
{
if(i%3==0)
sum = sum + i;
else
sum = sum i;
i--;
}
(2)
int sum = 0, i;
for( i=9; i>=1; i--)
{
if(i%3==0)
sum = sum + i;
else
sum = sum i;
}
(½ mark for correct initialization of i)
(½ mark for correct condition)
( ½ mark for correct loop body)
( ½ mark for correct updation of i )
(f) K.K.Group of hotels has computerized it booking system. The following is the
Booking From along with details: (you may assume default names in sequence or
suitable name for controls).
Write Java program for the following:
(6)
(i) When the command button Calculate Charges is clicked all the charges along with
discount & Total computed and displayed.
Then criterion for the calculation of charges is given below:
Total = (Room charges + fooding charges - discount)
Rates for various services are as follows: Single Room rent: Rs.400 per day, Double
Room rent: Rs.700 per day, Breakfast: Rs.100 per day, Lunch: Rs.180 per day,
Dinner: Rs.200 per Day, Gold card member will be given 20% discount on total
charges.
3
double rent, meals=0, disc=0, toal;
int days;
days=Integer.parseInt(jTextField1.getText());
if (jRadioButton1.isSelected())
rent = 400*days;
else
rent = 700*days;
if (jCheckBox2.isSelected())
meal = meal + 100;
if (jCheckBox3.isSelected())
meal = meal + 180;
if (jCheckBox4.isSelected())
meal = meal + 200;
meal = meal*days;
total=rent+meal;
if (jCheckBox1.isSelected())
disc=total*.2;
total=total-disc;
jTextField3.setText(“ ”+rent);
jTextField4.setText(“ ”+meal);
jTextField5.setText(“ ”+disc);
jTextField6.setText(“ ”+total);
( ½ mark fetching data from text field, ½ marks for calculation of rent, ½ marks for
calculation of meal, ½ marks for calculation of total, ½ marks for the calculation
of discount, and ½ marks for displaying of data in text fields)
(ii) When ‘CLEAR’ button is clicked, all text fields and checkbox should be cleared. 2
jTextField1.setText(“ ”);
jTextField2.setText(“ ”);
jTextField3.setText(“ ”);
jTextField4.setText(“ ”);
jTextField5.setText(“ ”);
jTextField6.setText(“ ”);
jCheckBox1.setSelected(false);
jCheckBox2.setSelected(false);
jCheckBox3.setSelected(false);
jCheckBox4.setSelected(false);
jRadioButton1.setSelected(false);
jRadioButton2.setSelected(false);
( 1 mark for clearing text fields)
( ½ mark for clearing check box and ½ marks for clearing radio buttons)
Note : NULL, in place of “ ” to be accepted for clearing text field.
(iii) When ‘CLOSE’ button is clicked, the application should close. 1
System.exit(0);
(1 marks for correct answer)
5 (a) Consider the two tables given below and answer the questions:
Table : Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30
Table : Department
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7
(2)
(i) What will be the degree and cardinality of the cross – join product of above two
tables?
Degree = 12 and Cardinality = 21
( ½ marks for each correct answer)
(ii) Identify the Foreign Keys (if any) of these tables. Justify your choices.
Dept is the foreign key in the table Employee as it is the primary key in the table
Department.
( ½ marks for correct foreign key and ½ marks for justification)
(b) Write the output of the following SQL queries: (2)
(i) SELECT ROUND(543.5694,-1);
540
(½ mark for correct output)
(ii) SELECT INSTR(‘INFORMATIONFORM’, ‘FOR’);
3
(½ mark for correct output)
(iii) SELECT DAYOFYEAR(‘2016-08-02’);
2016
(½ mark for correct output)
(iv) SELECT CONCAT("SHEIKH", " HAROON") "FULL NAME";
FULL NAME
---------------
SHEIKH HAROON
(½ mark for correct output)
(c) Write commands in SQL for (i) to (iv) and output for (v) and (vi).
Table: Loans
AccNo Cust_Name Loan_Amount Installments Int_Rate Start_Date
1 RK Gupta 300000 36 12.00 19-07-2009
2 SP Sharma 500000 48 10.00 22-03-2008
3 KP Jain 300000 36 NULL 08-03-2007
4 MP Yadav 800000 60 10.00 06-12-2008
5 SP Sinha 200000 36 12.50 03-01-2010
6 PD Sharma 700000 60 12.50 05-06-2008
7 KS Dhall 500000 48 NULL 05-03-2008
(6)
(i) Display the customer name, loan amount, interest rate and no. of installments in the
descending order of their Start_Date.
SELECT CUST_NAME, LOAN_AMOUNT, INT_RATE, INSTALLMENTS
FROM LOANS
ORDER BY START_DATE DESC;
( ½ marks for SELECT )
( ½ marks for ORDER BY )
(ii) Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the
Cust_Name does not contain 'P'.
SELECT ACCNO, CUST_NAME, LOAN_AMOUNT
FROM LOANS
WHERE CUST_NAME NOT LIKE ‘%P%’;
( ½ marks for SELECT )
( ½ marks for LIKE condition )
(iii) Display the Int_Rate of all the loans started after 01-04-2009.
SELECT INT_RATE
FROM LOANS
WHERE START_DATE > ‘01/04/2009’;
OR
SELECT INT_RATE
FROM LOANS
WHERE START_DATE > 01042009;
( ½ mark for SELECT )
( ½ mark for WHERE condition )
(iv) To display total loan amount of each no. of installments along with number of
installments.
SELECT SUM(LOAN_AMOUNT),INSTALLMENTS FROM LOANS
( ½ mark for SELECT )
( ½ mark for GROUP BY clause )
(v) SELECT DISTINCT Installments FROM Loans;
Instalments
36
48
60
(1 marks for correct output)
(vi) SELECT Cust_Name, LENGTH(Cust_Name), Left(Cust_Name, 2) FROM
Loans where Installments = 36;
Cust_Name LENGTH(Cust_Name) Left(Cust_Name, 2)
RK Gupta 8 RK
KP Jain 7 KP
SP Sinha 8 SP
(1 marks for correct output)
6 (a) Write an MySQL query to create the table ‘Menu’ with the following structure:
Field Type Constraint
ItemCode Varchar(5) Primary Key
ItemName Varchar(20) Not null
Category Varchar(20) default =
Chinese
Price Decimal(5,2)
(2)
Create table Menu
( ItemCode varchar(5) Not Null Primary Key,
ItemName varchar(20),
Category varchar(20) default ‘Chinese’,
Price decimal(5,2)
);
(½ Mark for CREATE TABLE )
(½ Mark for Column Names with Data Types)
(½ Mark for PRIMARY KEY Constraint)
(½ Mark for DEFAULT Constraint)
(b) Consider the tables PEOPLE and PROPERTIES given below:
PEOPLE
Name Phone PID
AISHA 9411223344 1
(2)
KARAN 9422114455 2
ROSY 9433112244 3
PROPERTIES
PID SPID Farm_Name City
1 1 OLD HOUSE
FARM
DELHI
3 2 NANADA’S FARM FARIDABAD
2 3 WILL’S AGRO GURUGRAM
3 4 TALL FARM DELHI
1 5 THE FLORIST FARIDABAD
(i) Which column is used to relate the two tables?
PID column is used to connect the two tables.
(1 mark for correct column name)
(ii) Is it possible to have a primary key and a foreign key both in one table? Justify your
answer with the help of table given above.
Yes.
As in the Table: PROPERTIES, SID can be used as Primary key and PID is the
foreign key.
(½ Mark for correct answer)
(½ Mark for correct justification)
(c) With reference to the above given tables, write commands in SQL for (i) and (ii) and
output for (iii) :
(6)
(i) To display the name of farm owner, Farm Name, and Phone number of farms in
Delhi.
SELECT NAME, FARM_NAME, PHONE
FROM PROPERTIES, PEOPLE
WHERE PROPERTIES.PId = PEOPLE.PId
AND CITY = ‘Delhi’;
(1 marks for correct use of SELECT and FROM )
( ½ marks for each condition using WHERE clause)
(ii) To display PID, SID, Names of Owner, and Farm Names of all those people whose
name does not contains ‘A’.
SELECT PEOPLE.PID, SID, NAME, FARM_NAME
FROM PEOPLE, PROPERTIES
WHERE PEOPLE.PId = PROPERTIES.PId
AND NAME NOT LIKE ‘%A%’;
(1 marks for correct use of SELECT and FROM )
( ½ marks for each condition using WHERE clause)
(iii) SELECT NAME, PHONE
FROM PROPERTIES, PEOPLE
WHERE PROPERTIES.PId = PEOPLE.PId
AND RIGHT(FARM_NAME, 4) <> ‘FARM’;
NAME Farm_Name
KARAN WILL’S
AGRO
AISHA THE
FLORIST
(1 marks for each line of correct output)
7 (a) Write two advantages of e-Learning sites. (1)
Self-paced learning
Unlimited revisions
Facilitates electronic delivery of customized learning objects
Facilitates teacher-student interaction
Facilitates peer-peer interaction
( ½ marks for each answer)
(b) Which of the following statements is NOT true in e-Governance? Rewrite the
statement after correcting it.
(i) Online applications and tracking of status of applications should be provided.
(ii) Citizens should not be required to submit documents in physical form.
(iii) On line Forms should be made tricky so that only well-educated users can enter
data.
(iv) Government should interact with citizens and enlighten them about different
schemes through social media and web based platforms.
(2)
(iii) Online Forms should be made so simple that all users can enter data
( 1 marks for identifying (iii) as answer)
( 1 marks for writing correct statement)
OR
( ½ marks each for mentioning any one of (i), (ii) or (iv) as True)
(c) Mr. Pandey is creating a form for accepting school admission applications. Help him
to choose most appropriate controls out of ListBox, ComboBox, TextField, TextArea,
RadioButton, CheckBox, Label and Command Button for the following entries.
S.No Control used to Control
1 Enter Admission No
2 Enter Gender
3 Choose subjects from list of
subjects
4 Clear the form
(2)
S.No Control used to Control
1 Enter Admission No Text Field
2 Enter Gender Radio Button
3 Choose subjects from list of
subjects
List Box
4 Clear the form Command
Button
( ½ marks for each answer)