XII-D INFORMATICS PRACTICES (JULY 2014 MONTHLY TEST)
KENDRIYA VIDYALAYA NO. 1 ,
NAUSENABAUGH , VSKP-05
XII D INFORMATICS PRACTICES
(JULY 2014 MONTHLY TEST)
Time Allowed : 90 Minutes Max Marks :
40
Note : All questions are
compulsory.
Q1.Based on the following table named
"Charity" and write SQL queries for the tasks
that follow:
13*1= 13M
Table: Charity Columns : P_ID , LastName , FirstName , Adress ,City, Contribution
(Contribution is in Rs.)
I. Display all first names in lowercase
II. Display all last names of people of
Mumbai city in uppercase
III. Display Person Id along with First 3
characters of his/her name.
IV. Display first name concatenated with last
name for all the employees.
V. Display length of address along with
Person Id
VI. Display last 2 characters of City and
Person ID.
VII. Display Last Names and First names of
people who have "at" in the second or
third position in their first names.
VIII. Display the position of 'a' in Last
name in every row.
IX. Display Last Name and First name of
people who have "a" as the last character
in their First names.
X. Display the first name and last name
concatenated after removing the leading
and trailing blanks.
XI. Display Person Id, last names and
contribution rounded to the nearest rupee
of all the persons.
XII. Display Person Id, last name and
contribution with decimal digits truncated
of all the persons.
XIII. Display Last name, contribution and a
third column which has contribution
divided by 10. Round it to two decimal
points.
Q2.Difference between NOW() and SYSDATE() with proper example. 3M
Q3. Which Date function displays the result
like "Monday" or "Tuesday" etc.
Q4. Name a
3M
i) date function that returns a number.
ii) String function that returns a number.
iii) date function that returns a date.
Q5. Write SQL statements to do the following: 7M
a) Using the three separate words
"We," "study," and "MySQL," produce the
following output:
"We study MySQL"
b) Use the string "Internet is a
boon" and extract the string "net".
c) Display the length of the string
"Informatics Practices".
d) Display the position of "My" in
"Enjoying MySQL".
e) Display the name of current month.
f) Display the date 10 years from now. Label
the column "Future."
g) Display the day of week on which your
birthday will fall or fell in 2010.
Q6. Write the output that the following
statements will produce: 5M
a) SELECT ROUND(7.3456, 2);
b) SELECT TRUNCATE(2.3456, 2);
c) SELECT DAYOFMONTH('2009-08-25');
d) SELECT MONTH('2010-02-26');
e) SELECT RIGHT('Informatics', 4);
Q7-How many times will each of the following
loops execute? Which one of these is an entry control loop and which one is an
exit control loop? What is value of i
after each loop ? 3M
Loop1:
int sum = 0, i = 5;
while (i<5)
{sum += i;i++;}
Loop2:
int sum = 0, i = 5;
do
{ sum += i;i++;} while (i<5);
. Q8. Rewrite the following program code
using switch statement: 2M
if (d == 1)
day = "Monday";
else if (d == 2)
day = "Tuesday";
else if (d == 3)
day = "Wednesday";
else
day = "-";
Q9. What will be the output of the following
code 2M
int i = 3 , n =0 ;
while ( i < 4) { n++ ; i -- ; }
System.out.println( n );
P10.Transform
the following while loop code into for loop : 2M
inti ; sum=0;
i=1;
while(i=<10)
{
sum=sum+i;
i=i+3
}
System.println(sum);
****************************
THE END *******************************