CBSE Question Paper With Solution-2014 (Outside Delhi) Class XII (IP)
CBSE Question Paper With Solution-2014 (Outside Delhi) Class XII (IP)
CBSE Question Paper With Solution-2014 (Outside Delhi) Class XII (IP)
1
1
Help him to write code for the following:
(i) On the click of ‘Calculate’ button, textfield for ‘Entry Fees’ should display Entry Fees
per person x number of people.
If ‘Water Park’ check box is selected, textfield for ‘Water Park charges’ should display
Water Park Charges per Person x Number of People. textField for ‘total Amount’
should display sum of Entry Fees and Water Park charges for all the people in the
group.
(ii) Write java code to clear all Textboxes on the click of ‘Clear’ Button.
(iii) Write java Code to close the application on the click of ‘Exit’ Button.
Ans. Int wfee=0;
(i) Int tfee=0;
Int nop=Integer.parseInt(JTextField1.getText());
Int efee=nop*500;
If(JCheckBox1.isSelected())
Wfee=nop*500;
tfee=efee+wfee;
jTextField2.setText(“” +efee);
jTextField3.setText(“” +wfee);
jTextField4.setText(“” +tfee);
(ii) JTextField1.setText(“” );
JTextField2.setText(“” );
JTextField3.setText(“” );
JTextField4.setText(“” );
(iii) System.exit(0);
Q5 (a) What is the difference between “%” and “ _ “ wild card character with reference to LIKE 2
clause of MySQL?
Ans. “%” is used to represent any sequence of Zero or more characters wheras
“_” is used to represent a single character.
(b) Name a function of MySQL used to give the first occurance of a string2 in string1. 1
Ans. INSTR()
(C) Consider the following table names EXAM with details of marks. Rite command of MySQl 7
for (i) to (IV) and Output for (v) to (Vii).
Table EXAM
Adno SName Percentage Clsection Stream
R001 Sushant 90.2 12A Science
R002 Vaidyanath 80.5 12B Humanities
R003 Miara 68.9 12B Science
R004 Niara 96.0 12A Commerce
R005 Shinjini 88.9 12D Commerce
(i) To display all information of the students of humanities in descending order of
percentage.
(ii) To display Adno, Name, Percentage and Stream of those students whose
name is less than 6 characters long.
(iii) To add another column Bus)Fees with datatype and size as decimal (8,2).
(iv) To increase percentage by 2% of all the humanities students.
(v) SELECT COUNT(*) FROM EXAM;
(vi) SELECT Sname, Percentage FROM EXAM WHERE Name LIKE “N%”;
(vii) SELECT ROUND(Percentage,0) FROM EXAM WHERE Adno=”R005”;
(i) SELECT * FROM EXAM WHERE Stream=”Humanities” ORDER BY Percentage DESC.
(ii) SELECT Adno,SName,Percentage, Stream FROM EXAM WHERE LENGTH(SName)<6
(iii) ALTER TABLE EXAM ADD (Bus_Fees DECIMAL (8,2));
(iv) UPDATE EXAM Set percentage =Percentage +(Percentage *0.02)
Where Stream =’Humanities’
( v) 5
(vi) Niara 96.0
(vii) 89
Q6 (a) Write MySQL command to create the table “Toyz” with the following structure and 2
constraints.
Table : TOYZ
Colun_Name Datatype(Size) Constraints
Toy_no Int(10) Primary Key
Tou_name Varchar(20)
Type Char(10)
Price Decimal(8,2)
Colour Varchar(15)
Ans. CREATE TABLE Toyz
( Toy_no Int(10) Primary Key,
Toy_name VARCHAR(20),
Typer CHAR(10),
Price DECIMAL (8,2),
Colour VARCHAR(15) );
(b) In the Database –SAMS and VENDOR are two tables with the following information. Write
MySQL queries for (i) to (iii), based on the tables SAMS and VENDORS.
Table: SAMS
ICode IName Price Colour VCode
S001 Refrigerator 20000 Blue P01
S002 Mobile Phone 45000 Black P02
S003 LCD 60000 Silver P03
S004 Washing Machine 12500 Smoke P01
S005 Air Conditioner 16000 White P03
Table: VENDOR
VCode VName
P01 Satish
P02 Manoj
P03 Subodh
P04 Jacob
(i) To display ICode, IName and VName of all the Vendors, who manufacture
2
“Refrigerator”
(ii) To display IName, ICode, VName and Price of all the products whose price is more
2
than 20000.
(iii) To display vendor names and names of all items manufactured by vendor whose
2
code is “P03”.
Ans. SELECT ICode,IName,VName FROM SAMS S, VENDOR V
(i) WHERE S.VCode=V.VCode AND IName=’Refrigerator’
SELECT ICode,IName,VName,Price FROM SAMS S,VENDOR V
(ii) WHERE S.VCode=V.VCode AND Price>20000;
SELECT VName,IName FROM SAMS S,VENDOR V
(iii) WHERE S.VCode=V.VCode AND VCode=’P03’
(c) With reference to SAMS table, which column should be set as the Primary key? Which 2
column is the foreign key? Give reasons.
Ans. Primary Key-ICode
Reason: ICode is Unique to every row in the table SAMS
Foreign Key: Code
Reason: Code is the Primary key of the table VENDOR. It is used to link two tables SAMS
and VENDORS and is enforcing referential integrity, hence VCode column can be
considered as Foreign Key for the table SAMS.
Q7 (a) Define e-Business. Name one popularly used e-Business website. 1
Ans. Using Technology to do business
www.ebay.in,www.flipkart.com,www.jabong.com
(b) How does e-Governance help in reducing corruption? Write two points. 2
Ans. (i) Improve transparency in governance
(ii) Speedy governance
(iii)Bring more accountability
(c) Suruchi works for a Shopping Mart.She wants to create controls on a form for the 2
following operations.
Choose most appropriate control out of Text box, Label, Radio Button, list box, combo box,
Check Box and Command button.
S.No. FUNCTIONS CONTROL/S
1 Enter the Item Code
2 Select Item Size (from a list of sizes)
3 Enter Quantity
4 Submit the Form
Ans. S.No. FUNCTIONS CONTROL/S
1 Enter the Item Code Text box/Text Field
2 Select Item Size (from a list of sizes) List Box /Combo box
3 Enter Quantity Text Box/ Text Field
4 Submit the Form Command Button