Worksheet 14 - Only Ans - Single Row Function
Worksheet 14 - Only Ans - Single Row Function
Now() Sysdate()
Now displays the date and time at Sysdate() displays the date and time at the
the beginning of the command. exact time of the execution of the
command.
It always displays the same date and It displays the exact date and time at
time in a single sql command. No which it is executed within the single
matter how many times it is being command.
executed.
Example:
4. Name a function of MySql which is used to remove trailing and leading spaces from a string.
trim
5. Consider the following table named 'SBOP" with details of account holders. Write output
Ans. i)
ROUND(Balance,-3)
63000
Ans.
Name Length()
Amit Kumar 10
Deepika Sharma 14
Vinay Srivastav 15
Kumar Mehta 11
Rashmi Kumar 12
14. Identify Single Row functions of MySQL amongst the following :
TRIM(), MAX(), COUNT(*), ROUND()
Trim() and Round() are single row functions
Ans.
MID(Mname,1,2)
Am
Ra
Ge
Fa
Sa
La
Su
Mi
Da
Aj
16. Observe the given table named “Loan” carefully
and predict the output of the
following queries:
i. SELECT concat(left(file_no,2),
right(cust_name,2)) AS “ID” from loan where
Bank='ICUCI Ltd.';
ii. select round(loan_amt-loan_amt*10/100) As
"Discounted Payment" from loan where
loan_amt>700000;
i) ID
23mi
43et
ii) Discounted Payment
728888
671164