Informatica Scenario: Number of Vowels and Consonants in Name Field
SQL Metadata for Practice
CREATE TABLE VC1 (SRN NUMBER(10),NAME VARCHAR2(100));
INSERT INTO VC1 VALUES(1,'AKHIL');
INSERT INTO VC1 VALUES(2,'VENU');
INSERT INTO VC1 VALUES(3,'JK');
INSERT INTO VC1 VALUES(4,'MADHU');
INSERT INTO VC1 VALUES(5,'NAVEEN');
INSERT INTO VC1 VALUES(6,'TEJA');
COMMIT;
SELECT * FROM VC1;
-------------------------------
SELECT SRN, NAME,
REGEXP_COUNT(NAME,'[aeiouAEIOU]')AS No_Of_Vowels,
REGEXP_COUNT(NAME,'[^aeiouAEIOU]')AS No_Of_Consonants
FROM VC1;
0 Comments