
SQL Functions – Math, Text & Date: Class XII Practice Worksheets (With Answers)
Master Class XII SQL math, text, and date functions (POWER, ROUND, SUBSTRING, NOW, etc.) with 3 sets of interactive worksheets and answer keys.
Worksheet Set 1: SQL Math Functions (POWER, ROUND, MOD)
COMPUTER SCIENCE / INFORMATICS PRACTICES
Worksheet Set 1: SQL Math Functions (POWER, ROUND, MOD)
Q1. What will be the output of the query: SELECT POWER(3, 4);?
Q2. What will be the output of the query: SELECT ROUND(156.782, 1);?
Q3. What will be the output of the query: SELECT MOD(17, 5);?
Q4. Write a query to find the cube of 5 using a math function.
Q5. What will be the output of the query: SELECT ROUND(45.923, -1);?
Q6. What will be the output of the query: SELECT MOD(25, 4);?
Q7. Consider a table Product with column Price. Write a query to display prices rounded to 0 decimal places.
Q8. What will be the output of the query: SELECT POWER(2, 0);?
Q9. What will be the output of the query: SELECT ROUND(123.456); (with default decimal places)?
Q10. Explain the difference between integer division / modulo operator and the MOD() function in SQL.
Worksheet Set 2: SQL Text / String Functions (10 Questions)
Focus: UCASE/UPPER, LCASE/LOWER, MID/SUBSTRING/SUBSTR, LENGTH, LEFT, RIGHT, INSTR, LTRIM, RTRIM, TRIM.
COMPUTER SCIENCE / INFORMATICS PRACTICES
Worksheet Set 2: SQL Text / String Functions
Q1. What will be the output of the query: SELECT UPPER('informatics');?
Q2. What will be the output of the query: SELECT LENGTH('Computer Science');?
Q3. What will be the output of the query: SELECT SUBSTRING('Database', 3, 4);?
Q4. What will be the output of the query: SELECT LEFT('SQL Programming', 3);?
Q5. What will be the output of the query: SELECT RIGHT('Database', 4);?
Q6. What will be the output of the query: SELECT INSTR('Information', 'or');?
Q7. What is the difference between LTRIM() and RTRIM() functions?
Q8. What will be the output of the query: SELECT LOWER('CBSE CLASS 12');?
Q9. Write a query to remove all leading and trailing spaces from a column named Username in the Users table.
Q10. What will be the output of the query: SELECT MID('Structured', 2, 3);?
Worksheet Set 3: SQL Date Functions (NOW, DATE, MONTH, MONTHNAME, YEAR, DAY, DAYNAME)
COMPUTER SCIENCE / INFORMATICS PRACTICES
Worksheet Set 3: SQL Date Functions
Q1. What does the NOW() function return in SQL?
Q2. What will be the output of the query: SELECT YEAR('2026-10-15');?
Q3. What will be the output of the query: SELECT MONTH('2026-10-15');?
Q4. What will be the output of the query: SELECT MONTHNAME('2026-05-12');?
Q5. What will be the output of the query: SELECT DAY('2026-11-20');?
Q6. What is the difference between NOW() and DATE() functions?
Q7. Consider a table Orders with column OrderDate. Write a query to extract only the year part from OrderDate.
Q8. What will be the output of the query: SELECT DAYNAME('2026-06-05'); (assuming June 5, 2026 is a Friday)?
Q9. Write a query to extract the date portion from a datetime value stored in a column named LogTimestamp.
Q10. Write a query to find all employees from an Employee table who joined in the month of December (using the MONTH() function).
By Anjeev Kr Singh – Computer Science Educator
Published on : September 19, 2026 | Updated on : September 19, 2026





