Home » Technical Interview Questions » SQL Interview Questions » SQL Query Interview Questions

SQL Query Interview Questions


Reading Time - 2 mins

11. Get length of FIRST_NAME from employee table?

SELECT LENGTH (FIRST_NAME) FROM EMPLOYEE;

12. Get First_Name from employee table after replacing ‘o’ with ‘$’?

SELECT FIRST_NAME, REPLACE (FIRST_NAME,'o','$') FROM EMPLOYEE;

13. Get First_Name and Last_Name as single column from employee table separated by a ‘_’?

SELECT FIRST_NAME|| '_' ||LAST_NAME FROM EMPLOYEE;

14. Get FIRST_NAME, Joining year, Joining Month and Joining Date from employee table?

SELECT FIRST_NAME, 
	TO_CHAR(JOINING_DATE,'YYYY') JOINYEAR ,
	 TO_CHAR(JOINING_DATE,'MON'),
	  TO_CHAR(JOINING_DATE,'DD')          FROM         EMPLOYEE;

SQL Order By

15. Get all employee details from the employee table?

SELECT * FROM EMPLOYEE;

16. Get First_Name, Last_Name from employee table?

SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEE ;

17. Get First_Name from employee table using alias name “Employee Name” ?

SELECT FIRST_NAME “EMPLOYEE NAME” FROM EMPLOYEE;

18. Get First_Name from employee table in upper case?

SELECT UPPER (FIRST_NAME) FROM EMPLOYEE;

19. Get FIRST_NAME from employee table in lower case?

SELECT LOWER (FIRST_NAME) FROM EMPLOYEE;

20. Get unique DEPARTMENT from employee table?

SELECT DISTINCT DEPARTMENT FROM EMPLOYEE;

READ  Keys in SQL
Array Interview Questions
Graph Interview Questions
LinkedList Interview Questions
String Interview Questions
Tree Interview Questions