Wednesday, August 14, 2013

Definition of Table & Cube

Table:

         A table is an arrangement of columns and rows used to organize and position data.


Cube:
         The cube is a multidimensional data structure from which you can query for business information. You build cubes out of your fact data and the dimensions.

Above figure shows a Sales cube that was created from the fact table & dimensions. Consider the front face of the cube that shows numbers. The above cube has three dimensions: Time, Product and State.
It shows sold product information.
Each block of the cube is called a cell and is uniquely identified by a member in each dimension.
For Example, analyze the bottom –left corner cell that has the values 4,784 and $98,399. The values indicate the number of sales and sales amount. This cell refers to sales of product type of Ale in the state of Washington (WA) for July2008.
Notice that some cells do not have any value; this is because no facts are available for those cells in the fact table.


Difference between MDX and T-SQL


 MDX  Vs  T-SQL

i)                    The  ability of MDX  to reference multiple dimensions but SQL refers to only two dimensions, columns and rows when processing queries.

ii)                  In SQL, the SELECT clause is used to define the column layout for a query, while the WHERE clause is used to define the row layout. However, in MDX the SELECT clause can be used to define several axis dimensions, while the WHERE clause is used to restrict multidimensional data to a specific dimension or member.

iii)                The process of creating an SQL query is also different than that of creating an MDX query.

iv)                The visualization of an SQL result set is intuitive; the set is a two-dimensional grid of columns and rows. The visualization of an MDX result set is not as intuitive, however. Because a multidimensional result set can have more than three dimensions.

v)                  To refer to such two-dimensional data in SQL, the name of a column and the unique identification of a row, in whatever method is appropriate for the data, are used to refer to a single cell of data, called a field. However, MDX uses a very specific and uniform syntax to refer to cells of data, whether the data forms a single cell or a group of cells.