Database/SQL Interview Questions

How will you search for a word in a very large database ? 1. First the group of related files are stored in different bucket using hashing . Then in particular bucket we sort the files using some sorting method if the files are not in alphabetical order . 2. Now comes the searching part . Using hash function we can reach to bucket in O(1) time. 3. As we have already sorted the files in particular bucket so we will apply binary search to reach to exact file. Binary Search will take O(logn) time . Then in the file we can apply different searching algorithm to reach to the word . Explain the database to your 5 year old child in three sentence. 1. It is like shelf in which you put your toys with number of drawer for different kind of toys. for eg for green toys you put them in drawer no 1 and to the red toys you put them in drawer no .2. 2. Every drawer has a name slip on it like green ,yellow etc so that you can easily search different color toy. 3.Your self has ...