SQL Query | Level – Basic 3
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 3 )
select * from employee where lower(ename) like ‘a%’ and len(ename)=5;
Since we know that FirstName will start from A so using like ‘%a’ is wrong/redundant. Also the total length of the FirstName is 5 letters , so rest of the 4 letters are _ (4 underscore). The underscore character ( _ ) represents a single character to match a pattern. More than one ( _ ) underscore characters can be used to match a pattern of multiple characters.
select * from EmployeeDetail WHERE FirstName LIKE ‘A____’
select * from employee
where UPPER(first_name) like ‘A%’ and len(first_name)=5;