Writing a 5 SQL query that contains ORDER BY and ALIAS.
Query1. compound condition (AND or OR)
Query 2. LIKE and substitution variable.
Query 3. (IN or BETWEEN) and FETCH option.
Query 4. (LAPD or RPAD) and (SUBSTR or INSTR)
Query 5. Date function.
In this case, the employee has the following table.
EMPLOYEE has the following attributes
1. SELECT * FROM employee as e WHERE e.name='John' OR e.job_title='Engineer' ORDER by e.name
2. SELECT * FROM employee as e WHERE e.email LIKE "%gmai.com" AND e.id=&emloyee_id ORDER by e.name
3. SELECT * FROM employee as e WHERE e.id IN (12, 234, 454) ORDER BY e.name FETCH NEXT 5 ROWS ONLY
4. SELECT LAPD(e.name, 10, "ABC"), SUBSTR(e.name, 0, 3) FROM employee e ORDER BY e.name
5. SELECT e.name, DATE(e.joining_date) FROM employee e ORDER by e.name
That was a nice
question to answer
Friend, If you have any doubts in understanding do let me know in
the comment section. I will be happy to help you further.
Thanks
Get Answers For Free
Most questions answered within 1 hours.