This document contains questions about SQL functions. It asks the student to predict outputs, explain functions like NOW(), use functions like ROUND(), LENGTH(), LOWER(), SUBSTR(), LEFT(), CONCAT() on strings and values, and retrieve parts of dates, strings, and numbers. It provides examples of tables and values to apply the functions to.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100%(1)100% found this document useful (1 vote)
1K views2 pages
Class XII Informatics Practices Test 1 1
This document contains questions about SQL functions. It asks the student to predict outputs, explain functions like NOW(), use functions like ROUND(), LENGTH(), LOWER(), SUBSTR(), LEFT(), CONCAT() on strings and values, and retrieve parts of dates, strings, and numbers. It provides examples of tables and values to apply the functions to.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Class XII
INFORMATICS PRACTICES TEST 1
1. Predict the output of the following queries(2)
i. Select power(5,3); ii. Select mod(5,3);
2. Help Reshma in predicting the output of the following queries: (2) i) select round(8.72,3); ii) select round(9.8); 3. Predict the output of the following queries(3) i. select instr('[email protected]','.'); ii. select substr('[email protected]',7,4); iii. select left('[email protected]',5); 4. Reena is working with functions of MySQL. Explain her following(2) i. What is the purpose of now () function? ii. How many parameters does it accept? 5.While dealing with string data type in MySQL, its observed that sometimes unnecessary space character comes in between which hampers the successful execution of a string manipulation module. Name the suitable MySQL function (s) to remove leading, trailing and both type of space characters from a string. Also give MySQL queries to depict the same.(2) 6. Write SQL commands for the following (2) a. command that will display the month from current time and date b. To display the name of the day eg, Friday or Sunday from your date of birth, dob. C. To display the starting position of your first name(fname) from your whole name (name). D. To compute the remainder of division between two numbers, n1 and n27. 7. Considering the same string “Preoccupied” (2) Write SQL commands to display : a. the position of the substring ‘cup’ in the string “Preoccupied” b. the first 4 letters of the string 8. Consider a table SALESMAN with the following data: (5) SNO SNAME SALARY BONUS DATE OF JOIN A01 Beena Mehta 30000 45.23 29-10-2019 A02 K. L. Sahay 50000 25.34 13-03-2018 B03 Nisha Thakkar 30000 35.00 18-03-2017 B04 Leela Yadav 80000 NULL 31-12-2018 C05 Gautam Gola 20000 NULL 23-01-1989 C06 Write SQL queries using SQL functions to perform the following operations: a) Display salesman name and bonus after rounding off to zero decimal places. b) Display the position of occurrence of the string “ta” in salesman names. c) Display the four characters from salesman name starting from second character. d) Display the month name for the date of join of salesman e) Display the name of the weekday for the date of join of salesman 9. Consider the decimal number x with value 8459.2654. (2) Write commands in SQL . i) To round it off to a whole number. ii) To round it to 2 places before the decimal. 10. Write the output of the following SQL queries: i) Select concat( left (' india is great ',6), substr(' india is great ',10,5) ii) select power(instr('abcd412','1'),3); iii) select length( substr(lower('abc 123'),1,3));