avanigole-blog
avanigole-blog
Untitled
1 post
Don't wanna be here? Send us removal request.
avanigole-blog · 5 years ago
Text
Top 15 SQL Queries Interview Questions for Experienced
Q-1. Write an SQL query to bring"FIRST_NAME" out of the Worker table with the alias name as.
Ans.
The Necessary query is:
Select FIRST_NAME AS WORKER_NAME out of Worker;
Q-2. Write an SQL query to bring"FIRST_NAME" out of the Worker table in upper case.
The Necessary query is:
Select top (FIRST_NAME) from Worker;
Q-3. Write an SQL query to bring exceptional values of DEPARTMENT out of Worker table.
The Necessary query is:
Select different DEPARTMENT out of Worker;
Q-4. Write an SQL query to publish the first 3 characters of FIRST_NAME out of the Worker table.
The Necessary question is:
Select substring(FIRST_NAME,1,3) from Worker;
Q-5.Write an SQL query to discover the place of the bible ('a') from the first title column'Amitabh' in the Worker table.
The Necessary query is:
Select INSTR(FIRST_NAME, BINARY'a') from Colleges at which FIRST_NAME ='Amitabh';
Notes.
The INSTR technique is case-sensitive by default.
Utilizing Binary operator will create INSTR function as a case-sensitive function.
Q-6.Write an SQL query to publish the FIRST_NAME out of the Worker table after removing white spaces in the perfect side.
Ans.
The Necessary query is:
Select RTRIM(FIRST_NAME) from Worker;
Q-7.Write an SQL query to publish the DEPARTMENT from the Worker table after removing white spaces on the left side.
The Necessary query is:
Select LTRIM(DEPARTMENT) from Worker;
Q-8.Write an SQL query that brings the exceptional worth of DEPARTMENT out of Worker dining table and prints its length.
The Necessary query is:
Select different length(DEPARTMENT) from Worker;
Q-9. Write an SQL query to publish the FIRST_NAME out of the Worker table after replacing'a' using.'
The Necessary query is:
Select REPLACE(FIRST_NAME,'a','A') from Worker;
Q-10.Write an SQL query to publish the FIRST_NAME and then LAST_NAME out of the Worker table into one column COMPLETE_NAME. A distance char should separate them.
The Necessary query is:
Select CONCAT(FIRST_NAME,''', LAST_NAME) AS'COMPLETE_NAME' from Worker;
Q-11. Write an SQL query to publish all Employee particulars in the Worker table arrangement by FIRST_NAME Ascending.
The Necessary query is:
Select * from Worker sequence by FIRST_NAME as;
Q-12. Write an SQL query to publish all Employee particulars in the Worker table arrangement by FIRST_NAME Ascending and DEPARTMENT Descending.
The Necessary query is:
Select * from Worker sequence by FIRST_NAME asc, DEPARTMENT desc;
Q-13. Write an SQL query to publish details for Employees with the initial name as"Vipul" and"Satish" out of the Worker table.
The Necessary query is:
Select * from Colleges at which FIRST_NAME in ('Vipul',''Satish');
Q-14. Write an SQL query to publish details of employees constituting first titles, "Vipul" and"Satish," out of the Worker table.
The Necessary query is:
Select * from Colleges in which FIRST_NAME not in ('Vipul','Satish');
Q-15. Write an SQL query to publish details of Employees with DEPARTMENT title as"Admin."
The Necessary question is:
Select * from Colleges at which DEPARTMENT enjoy'Admin percent';
Know more
1 note · View note