10. String functions in SQL query with Examples

preview_player
Показать описание
String functions in SQL with Examples. Concat, Substring, Replace, ASCII, UPPER, lower, Reverse, TRIM string function SQL query with examples and their practical application on the job. These are key functions asked in the interviews for Analytics, reporting or Technical roles.
There are more String functions like CHAR(), CONCAT_WS(), FORMAT(). INSTR(), LENGTH()... however the covered functions in the videos are quite relevant from interview questions standpoint.
Рекомендации по теме
Комментарии
Автор

-- CONCAT Function --
Select *, concat(empfirstname, ' ', emplastname, ' earns $', salary, 'per annum.') as comment from employee;
-- REPLACE Function --
update employee
set empfirstname = replace(empfirstname, 'Robert', 'Rob');
-- SUBSTRING --
select *,
concat(substring(empfirstname, 1, 4), '_', empid)
as new from employee
-- ASCII Function --
select * from employee where ascii(empfirstname) >=97
-- REVERSE Function -- Checking "palindrome" strings
select * from employee where reverse(lower(empfirstname)) = lower(empfirstname)
-- UPPER / lower Case Function --
select upper(empfirstname) from employee

mostfrequentlyaskedintervi
welcome to shbcf.ru