12 Ip
12 Ip
12 Ip
INFORMATICS PRACTICES
Time - 3 hrs. Class - XII M.M. – 70
Name of the student ______________________________ Section ____ Date-23.09.2017 (Saturday)
Instructions:
There are total 7 questions in this question paper.
All questions are compulsory.
Answers of the same section should be written together.
(1/5)
Q.3 Answer the following questions:
A You need to display the names of those employee who have the letter “A” as the (1)
second character in their names. What will be the query for that?
B Explain Foreign Key constraint. (1)
C Mrs. Kumar is using table STUDENTS with the following columns: (1)
RNO, ADMNO, NAME, AGGREGATE
She wants to display all information of students in descending order of name within
ascending order of aggregate. She wrote the following SQL query and she did not
get the desired output.
SELECT * FROM STUDENTS
ORDER BY NAME, AGGREGATE DESC;
Rewrite the above query to get the desired output.
D Mr. Ram is using a table with following columns Name, Class, StreamID, (1)
StreamName. He needs to display name of students who have not been assigned
any stream or have been assigned StreamName that ends with “Computers”. He
wrote the following command, which did not give the desired result.
SELECT Name, Class FROM STUDENTS
WHERE StreamName=NULL OR StreamName=”%Computers”;
Help Mr. Ram to run the query by removing the errors and write correct query.
E Give characteristics of primary key. (2)
F Observe the given statements carefully: (2)
i. SELECT * FROM CLUB WHERE salary BETWEEN 30000 AND 40000;
ii. SELECT * FROM CLUB WHERE salary IN (30000, 40000);
iii. SELECT * FROM CLUB WHERE salary >= 30000 AND salary <= 40000;
iv. SELECT * FROM CLUB WHERE salary = 30000 OR salary = 40000;
Categorise the equivalent SQL statements given above in two groups (Which give
the same output).
G What is the difference between “%” and “_” wild card characters with reference to (2)
LIKE clause of MySQL?
Q.4 Answer the following questions:
A Give the output of the following java code: (1)
StringBuffer object = new StringBuffer(“Java”);
if((object.length()>3) && (object.append(“ is easy to learn.”).equals(“Java”)));
System.out.println(object);
B Explain different access specifiers offered by java. (2)
(2/5)
C Give java code that counts the occurrence of a particular character in a string. (2)
D Explain Hierarchical inheritance with an example. (2)
E Explain abstract classes. (2)
F Read the following case study and answer the questions that follows:
Ms. Sharma works as a programmer in “ABC Car Rental Company” where she has
designed a software to compute charges to be paid by the client. A screenshot of
the same is shown below:
A client can take any car out of Deluxe/ SemiDeluxe/ Ordinary for rent.
A client can also opt for services of a guide. Charges of services of Guide are extra.
Help Ms. Sharma in writing the code to do the following:
i. When „CLEAR‟ button is clicked, all text fields and checkbox should be (1)
cleared.
ii. When „CLOSE‟ button is clicked, the application should close. (1)
iii. After selecting appropriate Radio Button and checkbox (if required), (4)
when „CALCULATE‟ button is clicked, Amount, Guide Charges and
Total Amount should be calculated and displayed in the respective text
fields.
Category of Car Amount(in Rs.)
Deluxe Car 1000 per day
Semi Deluxe Car 800 per day
Ordinary Car 700 per day
Amount is obtained by multiplying per day charges of Car with number of
days for which the car is taken. If „Guide Required‟ checkbox is selected,
Guide charges per day are Rs.500.00.
Guide Charges is calculated as: Car required for No. of days * 500;
Total Amount = Amount + Guide Charges
(3/5)
Q.5 Give java code for the following.
A To input any alphabet and print the next five alphabets of the English alphabet (2)
series.
B To print the series: (2)
2, -4, 6, -8 …… upto n terms
C Define a class Bowler with the following specifications: (2)
Data Members:
BName, Overs, Runs, EconomyRate.
Member Methods:
getData() : To accept name, overs bowled and runs given.
calEconomyRate(): To calculate EconomyRate i.e. runs overs.
displayData(): To display the values of all the data members.
D Give java code for the following based on dept table having the fields as deptno,
dname and loc.
i. To insert a record in dept table. (2)
ii. To display all the records of dept table. (2)
Q.6 Answer the following:
A Consider the following table “PROJECTS”. Write commands for SQL.
Table: PROJECTS
Id ProjName ProjSize StartDate EndDate Cost
(4/5)
C A table named „LIBRARY‟ has the following contents:
Table : LIBRARY
Scode BookName Pages Price
F112 Computer 250 200
F231 HomeScience 300 250
F117 English 200 130
F080 Mathematics 400 260
Write the output that will be displayed by the statements (i) and (ii).
SET AUTOCOMMIT = 0; (4)
INSERT INTO LIBRARY VALUES („F114‟, „Physics‟, 200, 300);
ROLLBACK;
SAVEPOINT S1;
SELECT * FROM LIBRARY; ………. (i)
INSERT INTO LIBRARY VALUES („F032‟, „Chemistry‟, 320, 250);
SAVEPOINT S2;
INSERT INTO LIBRARY VALUES („F126, „History‟, 280, 300);
ROLLBACK TO S2;
SELECT * FROM LIBRARY; ………..(ii)
Q.7 Answer the following:
A Give java code to clear a checkbox. (1)
B Give java code to display the following output: (2)
0
101
21012
3210123
C Choose appropriate swing control for the following: (2)
i. Select Gender.
ii. Display address.
iii. Select department from a list.
iv. Choose hobby of employee.
(5/5)