Informatics Practices
Informatics Practices
Informatics Practices
Time allowed : 3 hours Instruction: Please chck that this quetion paper contains 8 printed pages. Code number given on the right hand side of the question paper should be written on the title page of the answer-book by the candidate. Please check that this question paper contains 7 questions. Please write down the serial number of the question before attempting it. 15 minutes time has been allotted to read this question paper. The question paper will be distributed at 10.15 a.m. Form 10.15 a.m. to 10.30 a.m., the student will read the question paper only and not write any answer script during this period. Maximum Marks : 70
QUESTION PAPER CODE NO. 90/1 SECTION A Q1 Answer the questions after carefully reading the text. (a) Ms. Taufiq Ahmed wants to prevent unauthorized access to/from his company's local area network. Write the name of a system (software/ hardware), which he should install to do the same Beauty Lines Fashion Inc. is a fashion company with design unit and market unit 135 metres away from each other. The company recently connected their LANs using Ethernet cable to share the stock related information. But after joining their LANs, they are not able to share the information due to loss of signal in between. Which device out of the following. should you suggest to be installed for a smooth communication? (i) (ii) (iii) (c) UPS Modem Repeater 1
(b)
which of the following is not a feature of Networking? (i) (ii) Resource sharing Uninterrupted power supply
260
Name any two Indian scripts included in Unicode. Mr. Jayanto Das is confused between Shareware and Open source software Mention at least two points of differences to help her understand the same. Identify the type of Topology from the following: (i) (ii) If each node is connected with the help of independent cable with the help of a central switching (communication controller) If each node is connected with the help of a single co-axial cable.
(g)
Define the following with reference to Threats to Network Security. (i) (ii) Trojan Horse Worm
Q2
(a)
While working in Netbeans, Ms Kanta Surbhi wants to display 'Cleared' or 'Re-attempt required' message depending the marks entered in jTextField. Help her to choose more appropriate statement out of 'If statement' and 'Switch statement'. Write a statement to make jTextArea1 as un-editable. Which HTML tags are used for making a table and adding rows in a HTML document? How is <UL> tag different from <OL> tag of HTML? What will be the value of A and B after execution of the following code: int A = 100, B ; for (B=10; B<=12; B++) { A+=B; } JOptionPane. showMessageDialog (this, A:+A+B:+B+) ;
1 1 1 1 2
(f)
261
(g)
Write Java code that takes the price of a pencil from jTextField1 and quantity of pencils from jTextField2 and calculates total amount as price * quantity to be displayed in jTextField3 and also find 10% tax amount to be displayed in jTextField4. Write MySql command will be used to open an already existing database "LIBRARY". The Mname Column of a table Members is given below: Mname Aakash Hirav Vinavak Sheetal Rajeev Based on the information, find the output of the following queries: (i) (ii) Select Mname from members where mname like "%v"; Select Mname from members where mname like "%e%";
2 1 2
Q3
(a) (b)
A table "TRAINS" in a database has degree 3 and cardinality 8. What is the number of rows and columns in it? Differentiate between Alternate key and Candidate key. Define data encapsulation with reference to Object Oriented Programming. An worker-Id consisting of 4 digits is stored in a string variable strWrkld. Now Mr. Jai wants to store this Id in integer type of variable IntWrkld Write a Java statement to do this. Sarthya, a student of class XI, created a table "RESULT". Grade is one of the column 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 Result WHERE Grade = "Null"; Help Sarthya to run the query by removing the errors from the query and write the correct Query.
262
2 1 1
(g)
Q4
(a)
What will be displayed in jTextField1 after executing the following code. int N = 20; N=N+l; If (N<21) jTextField1.setText(Integer.toString(N+10)); else jTextField1.setText(Integer.toString(N+15));
(b)
Rewrite the following program code using a Switch statement. if (code ==1) Day = "Monday" ; else if (code == 2) Day = "Tuesday" ; else if ( code ==3) Day = "Wednesday" ; else if ( code == 4) Day = "Thursday" ; else Day = "No Match" ;
(c)
What will be displayed In jTextArea1 after executing the following statement: jTextAreal.setText("Live\nIn Peace\t and harmony") ;
(d)
The following code has some error(s). Rewrite the correct code underlining all the corrections made: Int P=3; sum = 0; //Declaring P and sum as Integer { Sum = P; P += 3; } while (P=<12) jTextField1 (Integer.tostring(sum)) ;
263
(e)
Given a string object namely 'VALUE', having value as "324" stored in it. What will be result of the following: JOptionPane.showMessageDialog(null,""+(Value.length()+ Integer.parseInt(value))) ;
(f)
The following code has some error(s). Rewrite the correct code underlining all the corrections made: int Total = 0, Jump = 5; int I; for (i = 0, I =<5, i ++) { Jump+ =5, Total +=Jump; } jTextAreal.showText (" " + Total) ;
(g)
Mr. Ram Kishore, the owner of the Kiddi Land Enterprises has asked his programmer Saumya to develop the following GUI in Netbeans.
Mr. Ram accepts payment through three types of credit cards. The offer is given according to the following scheme:
264
If the Bill amount is more than Rs.25,000/- then the customer gets an additional offer of 5%. Write the Java code for the following: (a) (b) To assign Additional offer as 0(jTextField4) and Net amount as 0 (jTextField5). Also set them as un-editable. [when "Calculate Offer"(JButton1) is clicked] To calculate discount as per the given criteria and display the same in jTextField3. To assign Additional offer (jTextField4) as 5% of amount(jTextField2) as per the above condition. To enable "Calculate Net Amount"(jButton2) button (c) [When "Calculate Net Amount" (jButton2) is clicked] To calculate net amount as [TotalCost(jTextField2)]-offer(jTextField3) -Additional offer (jT extField4)] To display the net amount in jTextField5 Q5 (a) (b) What is the purpose of DROP TABLE command in MySql ? How is it different from DELETE command? Table Employee has 4 records and Table Dept has 3 records in it. Mr. Jain wants to display all information stored in both of these related tables. He forgot to specify equi-join condition in the query. How many rows will get displayed on execution of this query? Consider the table RESULT given below Write commands in MySql for (i) to (iv) and output for (v) to (vii) : Table: Result No Name 1 2 3 4 5 6 Sharon Amal Vedant Shakeer Anandha Upasna Stipend 400 680 500 200 400 550 Subjet English Mathematics Accounts Informatics History Geography
265
(c)
Average 38 72 67 55 85 45
To list the names of those students, who have obtained Division as FIRST in the ascending order of NAME. To display a report listing NAME, SUBJECT and Annual stipend received assuming that the stipend column has monthly stipend. To count the number of students, who have either Accounts or Informatics as Subject. To insert a new row in the table EXAM: 6, "Mohan", 500, "English", 73, "Second"
1 1 1
(v) (vi)
SELECT AVG (Stipend) FROM EXAM WHERE DIVISION = "THIRD" ; SELECT COUNT(DISTINCT Subject) FROM EXAM;
(vii) SELECT MIN(Average) FROM EXAM WHERE Subject = "English"; Q6 a) Write a MySQL command for creating a table "PAYMENT" whose structure is given below: Table: PAYMENT Field Name Loan_number Payment_number Payment_date Payment_amount b) Datatype Integer Varchar Date Integer 8 Not Null 2 Size 4 3 Constraint Primary key 2
In a database there are two tables "Product" and "Client" as shown below: Table: PRODUCT P_ID P001 P002 P003 P004 P005 ProductName Moisturiser Sanitizer Bath Soap Shampoo Lens Solution Manufacture XYZ LAC COP TAP COP Price 40 35 25 95 350
266
Table: Client C_ID 01 05 12 15 ClientName Dreamz Disney Life Line Inc 98.4 Appolo City New Delhi Mumbai New Delhi Banglore P_ID P002 P005 P001 P003
Write the commands in SQL queries for the following: (i) (ii) (iii) (c) To display the details of Product whose Price is in the range of 40 and 120 (Both values included) To display the ClientName, City from table Client and ProductName and Price from table Product, with their corresponding matching P_ID To increase the Price of all the Products by 20. In a Database School there are two tables Member and Division as show below. Table: Member Empld 1001 1003 1002 Table: Division Divno 10 20 30 (i) (ii) Divname Media Dance Production Location TF02 FF02 SF01 1 Name Shankhya Ridhima Sunish Pay 34000 32000 45000 Divno 10 50 20 1
Identify the foreign key in the table Member. What output, you will get, when an equal-join query is executed to get the Name from Member Table and corresponding from Division table?
267
Q7
a) b) c) d)
What is the impact of e-Learning sites on students learning process? Write two advantages of e-Business sites. Write three important features of e-Governance? Give URL of one of the commonly used e-Governance portal. Jaina is creating a form for her practical file. Help her to choose most appropriate controls from List Box, Combo Box, TextField, TextArea, Radio Button, Check box, Label and Command button for the following entries from user. (i) (ii) (iii) (iv) A message "Enter Name" in front of a Text Field. An input to choose more than one subjects from a set of given choices. An input for entering comments of user. An input for accepting the residential area out of Rural and Urban as options. INFORMATICS PRACTICES QUESTION PAPER CODE 90
1 1 2
1.
(a)
Mr. Kant Sengupta wants to prevent unauthorized access to/from his company's local area network. Write the name of a system (software/ hardware), which he should install to do the same. Seven Brothers Fashion Inc. is a fashion company with design unit and market unit 130 meters away from each other. The company recently connected their LANs using ethernet cable to share the stock related information, But after joining their LANs they are not able to share the information due to loss of signal in between. Which device out of the following should you suggest to be installed for a smooth communication? (i) (ii) (iii) Modem Repeater UPS
(b)
(c)
Which of the following is not a feature of Networking? (i) (ii) Resource Sharing Reliability
268
Name any two Indian scripts included in Unicode. Ms. Vidya Chauhan is confused between Proprietary Software and Open Source Software. Mention at least two points of difference to help her understand the same. Identify the type of Topology from the following (i) (ii) In it, each node is connected with the help of a single co-axial cable. In it. each node is connected with the help of independent cable with the help of a central switching (communication controller).
2 2
(f)
(g)
Define the following with reference to Threats of Network Security: (i) (ii) Worm. Trojan Horse
2.
(a)
While working in Netbeans, Mr. Khorana wants to display 'Pass' or 'Needs to Reappear' message depending on the marks entered in jTextField. Help her to choose the more appropriate statement out of 'If statement' and 'Switch statement'. How one can make a Text Field un-editable on a Frame? Which HTML tags are used for making a table and adding rows in HTML document? How is <OL> tag different from <UL> tag of HTML? What will be the value of P and Q after execution of the following code? int P, Q=100; for (P=10; P<=12; P++) { Q+P; } JOptionPane.showMessageDiaog (this, "P:"+P+" Q:"+Q+"");
1 1 1 1 2
269
(f) (g)
Differentiate between XML and HTML. Write Java code that takes the cost of a pencil from jTextField1 and number of pencils from jTextField2 and calculates total amount as cost*number to be displayed in jTextField3 and 20% service tax out of total amount in jTextField4. Write MySql command that will be used to open an already existing database "CONTACTS. The Doc_name Column of a table Hospital is given below: Doc name Avinash Hariharan Vinayak Deepak Sanjeev Based on the information, find the output of the following queries: (i) (ii) SELECT doc_name FROM Hospital WHERE doc_name like "%v"; SELECT doc_name FROM Hospital WHERE doc_name like "%e%";
2 1 2
3.
(a) (b)
(c)
A table "Transport" in a database has degree 3 and cardinality 8. What is the number of rows and columns in it?
Differentiate between Alternate key and Candidate key. Define a class with reference to object Oriented Programming. An employee_ld consisting of 5 digits is stored in a string variable strEmpld. Now Mr.Deb wants to store this Id in Integer type of variable InteEmpld. Write Java statement to do this. Sarthak, 'a students of class XII, 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"; Help Sarthak to run the query by removing the errors from the query and write the correct query.
1 1
(g)
270
(a)
What will be displayed in of jTextField1 after executing the following code? int m = 16 ; m = m+l ; if (m<15) jTextField.setText (Integer. toString (m) ) ; else jTextField.setText (Integer. toString (m+15) ) ; .
(b)
Rewrite the following program code using a Switch statement: if (code ==1) Month = "January"; else if (code ==2) Month = "February"; else if (code==3) Month = "March"; else if (code==4) Month = "April"; else Month = "No Match";
(c) (d)
What will be displayed in jTextArea1 after executing the following statement? jTextAreal.setText ("cbse\nFinal_Exam \ tIp") ; . The following code has some errors(s). Rewrite the correct code underlining all the corrections made: Int k=2 ;Sum = 0; //Declaring k and sum as Integer { sum = k ; k+=2; } While (k=<20) ; jTextFieldl (Integer.tostring(sum)) ;
271
(e)
Given a String object namely 'subject' having value as 123 stored in it. What will be result of the following? JOptionPane.showMessageDialoge (null, " " + (subject.length ( ) + Integer.parselnt (subject)) ) ;
(f)
The following code has some error(s). Rewrite the correct code underlining all the corrections made: int Sum=0, Step=5 ; int I ; for (i = 0, i =<5, i++) { Step+=5, Sum+=Step ; } jTextAreal.showText{" "+Sum) ;
(g)
Mr. Radhey Shyam Bansal the owner of the Kiddi Land Enterprises has asked his programmer Ekta to develop the following GUI in Netbeans:
272
Mr. Bansal accepts payment through three types of credit cards The discount is given according to the following scheme: Type of Card Platinum Gold Silver Discount 20% of amount 15% of amount 10% of amount
If the Bill amount is more than Rs, 25,000, then the customer gets an additional discount of 5%. Write Java code for' the following: (i) (ii) To assign Additional Discount as 0 (jTextField4) and Net Amount as 0 (jTextField5). Also set them as un-editable. [When "Calculate Discount" (jButton1) is clicked] To calculate discount as per the given criteria and display the same in jTextField3 To assign Additional Discount (jTextField4) as 5% of amount (jTextField2) as per the above condition. To enable "Calculate Net Amount" (jButton2) button (iii) [When "Calculate Net Amount" (jButton2) button is clicked] To calculate Net Amount as [TotalCost (jTextField2) - Discount (jTextField3) - Additional Discount (jTextField4)] To display the Net Amount in jTextField5 5 (a) (b) What is the purpose of ALTER TABLE command in MySql? How is it different from UPDATE command? Table Employee has 4 records and Table Dept has 3 records in it. Mr. Jain wants display all information stored in both of these related tables. He forgot to specify equi-join condition in the query, How many rows will get displayed on execution of this query? Consider the EXAM given below. Write commands in MySql for (i) to (iv) and output for (v) to (vii).
(c)
273
Table: EXAM No Name 1 2 3 4 5 6 (i) (ii) (iii) (iv) (v) (vi) Karan Aman Javed Bishakh Sugandha Suparna Stipend 400 680 500 200 400 550 Subjet English Mathematics Accounts Informatics History Geography Average 68 72 67 55 35 45 Division FIRST FIRST FIRST SECOND THIRD THIRD
To list the names of those students. who have obtained Division as FIRST in the ascending order of NAME. To display a report listing NAME, SUBJECT and Annual stipend received assuming that the stipend column has monthly stipend. To count the number of students, who have either Account or Informatics as Subject. To insert a new row in the table EXAM: 6 Mohan, 500, English, 73, SECOND; SELECT AVG (Stipend) FROM EXAM WHERE DIVISION="THIRD"; SELECT COUNT (DISTINCT Subject) FROM EXAM.. WHERE Subject = "English";
1 1 1
1 1
(vii) SELECT MIN (Average) FROM EXAM 6 (a) Write a MySql command for creating a table "BANK" whose structure is given below: Table: BANK Field Name Acct_number Name BirthDate Balance Datatype Integer Varchar Date Integer
274
Size 4 3
Not Null
(b)
In a database there are two tables "ITEM" and "CUSTOMER" as shown below: Table: ITEM ID 1001 1002 1003 1004 1005 ItemName Moisturiser Sanitizer Bath Soap Shampoo Lens Solutions Company XYZ LAC COP TAP COP Price 40 35 25 95 350
Table: CUSTOMER C_ID 01 05 12 15 CustomerName Samridhh Ltd Big Line Inc 97,8 Tom N Jerrv City New Delhi Mumbai New Delhi Bangalore ID 1002 1005 1001 1003
Write the commands in SQL queries for the following: (i) (ii) (iii) (c) To display the details of Item, whose Price is in the range of 40 and 95 (Both values included). To display the CustomerName. City from table Customer, and ItemName and Price from table item, with their corresponding matching ID. To increase the Price of al the Products by 50. In a Database School there are two tables Employee and Dept as shown below: Table: Employee Empld T001 T001 T001 Name Vishakha Mridul Manish Sal 34000 32000 45000 Deptno 10 50 20 1 2 2
275
Table: Dept Deptno 10 20 30 (i) (ii) 7. (a) (b) (c) (d) DName Lights Dance Production Locaionld HH02 FF02 AB01 1 1 1 1 2
Identify the foreign key in the table Employee. What output, will you get, when an equi-Join query is executed to get the NAME from Employee table and corresponding DNAME from Dept table? Give one social impact of e-Business. Write two advantages of e-Learning sites. Write three important features of e-Governance. Give URL of one of the commonly used - eGovernance portals. Anuja is creating a form for her practical file. Help her to choose most appropriate controls from List Box, Combo Box, TextField, TextArea, Radio Button, Check box, Label and Command button for the following entries from user: (i) (ii) (iii) (iv) A message "Enter Marks" in front of a Text Field. An input to choose more than one subject from a set of choices. An input for entering remarks An input for accepting Gender.
276
QUESTION PAPER CODE 90/1 EXPECTED ANSWERS Q1 Answer the questions after carefully reading the text. (a) Ms. Taufiq Ahmed wants to prevent unauthorized access to/from his company's local area network. Write the name of a system (software/ hardware), which he should install to do the same
Ans: Firewall or Intrusion Detection System (1 mark for correct answer) (b) Beauty Lines Fashion Inc. is a fashion company with design unit and market unit 135 metres away from each other. The company recently connected their LANs using Ethernet cable to share the stock related information. But after joining their LANs, they are not able to share the information due to loss of signal in between. Which device out of the following. should you suggest to be installed for a smooth communication? (i) (ii) (iii) UPS Modem Repeater
Ans: Repeater (1 mark for correct answer) (c) which of the following is not feature of Networking? (i) Resource sharing
277
Ans: Uninterrupted power supply (1 mark for correct answer) (d) Name any two Indian scripts included in Unicode. 1
Ans: Devnagari, Bengali, Gurmukhi, Gujarati, Kannada, Malayalam, Oriya, Tamil, Arabic, Telugu ( mark each for naming any two correct Indian scripts) (e) Mr. Jayanto Das is confused between Shareware and Open source software Mention at least two points of differences to help her understand the same. Open source software Is not proprietary software i.e. it does not belong to any person or organization. Source code is available to the users. It is provided to users without payment 2
Ans: Shareware Is a proprietary software Source code is not available to the users free of cost It is provided to users without payment on a trial basis and is often limited by any combination of functionality, availability or convenience.
(1 mark each for any two correct differences) (f) Identify the type of Topology from the following: (i) (ii) Ans: (i) (ii) If each node is connected with the help of independent cable with the help of a central switching (communication controller) If each node is connected with the help of a single co-axial cable. Star Topology Bus Topology 2
278
(g)
Define the following with reference to Threats to Network Security. (i) (ii) Trojan Horse Worm
Ans: Trojan Horse Appears to perform a desirable function for the user Steals information through a 'backdoor' /Records browsing activities without the knowledge of the user Causes system crash or freeze Worm Self-replicating malware without user intervention Consumes high volume of bandwidth leading to Denial of service (DoS) (1 mark for any 1 point under each definition) Note: Any relevant explanation with regards to Threats to Network Security also to be considered as the correct answer. Q2 (a) While working in Netbeans, Ms Kanta Surbhi wants to display 'Cleared' or 'Re-attempt required' message depending the marks entered in jTextField. Help her to choose more appropriate statement out of 'If statement' and 'Switch statement'.
Ans: IF statement (1 mark for identifying IF as the correct statement) (b) Write a statement to make jTextArea1 as un-editable. 1
Ans: jTextAreal.setEditable (false) ; (1 mark for the correct answer) (c) Which HTML tags are used for making a table and adding rows in a HTML document? 1
Ans: <TABLE> </T ABLE> tags are used for making a table. <TR> </TR> are used for adding rows in a HTML document. ( mark each for naming both tags) Note: Mentioning only <TABLE> and <TR> also acceptable
279
(d)
Ans: <UL> [stands for unordered list] OR [used to display a bulleted list]. <OL> [stands for ordered list] OR [used to display an ordered/numbered list]. (1 mark for anyone correct difference) (e) What will be the value of A and B after execution of the following code: int A = 100, B ; for (B=10; B<=12; B++) { A+=B; } JOptionPane. showMessageDialog (this, A:+A+B:+B+) ; Ans: A:133 B:13 (1 mark each for correct value of A and B) (f) Differentiate between HTML and XML. XML Defines, stores and retrieves the data XML tags are not predefined. New tags can be created as per need 2 2
Ans: HTML Defines how webpage is displayed HTML tags are predefined New tags cannot be defined
HTML tags may not have closing tag XML tags must have a closing tag. HTML tags are not case-sensitive. XML tags are case-sensitive.
(1 mark each for any 2 correct differences) (g) Write Java code that takes the price of a pencil from jTextField1 and quantity of pencils from jTextField2 and calculates total amount as price * quantity to be displayed in jTextField3 and also find 10% tax amount to be displayed in jTextField4.
280
float Amt= Price* Qty; float Tax= Amt*0.l; jTextField3.setText(""+Amt) ; jTextField4.setext(""+Tax) ; ( mark for correctly storing the value of price and quantity) ( mark for correct calculation of total amount) ( mark for correct calculation of tax) ( mark for correct displaying of values in TextField3 and TextField4) Note: double/int Data type may also be accepted for price Q3 (a) Write MySql command will be used to open an already existing database "LIBRARY".
Ans: USE LIBRARY; (1 mark for correct answer) Note: Mentioning only USE command is also acceptable. (b) The Mname Column of a table Members is given below: Mname Aakash Hirav Vinavak Sheetal Rajeev Based on the information, find the output of the following queries: (i) (ii) Ans: (i) Select Mname from members where mname like "%v"; Select Mname from members where mname like "%e%"; Hirav Rajeev 2
281
(ii)
Sheetal Rajeev
( 1/2 mark each for correct line of output) ( 1/2 mark each for correct line of output) 2
A table "TRAINS" in a database has degree 3 and cardinality 8. What is the number of rows and columns in it?
Ans: 8 3 (1 mark for each correct answer) (d) Differentiate between Alternate key and Candidate key. Candidate Key 1
A key that can act as a primary key A key that can be set as Primary key is but is not selected as primary key called a candidate key. (1 mark for any correct difference/definition) OR (1 mark for illustrating with example) (e) Define data encapsulation with reference to Object Oriented Programming. 1
Ans: The wrapping up of data and functions into a single unit (called class) is known as data encapsulation. (1 mark for any correct definition) (f) A worke_ld consisting of 4 digits is stored in a string variable strWrkld. Now Mr. Jai wants to store this Id in integer type of variable IntWrkld Write a Java statement to do this.
Ans: IntWrkId = Integer.parseInt (strWrkId) ; (1 mark for correct answer) (Declaration of IntWrkld as int is optional) (g) Sarthya, a student of class XI, created a table "RESULT". Grade is one of the column 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.
282
SELECT*FROM Result WHERE Grade = "Null"; Help Sarthya to run the query by removing the errors from the query and write the correct Query. Ans: SELECT * FROM Result WHERE Grade IS NULL; ( 2 marks for correct answer) Q4 (a) What will be displayed in jTextField1 after executing the following code. int N = 20; N=N+l; If (N<21) jTextField1.setText(Integer.toString(N+10)); else jTextField1.setText(Integer.toString(N+15)); Ans: 36 ( 2 marks for correct answer) (b) Rewrite the following program code using a Switch statement. if (code ==1) Day = "Monday" ; else if (code == 2) Day = "Tuesday" ; else if ( code ==3) Day = "Wednesday" ; else if ( code == 4) Day = "Thursday" , else Day = "No Match" ; 2 2
283
Ans: switch (code) { case 1 : Day = "Monday" ; break ; case 2 : Day = "Tuesday" ; break ; case 3 : Day = "Wednesday" ; break ; case 4 : Day = "Thursday" ; break ; default : Day = "No Match" ; } ( mark for switch) ( mark for case labels) ( mark for break) ( mark for default) (c) What will be displayed In jTextArea1 after executing the following statement: jTextAreal.setText("Live\nIn Peace\t and harmony") ; Ans. Live In Peace <tab> and harmony (1 mark for correct output) ( mark if '\n' and/or ' \t' not taken into account) (d) The following code has some error(s). Rewrite the correct code underlining all the corrections made: Int P=3; sum = 0; //Declaring P and sum as Integer { Sum = P; P += 3; } 2 1
284
while (P=<12) jTextField1 (Integer.tostring(sum)) ; Ans: int P=32 sum=0; // Declaring P and sum as Integer do { sum = P; P + = 3; } whi1e(P<=12); jTextField1.setText (Integer.toString (sum)); ( mark each for correcting any four errors) OR (1 mark for only identifying any four errors - without making any correction) (e) Given a string object namely 'VALUE', having value as "324" stored in it. What will be result of the following: JOptionPane.showMessageDialog(null,""+(Value.length()+ Integer.parseInt(value))) ; Ans: 327 (1 mark for correct answer) (f) The following code has some error(s). Rewrite the correct code underlining all the corrections made: int Total = 0, Jump = 5; int I; for (i = 0, I =<5, i ++) { Jump+ =5, Total +=Jump; } jTextAreal.showText (" " + Total) ;
285
Ans: int Total = 0, Jump = 5; int I ; for (I=0 ; 1<=5 ; I++) { Jump+ = 5 ; Total + = Jump ; } jTextAreal.setText (" " + Total) ; ( mark each for identifying and correcting 4 errors) OR (1 mark for only identifying 4 errors- without making any correction) (g) Mr. Ram Kishore, the owner of the Kiddi Land Enterprises has asked his programmer Saumya to develop the following GUI in Netbeans. Using 'i' everywhere is acceptable
Mr. Ram accepts payment through three types of credit cards. The offer is given according to the following scheme: Type of Card Platinum Gold Silver Offer 20% of amount 15% of amount 10% of amount
286
If the Bill amount is more than Rs.25,000/- then the customer gets an additional offer of 5% Write the Juva code for the following : (a) (b) To assign Additional offer as 0(jTextField4) and Net amount as 0 (jTextField5). Also set them as un-editable. [when "Calculate Offer"(JButton1) is clicked] To calculate discount as per the given criteria and display the same in jTextField3 To assign Additional offer (jTextField4) as 5% of amount(jTextField2) as per the above condition. To enable "Calculate Net Amount"(jButton2) button (c) [When "Calculate Net Amount" (jButton2) is clicked] To calculate net amount as [TotalCost(jTextField2)]-offer(jTextField3) -Additional offer (jT extField4)] To display the net amount in jTextField5 Ans: g(a) jTextField4.setText("0") ; jTextField5.setText("0"); jTextField4.setEditable(false); jTextField5.setEditable(false); ( mark for assigning 0 to anyone of the text fields) ( mark for setting anyone as un-editable) g(b) double Offer, Aoffer ; int Amount = Integer.parseInt(JTextField2.getText ( )); if (jRadioButton1.isSelected ( ) == true) Offer = 0.2*Amount; If (jRadioButton1.isSelected ()) also accepted 2 1
else if(jRadioButton2.isSelected ( ) == true) Offer = 0.15*Amount ; else if (jRadioButton3.isSelected ( ) == true) Offer = 0.1*Amount ; jTextField3.setText (+0ffer) ;
287
if (Amount>25000) Aoffer=0.5*Amount ; jTextField4.setText (""+Aoffer); jButton2.setEnabled(true); (1 mark for calculating discount correctly) ( mark for additional discount) ( mark for enabling the button) (Any Object names are acceptable for JRadioButton objects) Note: Use of wrapper class like Integer etc. for converting to string is acceptable g(c) int AmoUut = Integer.parseInt(jTextField2.getText( )) ; double Offer = Double.parseDouble(jTextField3.getText( )) ; double Aoffer = Double.parseDouble (jTextField4.getText ( )) ; double Total = Amount-Offer-Aoffer; jTextField5.setText(""+Total) ; ( markior getting the value from textfield) ( 1 mark for calculating the net amount) ( mark for displaying the net amount) Note: Use of wrapper class like Integer etc. for converting to string is acceptable Q5 (a) What is the purpose of DROP TABLE command in MySql ? How is it different from DELETE command?
Ans: The DROP command is used to remove a table Difference: DELETE command removes rows from a table while DROP TABLE removes the table (rows as well as the structure) DELETE is a DML command while DROP TABLE is a DOL command
288
The effect of DELETE command can be rolled back while the effect of DROP TABLE cannot be rolled back (1 mark for purpose of DROP TABLE command) (1 mark for anyone difference between DROP TABLE and DELETE commands) (b) Table Employee has 4 records and Table Dept has 3 records in it. Mr. Jain wants to display all information stored in both of these related tables. He forgot to specify equi-join condition in the query. How many rows will get displayed on execution of this query?
Ans: 12 (1 mark for correct answer) (c) Consider the table RESULT given below Write commands in MySql for (i) to (iv) and output for (v) to (vii) Table Result No Name 1 2 3 4 5 6 (i) Sharon Amal Vedant Shakeer Anandha Upasna Stipend 400 680 500 200 400 550 Subjet English Mathematics Accounts Informatics History Geography Average 38 72 67 55 85 45 Division THIRD FIRST FIRST SECOND FIRST THIRD
To list the names of those students, who have obtained Division as FIRST in the ascending order of NAME.
Ans: SELECT Name FROM Result WHERE Division = 'FIRST' ORDER BY Name; ( mark for SELECT with WHERE clause) ( mark for ORDER BY) Note: LIKE operator is also acceptable
289
(ii)
To display a report listing NAME, SUBJECT and Annual stipend received assuming that the stipend column has monthly stipend.
Ans: SELECT Name, Subject, Stipend * 12 FROM Result; ( mark for selecting columns) ( mark for computing annual stipend) (iii) To count the number of students, who have either Accounts or Informatics as Subject. 1
Ans: SELECT COUNT(*) FROM Result WHERE Subject = 'Accounts' OR Subject = 'Informatics'; OR SELECT COUNT (*) FROM Result WHERE Subject IN ('Accounts', 'Informatics'); ( ' mark for using count( )) ( mark for WHERE Clause) Note: LIKE operator is also acceptable Note: For parts (iv) to (vii) full 4 marks to be awarded if Non existence of table Exam is identified. Or Exam table is considered as a new table consisting of only 1 tuple and answers provided are correct. (iv) To insert a new row in the table EXAM: 6, "Mohan", 500, "English", 73, "Second" Ans: INSERT INTO Result VALUES (6,'Mohan' , 500, 'English' , 73, 'Second'); OR INSERT INTO Result (<column list>) VALUES(6, 'Mohan', 500, 'English', 73, 'Second') ; ( mark for INSERT INTO) ( mark for writing VALUES in correct order)
290
(v)
SELECT AVG (Stipend) FROM EXAM WHERE DIVISION = "THIRD" ; (1 mark for correct answer)
Ans: 6 (1 mark for correct answer) (vii) SELECT MIN(Average) FROM EXAM WHERE Subject = "English"; Ans: 38 (1 mark for correct answer) Q6 a) Write a MySQL command for creating a table "PAYMENT" whose structure is given below: Table: PAYMENT Field Name Loan_number Payment_number Payment_date Payment_amount Datatype Integer Varchar Date Integer 8 Not Null Size 4 3 Constraint Primary key
Ans: CREATE TABLE PAYMENT ( Loan_number INTEGER(4) PRIMARY KEY , Payment_number VARCHAR(3) , Payment_date DATE , Payment_amount INTEGER (8) NOT NULL ); (1/2 mark for CREATE TABLE) (1/2 mark for fields with data types) (1/2 mark for PRIMARY KEY constraint) (1/2 mark for NOT NULL constraint)
291
b)
In a database there are two tables "Product" and "Client" as shown below: Table: PRODUCT P_ID P001 P002 P003 P004 P005 ProductName Moisturiser Sanitizer Bath Soap Shampoo Lens Solution Manufacture XYZ LAC COP TAP COP Price 40 35 25 95 350
Table: Client C_ID 01 05 12 15 ClientName Dreamz Disney Life Line Inc 98.4 Appolo City New Delhi Mumbai New Delhi Banglore P_ID P002 P005 P001 P003
Write the commands in SQL queries for the following: (i) To display the details of Product whose Price is in the range of 40 and 120 (Both values included) 1
Ans SELECT * FROM Product WHERE Price BETWEEN 40 AND 120; OR SELECT * FROM Product WHERE Price >= 40 AND Price <= 120; ( mark for SELECT) ( mark for BETWEEN/WHERE Clause) (ii) To display the ClientName, City from table Client and ProductName and Price from table Product, with their corresponding matching P_ID
Ans: SELECT Clientname, City, Productname, price, P_ID FROM Product, Client WHERE Client.P_ID = Product.P_ID;
292
(1 mark for correct use of SELECT and FROM) (1 mark for correct use of WHERE clause) Note: Use of table aliases is acceptable (iii) To increase the Price of all the Products by 20.
Ans: UPDATE Product SET Price = Price + 20; (1 mark for UPDATE) (1 mark for SET) (c) In a Database School there are two tables Member and Division as show below. Table: Member Empld 1001 1003 1002 Table: Division Divno 10 20 30 (i) Divname Media Dance Production Location TF02 FF02 SF01 1 Name Shankhya Ridhima Sunish Pay 34000 32000 45000 Divno 10 50 20
Ans: Divno (1 mark for correct answer) (ii) What output, you will get, when an equal-join query is executed to get the Name from Member Table and corresponding from Division table? Name Shankhya Sunish Divname Media Dance
293
OR Name Shankhya Sunish OR Name Shankhya Sunish Di vname Media Dance Location TF02 FF02 Location TF02 FF02
(1 mark for providing any of the above outputs) OR (1 Mark for providing any output from the tables mentioned above OR writing that the corresponding join column not available) OR (1 mark if Q6(i) is correct) Q7 a) Ans: What is the impact of e-Learning sites on students learning process? Students can learn at their own pace. A lesson can be revised any number of times at students' convenience. Students can learn lessons at their homes at their convenient time. ( 1 mark for anyone correct point) b) Ans: Write two advantages of e-Business sites. Goods sold through e-business are generally cheaper as cost incurred in e-business is less compared to setting up a traditional business. Customers can receive highly customizable service. Even Remote area customers are reached in e-business. Sellers have better understanding of their customers' needs as customers communicate through e-mails. ( mark each for any two correct points) 1 1
294
c) Ans:
Write three important features of e-Governance? Give URL of one of the commonly used e-Governance portal. Provides citizens access to information about the processes and services Facilitates a speedy, transparent, accountable and efficient process for performing government administrative activities. Uses modern information and telecommunication technologies such as internet, Local area networks to enhance efficiency A lot of productive time of government servants and general public is saved. e-Governance portal : www.incometaxindia.gov.in supremecourtofindia.nic.in passport.gov.in https://www.irctc.co.in ( mark each for any three correct features) ( mark for anyone correct e-Governance portal)
d)
Jaina is creating a form for her practical file. Help her to choose most appropriate controls from List Box, Combo Box, TextField, TextArea, Radio Button, Check box, Label and Command button for the following entries from user. (i) A message "Enter Name" in front of a Text Field.
Ans Label (ii) An input to choose more than one subjects from a set of given choices. .
Ans. TextArea (Most Appropriate answer] TextField [Also acceptable] (iv) An input for accepting the residential area out of Rural and Urban as options.
295
Ans. RadioButton/ComboBox [Most Appropriate answer] TextField [Also acceptable] ( mark each for correct answers) QUESTION PAPER CODE 90 EXPECTED ANSWERS 1. (a) Mr. Kant Sengupta wants to prevent unauthorized access to/from his company's local area network. Write the name of a system (software/ hardware), which he should install to do the same.
Ans Firewall or Intrusion Detection System (1 mark for correct answer) (b) Seven Brothers Fashion Inc. is a fashion company with design unit and market unit 130 meters away from each other. The company recently connected their LANs using ethernet cable to share the stock related information, But after joining their LANs they are not able to share the information due to loss of signal in between. Which device out of the following should you suggest to be installed for a smooth communication? (i) (ii) (iii) Modem Repeater UPS
Ans Repeater (1 mark for correct answer) (c) Which of the following is not a feature of Networking? (i) (ii) (iii) (iv) Resource Sharing Reliability Uninterrupted Power Supply Reduced cost 1
296
(d)
Ans Devnagari, Bengali, Gurmukhi, Gujarati, Kannada, Malayalam, Oriya, Tamil, Arabic, Telugu ( mark each for naming any two correct Indian scripts) (e) Ms. Vidya Chauhan is confused between Proprietary Software and Open Source Software. Mention at least two points of difference to help her understand the same. Open Source software Free and therefore need not be paid for Source code available for change Can be copied and distributed
Ans Proprietary software Has to be paid for Source code not available Cannot be copied / distributed
(1 mark each for any two correct points) (f) Identify the type of Topology from the following (i) (ii) Ans. i) ii) In it, each node is connected with the help of a single co-axial cable. In it. each node is connected with the help of independent cable with the help of a central switching (communication controller). Bus Topology Star Topology . 2
(1 mark for each correct answer) (g) Define the following with reference to Threats of Network Security: (i) (ii) Worm. Trojan Horse . 2
Ans. Worm Self-replicating malware without user intervention Consumes high volume of bandwidth leading to Denial of service (DoS) Trojan Horse Appears to perform a desirable function for the user
297
Steals information through a 'backdoor' /Records browsing activities without the knowledge of the user Causes system crash or freeze (1 mark for any 1 point under each definition) Note: Any relevant explanation with regards to Threats to Network Security also to be considered as the correct answer. 2. (a) While working in Netbeans, Mr. Khorana wants to display 'Pass' or 'Needs to Reappear' message depending on the marks entered in jTextField. Help her to choose the more appropriate statement out of 'If statement' and 'Switch statement'.
Ans. IF statement (1 mark for identifying IF as the correct statement) (b) How one can make a Text Field un-editable on a Frame? 1
Ans <JTextField>.setEditable (false) (1 mark for the correct answer) (c) Which HTML tags are used for making a table and adding rows in HTML document? 1
Ans <TABLE> </TABLE> tags are used for making a table. <TR> </TR> are used for adding rows in a HTML document. ( mark each for naming both tags) Note: Mentioning only <TABLE> and <TR> also acceptable (d) How IS <OL> tag different from <UL> tag of HTML? 1
Ans. <OL> stands for ordered list OR This tag is used to display an ordered/ numbered list. <UL> stands for unordered list OR This tag is used to display a bulleted list. (1 mark for anyone correct difference) (e) What will be the value of P and Q after execution of the following code? int P, Q=100;
298
for (P=10; P<=12; P++) { Q+P; } JOptionPane.showMessageDiaog (this, "P:"+P+" Q:"+Q+""); Ans. P:13 Q:133 (1 mark each for correct value of P and Q) (f) Differentiate between XML and HTML. HTML 2
Ans XML
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. XML tags are case-sensitive. HTML tags may not have closing tag HTML tags are not case-sensitive.
(1 mark each for any 2 correct differences) (g) Write Java code that takes the cost of a pencil from jTextField1 and number of pencils from jTextField2 and calculates total amount as cost*number to be displayed in jTextField3 and 20% service tax out of total amount in jTextField4.
Ans double cost = Double.parseDouble(jTextField1.getText( )); int n = Integer.parselnt (jTextField2.getText( )); double amount = cost * n; jTextField3.setText(amount + ""); jTextFitlld4.setText (amount * 0.20+ ); ( mark for anyone correct conversion statement) ( mark for calculation of total amount) ( mark for calculation of service tax) ( mark for anyone correct setText( ) statement) Note: The data type for cost as float/int is also acceptable
299
3.
(a)
Write MySql command that will be used to open an already existing database "CONTACTS.
Ans USE CONTACTS; (1 mark for correct answer) Note: Mentioning only USE command is also acceptable. (b) The Doc_name Column of a table Hospital is given below: Doc name Avinash Hariharan Vinayak Deepak Sanjeev Based on the information, find the output of the following queries: (i) (ii) Ans (i) (ii) SELECT doc_name FROM Hospital WHERE doc_name like "%v"; SELECT doc_name FROM Hospital WHERE doc_name like '%e%'; Sanjeev Deepak Sanjeev (1 mark for each correct output) (c) A table "Transport" in a database has degree 3 and cardinality 8. What is the number of rows and columns in it? Ans 8 3 (1 mark for each correct answer) (d) Ans Differentiate between Alternate key and Candidate key. Alternate Key A key that can act as a primary key but is not selected as primary key Candidate Key A key that can be set as Primary key is called a candidate key. 1 2 2
OR (1 mark for illustrating with example) (e) Define a class with reference to object Oriented Programming. 1
Ans A class is a logical unit a user defined data type. lt encapsulates and binds the data members and the methods (1 mark for any correct definition) (f) An employee_ld consisting of 5 digits is stored in a string variable strEmpld. Now Mr.Deb wants to store this Id in Integer type of variable InteEmpld. Write Java statement to do this.
Ans int IntEmpId = Integer.parseInt (strEmpId) ; (1 mark for correct answer) (Declaration of IntEmpld as int' is optional) (g) Sarthak, 'a students of class XII, 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"; Help Sarthak to run the query by removing the errors from the query and write the correct query. Ans SELECT * FROM Class WHERE Grade IS NULL; ( 2 marks for correct answer) 4 (a) What will be displayed in of jTextField1 after executing the following code? int m = 16 ; m = m+l ; if (m<15) jTextField.setText (Integer. toString (m) ) ; else jTextField.setText (Integer. toString (m+15) ) ; . 2
301
Ans 32 (2 marks for correct answer) (b) Rewrite the following program code using a Switch statement: if (code ==1) Month = "January"; else if (code ==2) Month = "February"; else if (code==3) Month = "March"; else if (code==4) Month = "April"; else Month = "No Match"; Ans switch (code) { case 1 : Month = "January"; break; case 2 : Month = "February"; break; . case 3 : Month = "March"; break; case 4 : Month = "April"; break; default : Month = "No Match"; } ( mark for switch) ( mark for Case labels) ( mark for break) ( mark for default label)
302
(c)
What will be displayed in jTextArea1 after executing the following statement? jTextAreal.setText ("cbse\nFinal_Exam \ tIp") ; .
(1 mark for correct output) ( mark if '\n' and/or' \t' not taken into account) (d) The following code has some errors(s). Rewrite the correct code underlining all the corrections made: Int k=2 ;Sum = 0; //Declaring k and sum as Integer { sum = k ; k+=2; } While (k=<20) ; jTextFieldl (Integer.tostring(sum)) ; Ans. int k = 2 , sum = 0; // int k = 2; int sum = 0 ; do { sum = k; // could also be written as sum = sum + k ; k+=2; } while (k <= 20) ; 2
jTextFieldl.setText (Integer.toString (sum)) ; ( mark each for correcting any four errors) OR (1 mark for only identifying any four errors - without making any correction)
303
(e)
Given a String object namely 'subject' having value as 123 stored in it. What will be result of the following? JOptionPane.showMessageDialoge (null, " " + (subject.length ( ) + Integer.parselnt (subject)) ) ;
Ans. 126 (1 mark for correct answer) (f) The following code has some error(s). Rewrite the correct code underlining all the corrections made: int Sum=0, Step=5 ; int I ; for (i = 0, i =<5, i++) { Step+=5, Sum+=Step ; } jTextAreal.showText{" "+Sum) ; Ans. int Sum = 0, Step = 5; int i ; for (i=0 ; i <= 5 ; i++) { Step + = 5; Sum + = Step; } jTextAreal.setText ("" + Sum); ( mark each for identifying and correcting 4 errors) OR (1 mark for only identifying 4 errors- without making any correction)
304
(g)
Mr. Radhey Shyam Bansal the owner of the Kiddi Land Enterprises has asked his programmer Ekta to develop the following GUI in Netbeans:
Mr. Bansal accepts payment through three types of credit cards The discount is given according to the following scheme: Type of Card Platinum Gold Silver Discount 20% of amount 15% of amount 10% of amount
If the Bill amount is more than Rs, 25,000, then the customer gets an additional discount of 5%. Write Java code for' the following: (i) (ii) To assign Additional Discount as 0 (jTextField4) and Net Amount as 0 (jTextField5). Also set them as un-editable. [When "Calculate Discount" (jButton1) is clicked] To calculate discount as per the given criteria and display the same in jTextField3 To assign Additional Discount (jTextField4) as 5% of amount (jTextField2) as per the above condition. To enable "Calculate Net Amount" (jButton2) button (iii) [When "Calculate Net Amount" (jButton2) button is clicked] To calculate Net Amount as [TotalCost (jTextField2) - Discount (jTextField3) - Additional Discount (jTextField4)] To display the Net Amount in jTextField5
305
g(i)
jTextField4.setText ("0") ; jTextField5.setText ("0") ; jTextField4.setEditable(false) ; jTextField5. setEditable(false) ; ( mark for assigning 0 to anyone of the textfields) ( mark for setting anyone as un-editable)
g(ii) double discount = 0.0 ; double billAmount = Double.parseDouble(jTextField2.getText()); if (jRadioButton1.isSelected()) discount = 0.20; if (jRadioButton2.isSelected()) discount = 0.15; (jRadioButton3.isSelected()) discount = 0 .10; jTextField3.setText(billAmount * discount + ) ; if (billAmount > 25000)jTextField4.setText (billAmount*0.05+ ); jButton2.setEnabled(true) ; (1 mark for calculating discount correctly) ( mark for additional discount) ( mark for enabling the button) (Any Object names are acceptable for JRadioButton objects) Note: Use of wrapper class like Integer etc. for converting to string is acceptable g(iii) doube netAmount = Double.parseDouble(jTextField2.getText()) Double.parseDouble(jTextField3.getText()) Double.parseDouble(jTextField4.getText()) ; jTextField5.setText(netAmount + " ") ; ( mark for getting the value from textfield) (1 mark for calculating the net amount) ( mark for displaying the net amount) Note: Use of wrapper class like Integer etc. for converting to string is acceptable
306
(a)
What is the purpose of ALTER TABLE command in MySql? How is it different from UPDATE command?
Ans ALTER TABLE command is used to modify the structure of a table. ALTER TABLE It is a DDL command Changes the underlying table structure Cannot be rolled back UPDATE It is a DML command Changes values of tuples in a table Can be rolled back
(1 mark for purpose of ALTER TABLE command) (1 mark for anyone difference between ALTER TABLE and UPDATE commands) (b) Table Employee has 4 records and Table Dept has 3 records in it. Mr. Jain wants display all information stored in both of these related tables. He forgot to specify equi-join condition in the query, How many rows will get displayed on execution of this query?
Ans. 12 (1 mark for correct answer) (c) Consider the EXAM given below. Write commands in MySql for (i) to (iv) and output for (v) to (vii). Table: EXAM No Name 1 2 3 4 5 6 Karan Aman Javed Bishakh Sugandha Suparna Stipend 400 680 500 200 400 550 Subjet English Mathematics Accounts Informatics History Geography Average 68 72 67 55 35 45 Division FIRST FIRST FIRST SECOND THIRD THIRD
307
(i)
To list the names of those students. who have obtained Division as FIRST in the ascending order of NAME.
Ans. SELECT Name FROM Exam WHERE Division = 'FIRST' ORDER BY Name; ( mark for SELECT with WHERE clause) ( mark for ORDER BY) Note: Like operator also acceptable (ii) To display a report listing NAME, SUBJECT and Annual stipend received assuming that the stipend column has monthly stipend. 1
Ans. SELECT NAME, SUBJECT, STIPEND * 12 FROM EXAM; ( mark for selecting columns) ( mark for computing annual stipend) (iii) To count the number of students, who have either Account or Informatics as Subject. 1
Ans. SELECT COUNT(*) FROM EXAM WHERE SUBJECT IN ('Accounts', 'Informatics') ; OR SELECT COUNT(*) FROM EXAM WHERE SUBJECT = 'Accounts' OR SUBJECT = ' Informatics' ; ( mark for using count( )) ( mark for WHERE Clause) Note: Like operator also acceptable (iv) To insert a new row in the table EXAM: 6 Mohan, 500, English, 73, SECOND; Ans. INSERT INTO EXAM VALUES (6, Mohan, 500, English, 73, SECOND);
308
OR INSERT INTO EXAM (NO, NAME, STIPEND, SUBJECT, AVERAGE, DIVISION) VALUES (6, "Mohan", 500, "English", 73, "SECOND"); ( mark for INSERT INTO) ( mark for writing VALUES in correct order) (v) SELECT AVG (Stipend) FROM EXAM WHERE DIVISION="THIRD"; Ans. 475 (1 mark for correct answer) (vi) SELECT COUNT (DISTINCT Subject) FROM EXAM.. 1 1
Ans. 6 (1 mark for correct answer) (vii) SELECT MIN (Average) FROM EXAM WHERE Subject = "English"; Ans. 68 (1 mark for correct answer) 6 (a) Write a MySql command for creating a table "BANK" whose structure is given below: Table: BANK Field Name Acct_number Name BirthDate Balance Ans CREATE TABLE BANK ( Datatype Integer Varchar Date Integer 8 Not Null Size 4 3 Constraint Primary key 2
309
Acct_number INTEGER (4) PRIMARY KEY, Name VARCHAR(3) , BirthDate DATE, Balance INTEGER ( 8 ) NOT NULL ); (1/2 mark for CREATE TABLE) (1/2 mark for fields with appropriate data types) (1/2 mark for PRIMARY KEY constraint) (1/2 mark for NOT NULL constraint) (b) In a database there are two tables "ITEM" and "CUSTOMER" as shown below: Table: ITEM ID 1001 1002 1003 1004 1005 ItemName Moisturiser Sanitizer Bath Soap Shampoo Lens Solutions Company XYZ LAC COP TAP COP Price 40 35 25 95 350
Table: CUSTOMER C_ID 01 05 12 15 CustomerName Samridhh Ltd Big Line Inc 97,8 Tom N Jerrv City New Delhi Mumbai New Delhi Bangalore ID 1002 1005 1001 1003
Write the commands in SQL queries for the following: (i) To display the details of Item, whose Price is in the range of 40 and 95 (Both values included). 1
310
Ans SELECT * FROM ITEM WHERE PRICE BETWEEN; 40 AND 95; OR SELECT * FROM ITEM WHERE PRICE >= 40 AND PRICE <= 95; ( mark for SELECT) ( mark for BETWEEN/WHERE Clause) (ii) To display the CustomerName. City from table Customer, and ItemName and Price from table item, with their corresponding matching 10. 2
Ans. SELECT CUSTOMERNAME, CITY, ITEMNAME, PRICE FROM CUSTOMER CUST, ITEM WHERE CUST.ID = ITEM.ID; (1 mark for correct use of SELECT and FROM) (1 mark for correct use of WHERE clause) Note: Use of table aliases is acceptable (iii) To increase the Price of al the Products by 50. 2
Ans UPDATE ITEM SET PRICE = PRICE + 50 ; (1 mark for UPDATE) (1 mark for SET) (c) In a Database School there are two tables Employee and Dept as shown below: Table: Employee Empld T001 T001 T001 Table: Dept Deptno 10 20 30 DName Lights Dance Production
311
Deptno 10 50 20
(i)
Ans. Deptno (1 mark for correct answer) (ii) What output, will you get, when an equi-Join query is executed to get the NAME from Employee table and corresponding DNAME from Dept table? Lights Dance 1
( mark for each correct line) 7. (a) Give one social impact of e-Business. 1
Ans Brings rapid change in the social fabric characterized by globalization of markets business and government policies (1 mark for anyone correct point) (b) Ans Write two advantages of e-Learning sites. Self paced learning Unlimited revisions Facilitates electronic delivery of customized learning objects Facilitates teacher-student interaction Facilitates peer-peer interaction ( mark each for any two correct points) (c) Ans Write three important features of e-Governance. Give URL of one of the commonly used - eGovernance portals. Provides citizens access to information about the processes and services. Facilitates a speedy, transparent, accountable and efficient process for performing government administrative activities. Uses modern information and telecommunication technologies such as internet, Local area networks to enhance efficiency A lot of productive time of government servants and general public is saved.
312
e.Governance portal: www.incometaxindia.gov.in supremecourtofindia. nic.in passport.gov. in https://www.irctc.co.in ( mark each for any three correct features) ( mark for anyone correct e-Governance portal) (d) Anuja is creating a form for her practical file. Help her to choose most appropriate controls from List Box, Combo Box, TextField, TextArea, Radio Button, Check box, Label and Command button for the following entries from user: (i) A message "Enter Marks" in front of a Text Field.
Ans Label (ii) An input to choose more than one subject from a set of choices.
Ans. TextArea [Most Appropriate answer] TextField [Also acceptable] (iv) An input for accepting Gender.
Ans. RadioButton/ComboBox [Most Appropriate answer] TextField [Also acceptable] ( mark each for correct answer)
313