Interview Questions and Answers - Order By Newest Q41. Write SQL to get all members and the count of books they have checked out , even the ones that haven't checked out anything. SQL
This question was recently asked at 'Canopy Tax'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  sql Asked in 1 Companies Q42. Given an Employee Table with Salary Column, Find 2nd and 5th highest salary in a particular department. SQL
Ans. Select salary from (select salary from employee where department = order by salary desc limit 5) emp order by salary limit 1 AND Select salary from (select salary from employee where department = order by salary desc limit 2) emp2 order by salary limit 1 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql  database   find 2nd highest salary sql database Asked in 1 Companies Q43. What is the use of sql dialect ? Hibernate
Ans. Dialect means "the variant of a language".
Similarly in case of SQL Dialect we specify what dialect of SQL to be generated keeping in mind of underlying database. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql dialect  hibernate   hibernate Asked in 2 Companies Ans. Fast reads
Much more reads than writes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws dynamodb  aws nosql database  amazon cloud nosql database Q45. create an SQL query across multiple tables involving outer joins Database
Ans. Select * from table1 t1Left outer join table2 t2 on t1.tid = t2.id Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql query  database  outer joins Asked in 2 Companies Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws dynamodb  aws nosql database  amazon cloud nosql database Q47. What is the minimum number of tables required to perform a SQL join? Database
Ans. 1 , We can do self join
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql join Asked in 1 Companies Q48. Sort an Employee Object based on Name or Age Database
Ans. Use Comparable or Comparator interface Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql query Asked in 1 Companies Q49. Write SQL query to join 2 tables ? SQL
Ans. Select * from table1 join Select * from table2 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database Asked in 1 Companies Q50. In majority of the cases, the following join will give maximum number of results ? Reference Database
a. Inner Join b. Outer Join c. Left Join d. Right JoinAns.b. Outer Join
a. Left Join and Right Join gives equal number of Results b. Outer Join and Inner Join gives equal number of Results c. Inner Join gives maximum number of results records d. Inner Join gives minimum number of result recordsAns.d. Inner Join gives minimum number of result records