Wednesday, July 1, 2015

What is an index

What is an index?
An index is a data structure (most commonly a B- tree) that stores the values for a specific column in a table. An index is created on a column of a table. An index consists of column values from one table, and that those values are stored in a data structure.





What is full table scan?
Full table scan (also known as sequential scan) is a scan made on a database where each row of the table under scan is read in a sequential (serial) order and the columns encountered are checked for the validity of a condition.












What kind of data structure is an index?
B- trees are the most commonly used data structures for indexes. The reason B- trees are the most popular data structure for indexes is due to the fact that they are time efficient – because look-ups, deletions, and insertions can all be done in logarithmic time. And, another major reason B- trees are more commonly used is because the data that is stored inside the B- tree can be sorted.










Can you create a clustered index on a column with duplicate values?
Yes and no. Yes, you can create a clustered index on key columns that contain duplicate values. No, the key columns cannot remain in a non-unique state. Let me explain. If you create a non-unique clustered index on a column, the database engine adds a four-byte integer (a uniquifier) to duplicate values to ensure their uniqueness and, subsequently, to provide a way to identify each row in the clustered table.











What are the disadvantages of a hash index?
Hash tables are not sorted data structures, and there are many types of queries which hash indexes can not even help with. For instance, suppose you want to find out all of the employees who are less than 40 years old. How could you do that with a hash table index? Well, it’s not possible because a hash table is only good for looking up key value pairs – which means queries that check for equality.









Monday, June 29, 2015

Microsoft Business Intelligence (Data Tools): SQL- Difference between Temp Table and CTE

Microsoft Business Intelligence (Data Tools): SQL- Difference between Temp Table and CTE:

What's the difference between a temp table and Common Type Expression (CTE) in SQL Server? In the real practice, it depends on the...

Microsoft Business Intelligence (Data Tools): SQL - How can we convert rows to columns

Microsoft Business Intelligence (Data Tools): SQL - How can we convert rows to columns: How can we convert rows to columns in SQL? In our daily practice, we need to convert rows values into columns by using SQL. Sometimes ...

Microsoft Business Intelligence (Data Tools): SQL - How can we convert columns to Rows

Microsoft Business Intelligence (Data Tools): SQL - How can we convert columns to Rows: How can we convert columns to Rows in SQL? There are a lot of concepts to store multiple values against a single field to handle the ...

Microsoft Business Intelligence (Data Tools): SQL - Introduction of Joins

Microsoft Business Intelligence (Data Tools): SQL - Introduction of Joins: Joins are used to link one and more than two tables together to get the information from the database.  Join is the keyword which is us...

Microsoft Business Intelligence (Data Tools): SQL - Keywords, Identifiers, and Constants

Microsoft Business Intelligence (Data Tools): SQL - Keywords, Identifiers, and Constants: As we know about the sentences that they are made up of words that can be nouns, verbs, and so on. The same thing is applied for an SQL st...

Microsoft Business Intelligence (Data Tools): SQL- How to write or create the data into a file

Microsoft Business Intelligence (Data Tools): SQL- How to write or create the data into a file: There are a lots of ETL tools available to fetch the data from your database into the file. But these ETL tools are not possible for ea...