Page 47 - IP
P. 47
iv.
System.exit(0);
(1 Mark for correct code)
v.
c1.addItem("Reading");
OR
txtNetFee.setEditable(false);
(1 Mark for correct code)
5. (a) Write any one similarity and one difference between primary key and unique Constraint 2
Ans: Similarity: Column with both the constraints will only take unique values.
Difference: Column with Primary key constraints will not be able to hold NULL values
while Column with Unique constraints will be able to hold NULL values.
(2 mark for correct answer)
(b) Ms. Pari, a beginner in SQL is not able to understand the meaning of “Cancelling 2
a Transaction”. Help her in understanding the same. Also mention suitable
command for it.
Ans: Cancelling a transaction means rolls the transaction to the beginning. It aborts
any changes made during the transaction and the state of database is returned to
what it was before the transaction began to execute.
Rollback command is used for the same.
(2 mark for correct answer)
(c) Consider the following tables Library given below: 4
Library
Bid Name Author Price Mem_n Issue_Date Status
ame
B01 Wings of A.P.J 550 Sarita 2018-05-20 Returned
Fire Abdul
Kalam
B02 The Monk Robin 340 Simmi 2018-03-15 Not
who sold Sharma Returned
his Ferrari
B03 You can Shiv Khera 230 Rajat 2018-04-16 Returned
win
B04 Who moved Spencer 450 Ram 2018-03-17 Not
my cheese Jhonson Returned
B05 Real Patrick 250 Sia 2018-06-18 Not
Success Mather- Returned
Pike
10