CBSE Class 12 Informatics Practices
Question 78 of 81
MySQL Functions — Question 8
Back to all questions 8
Question Write the SQL queries which will perform the following operations :
(i) To display the year from your Date of Admission which is '2023-05-15'.
(ii) To convert your email id ABC@XYZ.com to lowercase.
(iii) To remove leading spaces from a string 'my country'.
(iv) To display current date.
(v) To display the value of 106.
(i)
SELECT YEAR('2023-05-15');+--------------------+
| YEAR('2023-05-15') |
+--------------------+
| 2023 |
+--------------------+
(ii)
SELECT LCASE('ABC@XYZ.com');+----------------------+
| LCASE('ABC@XYZ.com') |
+----------------------+
| abc@xyz.com |
+----------------------+
(iii)
SELECT LTRIM(' my country');+---------------------+
| LTRIM('my country') |
+---------------------+
| my country |
+---------------------+
(iv)
SELECT CURDATE();+------------+
| CURDATE() |
+------------+
| 2024-05-21 |
+------------+
(v)
SELECT POWER(10, 6);+--------------+
| POWER(10, 6) |
+--------------+
| 1000000 |
+--------------+