## **How to use Fact and Lookup Tables in your Forms** ## [Back to table of Contents](sidebar.md) 1. As one of the unique feature of Quickform framwork is that it enables mobile form connection with Star schema database. This tutorial is in continuity with previous tutorial in which we were getting javascript error log in form.html page. Now we will rectify that error by implementing supporting FACT and lookup tables which are basic building blocks of a Star Schema database modelling. 2. **Fact table** are used to store form data and Lookup tables are being used for **drop down** selection (Gender, City). We continue from our last simpleform db. Execute this [SCRIPT](https://quickforms3.googlecode.com/svn/QF3%20Apps/palis3/test/SimpleFormFactLookup.sql) in MS SQL SERVER and also add Kimbals date dimension table from [here](https://www.google.ca/webhp?sourceid=chrome-instant&rlz=1C1CHMO_en-GBCA586CA586&ion=1&espv=2&es_th=1&ie=UTF-8#q=kimball+date+dimension). Rename your date dimension to LKUP\_date .Make sure to make fulldate colum in date dimension table Primary key. Add foriegn key constraint of Reservationdate in FACT\_reservation table with fulldate in date column in LKUP\_date. Note: You will have to change fulldate column to not null before making it Primary Key. **Star schema diagram will look like this ![https://quickforms3.googlecode.com/svn/images/ReservationFormDBDiagram.png](https://quickforms3.googlecode.com/svn/images/ReservationFormDBDiagram.png)** **In your forms.html add the following code ```