100+ SQL Query Interview Questions With Answers-II

Before this, we have seen 100+ SQL Interview Questions with Examples -I

41. Get employee details from employee table whose employee name is “John”

 

42. Get employee details from employee table whose employee name are “John” and “Roy”

 

43. Get employee details from employee table whose employee name are not “John” and “Roy”

 

44. Get employee details from employee table whose first name starts with ‘J’

 

45. Get employee details from employee table whose first name contains ‘o’

 

46. Get employee details from employee table whose first name ends with ‘m’ and name contains 4 letters

 

47. Get employee details from employee table whose first name starts with ‘K’ and name contains 4 letters

 

48. Get employee details from employee table whose Salary greater than 600000 and Less then 8000

 

49. Get employee details from employee table whose joining year is “2016”

 

50. Get employee details from employee table whose joining month is “January”

 

51. Get employee details from employee table who joined after January 31st

 

52. Get difference between JOINING_DATE and INCENTIVE_DATE from employee and incentives table

 

53. Get database date

 

54. Get Last Name from employee table after replacing special character with white space

 

55. Get department,total salary with respect to a department from employee table

 

56. Get department,total salary with respect to a department from employee table order by total salary descending

 

57. Get department,no of employees in a department,total salary with respect to a department from employee table order by total salary descending

 

58. Get department wise average salary from employee table order by salary ascending

 

59. Get department wise maximum salary from employee table order by salary ascending

 

60. How to fetch data that are common in two query results ?

 

61. Get Employee ID’s of those employees who didn’t receive incentives without using sub query ?

 

62. Select 20 % of salary from John , 10% of Salary for Roy and for other 15 % of salary from employee table

 

63. Delete employee data from employee table who got incentives in incentive table

 

64. Select Last Name from employee table which contain only numbers

 

65. Select first_name, incentive amount from employee and incentives table for those employees who have incentives

 

65. Select first_name, incentive amount from employee and incentives table for all employes even if they didn’t get incentives

 

66. Select TOP 2 salary from employee table

 

67. Select TOP N salary from employee table

 

68. Select Nth Highest salary from employee table

 

69. Write create table syntax for employee table

 

70. Write syntax to set EMPLOYEE_ID as primary key in employee table

 

71. Write syntax to set 2 fields(EMPLOYEE_ID,FIRST_NAME) as primary key in employee table

 

72. Write syntax to drop primary key on employee table

 

73. Write SQL to create Orcale Sequence

 

74. Write Sql syntax to create Oracle Trigger before insert of each row in employee table

 

75. Example of Oracle materialized view – Daily Auto Refresh

 

 

0 Comment

Leave a Reply