Monday, June 22, 2020

Basic SQL interview Questions - Part 1

This post contain the very basic question of SQL, today onward i will write multiple post with interview questions. So that it will be help you guys the question i am going to post really crispy and tricky. If you would like to share the any interview question with me, comment on any post . I will definitely
share it on my blog. 

1. Difference Between Group by Clause and Having Clause 
2. Different type of Clause in SQL Query
3. I have below table and some sample data in it, create a query to show the department name and total number employees working in department.

 IDDepartmentName NumberOfEmployees 
 1Dept A 140 
 2Dept A 100 
 3Dept B 300 
 4Dept B 400 
 5Dept C 400 
 6Dept C 700

Once you will be able to find the Department Name and Its total number of employees, then write query to populate the records for condition, "Whose number of employee count more than 700"

4. What is left join how it will work, write query of left join and what will be output, for below sample tables/data. (Below table are refer using TabA.CountryID = TabB.ID 

Tab-A
 IDName CountryID 
 121 
 231 
 331 
 411
 511 
 631 

Tab-B
 IDCountryName 
 11India 
 21United Status
 31Singapore


2- question - Find the total number of employee living in each country, Write down the syntax and query output.





No comments:

Post a Comment

web stats