Saturday 22 June 2013

Database interview questions for java programmers

1. Why do we use index?

Ans: Index are created for the faster data access. One can assume the database index as similar to the indexes found at the starting of the books. As they facilitate the faster access to the content of the books so do the DB indexes.

2. Is there any downside of creating and using indexes?

Ans: Yes, this makes the insert operation costly. Insertion becomes slow as, the index is updated every time, an insertion happens.


3. How does index work?
4. Write an sql query for deleting duplicate records
5. Write an sql query for fetching 2nd or 3rd maximum value of the records of a column of a table.
6. What are the types of index?
7. What is the difference between Statement and PreparedStatement?
8. Is PreparedStatement always faster than Statement?
9. What are clustered and non clustered indexes?
9.

No comments:

Post a Comment