Interview Questions and Answers for 'Database' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Rating

   next 30
 Q31. How do you fetch the records form database ?Database
Ans. To fetch records from a database, you would use SELECT statements

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q32. Describe SQL JoinsDatabase
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


 Q33. How is RDBMS different from DBMS ?Database
 This question was recently asked at 'LumenData'.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  rdbms  dbms  dbms vs rdbms     Asked in 1 Companies      basic


 Q34. What is Left Outer Join ?Database
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


 Q35. What is difference between clustered and non clustered index?Database
Ans. The clustered index determines how the data is stored in the rows of a table.The non-clustered index stores the data at a single place and the indexes are stored at another place.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     clustered vs non clustered index  index  database index     Asked in 1 Companies


 Q36. How does relational database facilitates read optimization ?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     database  rdbms  read optimization


 Q37. Does relational database facilitate read or write optimization while storing information ?database
Ans. Usually Relational Databases are optimized for writing. Some exception being usage of indices where indices needs to be updated after insertion and eventually helps with Log(n) reading time.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     read optimization  rdbms  relational database


 Q38. What is read and write optimization in relation to databases ? Which database facilitates read optimization and which facilitates write optimization ?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     read optimization   write optimization


 Q39. 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


 Q40. Design a Database Schema to store Employee Information with each employee having multiple addresses. Database
Ans. We can have 2 entities i.e EMPLOYEE and ADDRESS and can have a relationship Table , EMPLOYEE_ADDRESS having one to may relationship between the two.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     database schema   design     Asked in 2 Companies


 Q41. 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


 Q42. 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


 Q43. Which of the two Normalization / Denormalization facilitate better performance ? Which of the two facilitate better space management ?Database
Ans. DeNormalization facilitate better performance. Normalization remove data duplication and hence facilitate better database space management.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     normalization  denormalization  normalization vs denormalization


 Q44. Difference between Normalization and Denormalization ? Database
Ans. Normalization is the process of splitting one Table into multiple so as to avoid Data duplication whereas Denormalization is the process of reducing Tables that creates data duplication but would remove joins in the queries.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     normalization  denormalization  normaization vs denormalization     Asked in 1 Companies


 Q45. How Cassandra provides better Read performance than Oracle Indices ?Database
Ans. Cassandra uses Hash Search which provides a look time of O(1) whereas Oracle Indices uses Binary Search that provide a lookup time of O(Log n).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     cassandra  hash search  hash search vs binary search


 Q46. 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


 Q47. What is ORM or Object Relationship Mapping ?Database
Ans. ORM is the mapping technique, which maps object with relational data model. As we know that in java we need objects we can not user data in relational(in table form). So ORM is set of guideline which allows us to map relational data model in object form.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     orm     Asked in 1 Companies        frequent


 Q48. 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


 Q49. 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


 Q50. 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


 Q51. 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


 Q52. What is the difference between JDBC, Hibernate and ODBC ?Database
 This question was recently asked at 'Oracle Argentina'.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     jdbc  odbc  hibernate  jdbc vc odbc  jdbc vs hibernate     Asked in 1 Companies


 Q53. What is a ternary operator ?Database
Ans. Ternary operator , also called conditional operator is used to decide which value to assign to a variable based on a Boolean value evaluation. It is used as

condition ? value1 : value2

For example

int y = (x > 0) ? x:0; // assign x if it's greater than 0, else assign 0

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     operator  ternary operator      Basic


 Q54. What is the order in which triggers gets fired ?Database
Ans. There is no specific order in which database fires the triggers if they are for the same operation. If we need to have a specific order for their execution, we should have them all in a stored procedure and the procedure should get executed upon the event.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oracle  database  triggers  sequence of trigger execution  sequence in which triggers gets fired     Asked in 1 Companies


 Q55. What is the difference between Oracle , Cassandra and Redis ?Database
Ans. Oracle is a relational database. Cassandra is a noSQL Database whereas Redis is an inmemory cache.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oracle  casandra  redis


 Q56. Where does database stored procedures gets stored ?Database
 This question was recently asked at 'iNautix Technologies'.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          Asked in 1 Companies


 Q57. which one do you prefer - JDBC or Hibernate ?Database
 This question was recently asked at 'Captech'.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          Asked in 1 Companies


 Q58. Write a SQL to delete duplicate records in a tableDatabase
Ans. DELETE FROM TABLE WHERE ROW_NUM NOT IN ( SELECT MAX(ROW_ID) FROM TABLE GROUP BY DUPLICATE_FIELD )

or

DELETE FROM TABLE a WHERE ROW_ID >(SELECT MIN(ROW_ID FROM TABLE b WHERE a.DUPLICATE_FIELD=b.DUPLICATE_FIELD);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 3 Companies


 Q59. What is an optimistic locking ?Database
Ans. It's the way for synchronization wherein we can store version information in the table , so that if the same entity is updated by two transactions, the last to commit changes is informed of the conflict, and does not override the other transaction's work.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     locking  optimistic locking  Synchronization


 Q60. What is the relation between Primary Key, Unique and Not Null constraint ?Database
Ans. Primary Key constraint means that the column(s) should be unique and doesn't allow null. So Primary key constraint implies unique and not null constraint too.

Unique constraint implies not null constraint too as allowing null would violate uniqueness on those columns.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     database constraint


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: