You are on page 1of 3

JOSEPH & MARY PUBLIC SCHOOL

Assignment
XII
INFORMATICS PRACTICES
Name: _____________________________________ Sec:__________ Roll No.__________
General Instructions:
 All questions are compulsory.
 Question 1 to 5, carry 1 mark each.
 Question 6 to 8, carry 2 marks each.
 Question 9 to 11, carry 3 marks each.

Q 1. What will be the output of the following


Select length(“INFORMATICS PRACTICES”);
Q 2. Differentiate between now() and sysdate().

Q 3. Write the function name for current date.

Q 4. Differentiate between char() and varchar().

Q 5. Write syntax for foreign key.

Q 6. Explain instr() with example.

Q 7. Consider the Table CLUB given below:

Answer the followings based on the above mysql table ‘CLUB’


i. Write sql query to display the karate coachname whose name starts with K in lowercase.
ii. Write sql query to display the details of male coach in ascending order of their pay.

Q 8. Write the SQL functions which will perform the following operations:
i) To display the name of the month of the current date .
ii) To remove spaces from the beginning and end of a string, “ Panorama “.
iii) To display the name of the day eg, Friday or Sunday from your date of birth, dob.

Q 9. Define the following functions


i. LTRIM() iii. MOD() iv. NOW()

Page 1 of 3
Q 10. TABLE NAME: PHARMADB

Based on the above table “PHARMADB”, Write outputs for SQL commands to i to iii:
i. SELECT LEFT(DrugName ,5) FROM PHARMADB WHERE PRICE>160;
ii. SELECT DRUGNAME FROM PHARMADB WHERE DAY(ManufactureDate)>10;
iii. SELECT ROUND (Price, -1) FROM PURCHASE WHERE Location= ‘Delhi’

Q 11. Consider the following sql table ‘automobile’

Write SQL queries using SQL functions to perform the following operations:
i. Display company name and body wheel base after rounding off to nearest ten’s decimal
places.
ii. Display the position of occurrence of the string “dan” in body style.
iii. Display the year of manufacturing for sedan;

Q12. Write the output of the following:

i) Select NAME, UNDER, WINNER r from GAME where month(DATEOFGAME)>7;


ii) Select lcase(mid(WINNER,2,3)) from GAME where NAME like “%O”;
iii) Select mod(under, month(DATEOFGAME)) from GAME where NAME=”JUDO”;

Q13. Write suitable SQL query for the following:


i) Display 4 characters extracted from 3 rd character onwards from string ‘IMPOSSIBLE’.
ii) Display the position of occurrence of string ‘GO’ in the string “LET’s GO to GOA”.
iii) Round off the value 257.75 to nearest ten rupees.
iv) Display the remainder of 18 divided by 5.
v) Remove all the leading and trailing spaces from a column passwd of the table ‘USER’

Page 2 of 3
Page 3 of 3

You might also like