Sql Group
https://t.me/joinchat/fRkYxinYGDY3MDRl
http://bit.ly/vlrsql
REPLACE Replaces all occurrences of a substring within a string, with a new substring
SELECT REPLACE("Vlr Training", "Training", "Technologies");
--------------------
REVERSE Reverses a string and returns the result
SELECT REVERSE("Vlr Training");
------------------------
RIGHT Extracts a number of characters from a string (starting from right)
SELECT RIGHT("Vlr Training", 4) AS ExtractString;
-------------------
RPAD Right-pads a string with another string, to a certain length
SELECT RPAD("Vlr Training", 20, "ABC");
------------------
RTRIM Removes trailing spaces from a string
SELECT RTRIM("Vlr Training ") AS RightTrimmedString;
----------------------
SPACE Returns a string of the specified number of space characters
SELECT SPACE(10);
-------------------------
STRCMP Compares two strings
SELECT STRCMP("VLR Tutorial", "vlr Tutorial");
------------------------
SUBSTR Extracts a substring from a string (starting at any position)
SELECT SUBSTR("Vlr Tutorial", 5, 3) AS ExtractString;
----------------------
SUBSTRING Extracts a substring from a string (starting at any position)
SELECT SUBSTRING("SQL Tutorial", 5, 3) AS ExtractString;
---------------------
SUBSTRING_INDEX Returns a substring of a string before a specified number of delimiter occurs
SELECT SUBSTRING_INDEX("www.vlrtrain.com", ".", 1);
----
TRIM Removes leading and trailing spaces from a string
SELECT TRIM(" vlr Tutorial ") AS TrimmedString;
---------------
UCASE Converts a string to upper-case
SELECT UCASE("SQL Training videos in telugu!");
---------------
UPPER Converts a string to upper-case
SELECT UPPER("SQL Training videos in telugu!");
-----------
MariaDB [vlrinst]> select name,replace(name,"r","T") from emp;
+---------+-----------------------+
| name | replace(name,"r","T") |
+---------+-----------------------+
| venkat | venkat |
| praveen | pTaveen |
| mounika | mounika |
| revathi | Tevathi |
| anji | anji |
| harika | haTika |
| praveen | pTaveen |
| pandu | pandu |
| pandu | pandu |
+---------+-----------------------+
9 rows in set (0.001 sec)
MariaDB [vlrinst]> select name,reverse(name) from emp;
+---------+---------------+
| name | reverse(name) |
+---------+---------------+
| venkat | taknev |
| praveen | neevarp |
| mounika | akinuom |
| revathi | ihtaver |
| anji | ijna |
| harika | akirah |
| praveen | neevarp |
| pandu | udnap |
| pandu | udnap |
+---------+---------------+
9 rows in set (0.001 sec)
MariaDB [vlrinst]> select name,right(5) from emp;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th
MariaDB [vlrinst]> select name,right(name,5) from emp;
+---------+---------------+
| name | right(name,5) |
+---------+---------------+
| venkat | enkat |
| praveen | aveen |
| mounika | unika |
| revathi | vathi |
| anji | anji |
| harika | arika |
| praveen | aveen |
| pandu | pandu |
| pandu | pandu |
+---------+---------------+
9 rows in set (0.004 sec)
MariaDB [vlrinst]> select rpad("vlr training",8,"v");
+----------------------------+
| rpad("vlr training",8,"v") |
+----------------------------+
| vlr trai |
+----------------------------+
1 row in set (0.001 sec)
MariaDB [vlrinst]> select name,sapce(20),age from emp;
ERROR 1305 (42000): FUNCTION vlrinst.sapce does not exist
MariaDB [vlrinst]> select name,space(20),age from emp;
+---------+----------------------+------+
| name | space(20) | age |
+---------+----------------------+------+
| venkat | | 35 |
| praveen | | 28 |
| mounika | | 22 |
| revathi | | 26 |
| anji | | 28 |
| harika | | 26 |
| praveen | | 33 |
| pandu | | 35 |
| pandu | | 23 |
+---------+----------------------+------+
9 rows in set (0.030 sec)
MariaDB [vlrinst]> select name,substring(name,3,5) from emp;
+---------+---------------------+
| name | substring(name,3,5) |
+---------+---------------------+
| venkat | nkat |
| praveen | aveen |
| mounika | unika |
| revathi | vathi |
| anji | ji |
| harika | rika |
| praveen | aveen |
| pandu | ndu |
| pandu | ndu |
+---------+---------------------+
9 rows in set (0.002 sec)
MariaDB [vlrinst]> select name,substring(name,3,2) from emp;
+---------+---------------------+
| name | substring(name,3,2) |
+---------+---------------------+
| venkat | nk |
| praveen | av |
| mounika | un |
| revathi | va |
| anji | ji |
| harika | ri |
| praveen | av |
| pandu | nd |
| pandu | nd |
+---------+---------------------+
9 rows in set (0.001 sec)
MariaDB [vlrinst]> select SUBSTRING_INDEX("ram.cm.in",".",1);
+------------------------------------+
| SUBSTRING_INDEX("ram.cm.in",".",1) |
+------------------------------------+
| ram |
+------------------------------------+
1 row in set (0.000 sec)
MariaDB [vlrinst]> select SUBSTRING_INDEX("ram.cm.in",".",2);
+------------------------------------+
| SUBSTRING_INDEX("ram.cm.in",".",2) |
+------------------------------------+
| ram.cm |
+------------------------------------+
1 row in set (0.000 sec)
MariaDB [vlrinst]> select SUBSTRING_INDEX("ram.cm.in","m",2);
+------------------------------------+
| SUBSTRING_INDEX("ram.cm.in","m",2) |
+------------------------------------+
| ram.c |
+------------------------------------+
1 row in set (0.000 sec)
MariaDB [vlrinst]> select ucase(name), name from emp;
+-------------+---------+
| ucase(name) | name |
+-------------+---------+
| VENKAT | venkat |
| PRAVEEN | praveen |
| MOUNIKA | mounika |
| REVATHI | revathi |
| ANJI | anji |
| HARIKA | harika |
| PRAVEEN | praveen |
| PANDU | pandu |
| PANDU | pandu |
+-------------+---------+
9 rows in set (0.001 sec)
MariaDB [vlrinst]> select upper(name), name from emp;
+-------------+---------+
| upper(name) | name |
+-------------+---------+
| VENKAT | venkat |
| PRAVEEN | praveen |
| MOUNIKA | mounika |
| REVATHI | revathi |
| ANJI | anji |
| HARIKA | harika |
| PRAVEEN | praveen |
| PANDU | pandu |
| PANDU | pandu |
+-------------+---------+
9 rows in set (0.000 sec)
MariaDB [vlrinst]> select strcmp("Vlr","Vlr");
+---------------------+
| strcmp("Vlr","Vlr") |
+---------------------+
| 0 |
+---------------------+
1 row in set (0.027 sec)
MariaDB [vlrinst]> select strcmp("Vlr","vlr");
+---------------------+
| strcmp("Vlr","vlr") |
+---------------------+
| 0 |
+---------------------+
1 row in set (0.000 sec)
MariaDB [vlrinst]> select strcmp("Vlr","vlr1");
+----------------------+
| strcmp("Vlr","vlr1") |
+----------------------+
| -1 |
+----------------------+
1 row in set (0.001 sec)
MariaDB [vlrinst]>
*ReactJS Online Live Demo By Praveen Gubbala*
*Date:* 7PM(IST) 5th April 2021 (Monday)
*Join Link*
Interested to Join Plz share *Your Gmail to*
wa.me/919059868766
(Real Time Projects, PalceMent assistnce for Freshers and 2 to 4 years exp Students)
No comments:
Post a Comment
Note: only a member of this blog may post a comment.