https://www.youtube.com/watch?v=Vhxo7tSlf9w

create table strings (name varchar(50));
delete from strings;
insert into strings values ('Ankit Bansal'),('Ram Kumar Verma'),('Akshay Kumar Ak k'),('Rahul');

SELECT 
	*
FROM strings

Pasted image 20241230205336.png

LENGTH()
REPLACE()

SELECT 
	name,
    replace(name," ","") AS Replaced_name,
    length(name) - length(replace(name," ","")) as cnt_of_Spaces
FROM strings

Pasted image 20241230205359.png