Ecolab SQL Interview Question - SUBSTRING() and CHARINDEX() Functions

  Рет қаралды 4,329

Cloud Challengers

Cloud Challengers

Күн бұрын

Пікірлер: 27
@yashmathur5609
@yashmathur5609 8 ай бұрын
Hi cloud challengers, I am writing this comment to appreciate your efforts, I've recently started seeing your videos for sql and in every video I'm learning some new functions or logic. Thanks for coming up with such a great explanation and interview questions.🙌🙌
@CloudChallengers
@CloudChallengers 8 ай бұрын
@yashmathur5609, Thank you for the feedback, it means a lot to me. 🙂
@ishanshubham8355
@ishanshubham8355 8 ай бұрын
select right(email,length(email)-locate("@",email)) as domain from customer_tbl;
@sravankumar1767
@sravankumar1767 8 ай бұрын
Superb explanation 👌 👏 👍
@sudhindrab1606
@sudhindrab1606 8 ай бұрын
with cte as (select value from customer_tbl cross apply string_split(email,'@') ) select * from cte where value like '%.%'
@snehsparsh7954
@snehsparsh7954 6 күн бұрын
Email Validation(Counter Question at end): SELECT email, CASE WHEN REGEXP_CONTAINS(email, r'^[^@]+@[^@]+\.[^@]+$') -- Checkpoints 1, 5, and partially 6 (basic structure) AND NOT REGEXP_CONTAINS(email, r'@{2}') -- Checkpoint 2 AND NOT REGEXP_CONTAINS(email, r'\.{2}') -- Checkpoint 3 AND NOT REGEXP_CONTAINS(email, r'[@\.][\.@]|^\.|\.$') -- Checkpoint 4 and partially 6 (no adjacent or leading/trailing . or @) AND NOT REGEXP_CONTAINS(email, r'[^\w\.\+\-\@]') -- Checkpoint 6 (invalid characters) THEN 'Valid' ELSE 'Invalid' END AS email_validity FROM practiceDB1.customer_tbl;
@gkapadi9831
@gkapadi9831 5 ай бұрын
In oracle sql - Select substr(email,instr(email,'@')+1) as domain from customer_tbl;
@MaheshNaidu-j3x
@MaheshNaidu-j3x 6 ай бұрын
In snowflake--- SELECT SPLIT_PART(email, '@', 2) AS domain FROM customer_tbl;
@suprisahana
@suprisahana 5 ай бұрын
Kindly add your query
@hairavyadav6579
@hairavyadav6579 5 ай бұрын
select substring_index(email,"@",-1) as domain from customer_tbl; select substr(email,locate("@",email)+1) as domain from customer_tbl; select right(email,(length(email) - locate("@",email))) as domain from customer_tbl; My approach
@anushas1910
@anushas1910 8 ай бұрын
select substring_index(email,'@',-1) as domain from customer_tbl ;
@motiali6855
@motiali6855 3 ай бұрын
My sql Solution select *,substring_index(email,"@",-1) from customer_tbl;
@sravankumar1767
@sravankumar1767 8 ай бұрын
Select email, case when email like '%@%' and email like '%.%' and email not like '%@%@%' and email not like '%.%.%' and email not like '%@.%' and email not like '%.@%' and email not like '%(^a-zA-Z0-9@._-)%' Then 'Valid' else 'Invalid' end as email status from table_name
@djsahu98
@djsahu98 8 ай бұрын
What if 3 @ or 3 . are there
@sravankumar1767
@sravankumar1767 8 ай бұрын
​@@djsahu98 u can add it email like '%_@_%' it represents atleast one character before and after @
@naraharivishwanath
@naraharivishwanath 8 ай бұрын
​@@djsahu98 if there are 3@ then this would be an invalid and in the above logic it's satisfied in the case conditions like %@%@% so it will return an invalid as per my knowledge.
@mrigankashekhardas9246
@mrigankashekhardas9246 8 ай бұрын
SELECT email, CASE WHEN email LIKE '%_@_%_.__%' THEN 'Valid' ELSE 'Invalid' END AS e_status FROM users;
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
WIPRO SQL Interview Question - FIRST_VALUE( ) Function
11:18
Cloud Challengers
Рет қаралды 18 М.
Capgemini SQL Interview Question 2024 | Transform Rows Into Columns
5:32
Data Science Corner
Рет қаралды 4,4 М.
Most Asked SQL Interview Question - Solved Using 3 Methods
14:51
Rishabh Mishra
Рет қаралды 92 М.
62 How to use Substring replace charindex functions in SQL Server
18:49
Practice SQL Interview Query | Big 4 Interview Question
14:47
PWC Data Analyst Interview | SQL Intermediate Question 11
9:46
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН