Password Generation in SQL

Question:

Password Generation

Write a to display user name and password. Password should be generate by concatenate first three characters of user name and first three numbers in phone number and give an alias name as password. Sort the result based on user name

Quiz for Exam - Password Generation

Code:

Main.sql

select name, concat(substr(NAME,1,3), substr(PHNO,1,3)) as password 
from users 
order by NAME;

Recommended:

Leave a Comment

Your email address will not be published. Required fields are marked *