More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. Inner join is the intersection of two tables on the condition defined by the where clause i.e will get records from both tables matched by a column.
Outer join is the union of two tables i.e will get all records from both tables and will put null in the columns where related records are not present.
Left Outer join is the left union of two tables i.e all records from the table on the left and values from the right table for related records else null for the columns from right table.
Right Outer join is the right union of two tables i.e all records from the table on the right and values from the left table for related records else null for the columns from left table.
Help us improve. Please let us know the company, where you were asked this question :
Ans. These are the tables that are created temporarily and are deleted once the Stored Procedure is complete.
For example - we may like to pull some info from a table and then do some operations on that data and then store the output in final output table. We can store the intermediary values in a temp table and once we have final output with us, we can just delete it.
Help us improve. Please let us know the company, where you were asked this question :
Ans. When a Table Join itself , it's a Self Join. For example - we like to know the pair of department names where first dept has lesser employees than the later.
Select D1.name , D2.name from Dept D1, Dept D2 where D1.employee_count < D2.employee_count
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  sql  joins  self join  self-join  Pair of employee names with first having lesser salary than later  Pair of department names where first dept has lesser employees than the later Asked in 26 Companiesbasic  frequent
Q8. Does SQL allow null values ? Can we use it within Where clause ?
Ans. Yes , we can have null values for columns in SQL. Null value represent that the columns value is unknown or haven't been filled. Yes, We can use it within where clause to get the rows with null values.
Help us improve. Please let us know the company, where you were asked this question :
Ans. In case we specify them explicitly we can have control over constraint name as otherwise they will be system generated. It provides an ease in case we plan to drop the constraint in future.
Help us improve. Please let us know the company, where you were asked this question :
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 :
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 :