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. 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
Ans. Automated Backups are deleted automatically whereas Snapshots are preserved. Upon terminating RDS instance , AWS gives a warning about that and requests to create a final snapshot before terminating the instance.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It's a technique to allow multiple clients to make use of a cached set of shared and reusable connection objects providing access to a database or other resource.
Help us improve. Please let us know the company, where you were asked this question :
Q17. 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. Its a specification that guides the implementation of ORM frameworks. Implementations abiding by the specification would mean that one can be replaced with other in an application without much hassle. Only the Features that are added over the specification needs to be taken care of if any such change is made.
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. Reliability and Continuity if some of the sites goes down.Easy Scaling up and Down as sites can be added or removed without impacting business continuity.
Help us improve. Please let us know the company, where you were asked this question :
Q32. When do we generally get this database error - integrity constraint violated - parent key not found ?
Ans. This error most likely will be thrown during an insert statement, while inserting a value within a foreign key column which doesnt exist within the Parent column. For example - Trying to add a dept number reference within a Employee Table when the Dept doesnt exist in the Dept Table.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Stored procedures are a batch of SQL statements along with programming constructs ( if else, loops etc ) and stored as a single program that can be called by different clients and hence reused.
Help us improve. Please let us know the company, where you were asked this question :
Q36. There is a Table Student having Student Id, Name and Total Marks. Can you please write an SQL that will display the maximum marks obtained by a student ?
Q38. When do we generally get the database error - Unique Constraint Violated ?
Ans. This error can result either on an insert, update or delete when any change in data results in duplicate record or subset of it having unique constraint on record or its subset. For example - If we have a unique constraint on a combination of columns and then trying to insert duplicate column values.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Audit Tables generally stores Raw information to be reviewed in case of problems or determining impact. If Database space is an issue , and the audit information is rarely retrieved, one design could be to use compressed file system.
Help us improve. Please let us know the company, where you were asked this question :
Ans. When a DML is executed, the changes only stays in session and still not pushed to DB Tables, Commit is used to push those changes to the Tables.
In case we realize that we don't want to commit those changes and would like to ignore them, we can use rollback.
For example - You may like that for a banking transaction you would like to update the account balance only if the debit or credit record was correctly inserted, so you may like to encapsulate both DML's - insert for transaction and update for balance in a single transaction and would only commit if both succeeds else rollback.
Help us improve. Please let us know the company, where you were asked this question :