Home Forums Data Warehousing Analysis Services How to Define a schema for the fact table, and the dimensional tables in SQL from a relational schema? RE: How to Define a schema for the fact table, and the dimensional tables in SQL from a relational schema?

  • OK, but now your grain of the fact table (meaning the lowest level at which you can analyze) is at the course level. Typically you would choose the lowest level possible.

    For example, for a store selling bikes, you would want to store the sales per day, not per month. If you would store them by month, you would never be able to analyze data at the day or week level.

    In your case, you would not be able to analyze your data at the student level. Your fact table would not be able to answer your questions like these:

    * How many male students are enrolled for that course?

    * How many students of the age group between 20-25 are enrolled for that course?

    * Show me the different cities where the students come from.

    * ...

    So I would add a student dimension and a studentID in your fact table. Now you would have to aggregate data to get the number of students for a course, but that's OK. That's what we have cubes for 🙂

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP