CBSE Guess > Papers > Important Questions > Class XII > 2012 > Computer Science > Computer Science Vinay Kumar Srivastava Computer Science- CBSE CLASS XII c) Avani has created a table named “Doctor”, she wants to increase the OPDCharge by 25% of “Nephro” and “Cardio” department. She wrote a query- For - 1 Marks UPDATE Nephro,Cardio SET OPDCharge=25% WHERE department IN (‘Nephro’,’Cardio’); Ans: UPDATE Doctor SET OPDCharge= OPDCharge + OPDCharge *0.25 WHERE department IN (‘Nephro’,’Cardio’); d) Abhi wants to undo the changes made during the transaction execution. What command should Abhi use for this purpose? For - 1 Marks Ans: ROLLBACK; (ROLLBACK works only when START TRANSACTION /BEGIN command is issued) e) Identify the candidate key(s) in the following table. For - 2 Marks
Ans: EmpNo, MobileNo, PANCardNo, BankAccountNo f) GarCode, GarName, Price and FabrCode of table “GARMENT” are given below- For - 2 Marks
Based on this information, find output of the following queries.
Ans: 1) 3 g) What is the role of UNIQUE constraint? How is PRIMARY KEY constraint different from UNIQUE constraint? For - 2 Marks Ans: UNIQUE constraint works same as Primary Key constraint but, Q .4. a) What is method overriding? For - 1 Marks Ans: A method in a sub class hides or overshadows a method inherited from the super class if both methods have the same signature. This property is known as overriding the inherited method. b) What is the difference between setEnabled and setVisible methods of a control? For - 1 Marks Ans: setEnabled method makes the control accessible or inaccessible but control displays on screen whereas setVisible method makes the control visible or invisible on the screen c) Write the purpose of the following statements. For - 1 Marks Ans: i) It will round off the number and display in text field1 – Value -11 d) Rewrite the following code using if ..else. For - 2 Marks
e) The following code has some error(s). Rewrite the correct code underlining all the corrections made. For - 2 Marks Ans: int i,c,a=5,b=0; f) What will be the content of jTextField1 and jTextField2 after executing the following code? For - 2 Marks Ans: jTextField1 will contain 1219 and jTextField2 will contain New Year 2012 Prepared By: Mr. Pradumna Singh |