.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

What is Fact and Dimension table?

Posted By :nishithraj     Posted Date :March 29, 2010    Points :10   Category :Sql Server 
Fact Tables:
A fact table typically contains the business fact data. Examples are sales amount, sales quantity, and the number of customers and the foreign keys to dimension tables.

Dimension Tables:
A dimension table contains data that we'd like to use to group the values we are summarizing.

You can also find related Interview Question to What is Fact and Dimension table?  below: 

What is a fact table?

  
In data warehousing, a fact table consists of the measurements, metrics or facts of a business process. It is often located at the centre of a star schema (More...)

What is a dimension table?

  
Data warehouses are built using dimensional data models which consist of fact and dimension tables. Dimension tables are used to describe dimensions (More...)

What are Fact tables and Dimension Tables?

  
A fact table typically has two types of columns: those that
contain facts and those that are foreign keys to dimension
tables. facts may be composed of measures,degenerated
dimensions.The primary key of a fact table is usually a
composite key that is made up of all of its foreign keys

Dimension tables, also known as look up or reference tables,
contain the relatively static data in the warehouse.
Dimension tables store the information you normally use to
contain queries. Dimension tables are usually textual and
descriptive and you can use them as the row headers of the
result set. Examples are customers or products (More...)

What are the privileges that can be granted on a table by a user to others?

  
Insert, update, delete, select, references, index, execute, alter, all (More...)

What command is used to create a table by copying the structure of another table?

  
CREATE TABLE .. AS SELECT command

Explanation :

To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.
CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2;
If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table. (More...)

How to get a row was inserted most recently in a table?

  
select top 1 * from tablename order by ColumnName desc (More...)

How To Update Description Value for a Column in Table using SQL Command?

  
We can Update Description to Column using sp_updateextendedproperty System Store Procedure.
Sample Command to Update Description for Column in a Table:

EXEC sys.sp_updateextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName', @level2type=N'COLUMN',@level2name=N'ColumnName' (More...)

How To Delete Description Value for a Column in Table using SQL Command?

  
We can Delete Description from Column using sp_dropextendedproperty System Store Procedure.
Sample Command to Delete Description from Column in a Table:

EXEC sys.sp_dropextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName', @level2type=N'COLUMN',@level2name=N'ColumnName' (More...)

How To Get Description Value for all Column in Table using SQL Command?

  
To Get Description of Columns we need to use system function sys.fn_listextendedproperty.
Command To Get Description Data for all Columns:

SELECT * FROM fn_listextendedproperty(NULL, 'SCHEMA',
'dbo', 'TABLE', 'YourTable Name Here', 'COLUMN', NULL) (More...)

How To Get Description Value for Single Column in Table using SQL Command?

  
To Get Description of Single Column we need to use system function sys.fn_listextendedproperty. we need to pass the column Name is this case.
Command To Get Description Data for Single Columns:

SELECT * FROM fn_listextendedproperty(NULL, 'SCHEMA',
'dbo', 'TABLE', 'Table Name Here', 'COLUMN', 'Column Name Here') (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend