'; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql   database   oracle Q21. Difference between relational databases and NoSQL databases ? Database
Ans. https://www.mongodb.com/scale/nosql-vs-relational-databases Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database management  nosql database  relational database Asked in 1 Companies   frequent Q22. With a Table employee having columns Id,Name,ManagerEmployeeId, Write a SQL to find the Manager with maximum number of employees ? Database
Ans. Select Name from EMPLOYEE where ID in (Select ManagerEmployeeId from EMPLOYEE
Group By ManagerEmployeeId
order by count(Id)
LIMIT 1) 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 Q23. What do you make out of this error
org.hibernate.exception.ConstraintViolationException: could not insert: [<Entity>]
Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (<Constraint Name>) violated
and how would you go about debugging it ? Database
Ans. Application is unable to insert a record as it violates a unique constraint.
The exception states the constraint and Table can be located by the Entity mapping. So I will go to the DB and will first check to which all columns the unique constraint applies. And then I will go and check the code and logs to see how come the duplicate column values were attempted to be inserted when they were not supposed to be. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  ConstraintViolationException  SQLIntegrityConstraintViolationException Q24. If Table A has 100 records and Table B has 50 records , how many records will the equi join of Table generate ? SQL
Ans. It depends on the join condition. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  equi join  sql join  database  sql Q25. If Table A has 100 records and Table B has 50 records , how many records will the left join of Table A with Table B generate ? SQL
Ans. 100 records Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  sql  sql joins   left join Q26. If Table A has 100 records and Table B has 50 records , how many records will the right join of Table A with Table B generate ? SQL
Ans. 50 records Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  sql  sql joins   right join Q27. If Table A has 0 records and Table B has 50 records , how many records will the equi join of Table generate ? SQL
Ans. 0 records Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  sql  sql joins   equi join Q28. Write a SQL to remove records with a duplicate field in a Table ? Database
This question was recently asked at 'Sofi'.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  sql Asked in 1 Companies Q29. How different is the Search algorithm when we query Cassandra Tables and When we query Oracle Tables ? Cassandra
Ans. Relational Database uses linear search if we don't query using indices. Performance for linear search is O(n). If indices have been used , relational database uses binary search. Performance for binary search is O(Log n).
Casandra uses hash search. Performance for Hash Search is O(1). Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cassandra vs oracle  nosql vs relational  search algorithm Q30. Which of the following databases - Cassandra / Oracle - provides more flexibility about querying the database ? Database
Ans. Oracle as it is not modeled for a particular query or set of queries. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Cassandra  Nosql database  nosql vs relational database Q31. Which is the best NoSql Database for Performance ? NoSql
Ans. Possible Answer - doument base - monogodb Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Nosql Database Q32. Write a SQL to find 2nd Max value in a Table. Database
Ans. SELECT MIN(FIELD) FROM (SELECT TOP 2 FIELD FROM TABLE ORDER BY FIELD DESC)
or
SELECT MAX(FIELD) FROM TABLE WHERE FIELD NOT IN (SELECT MAX(FIELD) FROM TABLE) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql Q33. Write a SQL to find max salary by Dept SQL
Ans. SELECT MAX(SALARY),DEPT FROM EMPLOYEE GROUP BY DEPT Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q34. Write a SQL to display all duplicate names from Employee Table SQL
Ans. SELECT * FROM EMPLOYEE A WHERE A.ROW_ID IN (SELECT MAX(ROW_ID) FROM EMPLOYEE b WHERE A.NAME = B.NAME ) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q35. Write an SQL to get Employees who are also Managers SQL
Ans. SELECT A.NAME FROM EMPLOYEE A, EMPLOYEE B WHERE A.ID = B.MANAGER_ID Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Ans. It returns all the rows form the left table and matches the rows in both tables. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database   database joins   left outer join  sql Asked in 2 Companies Ans. Oracle having following types of joins these are also called 8i joins. There are:
1. Equi (or) Inner join
2. Non Equi join
3.Self join
4.Outer join
Oracle also support the 9i (or) ANSI standard joins.There are:
1.Inner join
2.Left outer join
3.Right outer join
4.Full outer join
5.Natural join Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql joins  sql Asked in 2 Companies Q38. What are different in memory data structures that are used in No Sql Database ? NoSql Database
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   Q39. What are different types of No Sql Databases ? NoSql
Ans. graph based
column based
document based Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q40. Difference between Left and Inner Join ? SQL
This question was recently asked at 'Canopy Tax,Cogent Infotech Corp'.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  sql Asked in 2 Companies