Question: You are tasked with developing a small data warehouse for the HAFH2 company. The company is interested in keeping track of building inspections for data
You are tasked with developing a small data warehouse for the HAFH2 company. The company is interested in keeping track of building inspections for data analytics purposes.
Instructions: Write SQL code in the space provided below each question.
1) Create the following data warehouse tables in your database using SQL code (e.g. create table dw_buildingdim ...) NOTE: Use auto increment option for the dimensions key. For example, for dw_buildingDim, the SQL code starts like: buildingkey INT NOT NULL AUTO_INCREMENT
2) Create a view named buildinginfo containing columns: buildingid, bnooffloors, mfname, and mlname by inner joining building and manager tables.
3) Insert rows in the buildinginfo table into dw_buildingDim.
4) Create a view named inspectioninfo containing columns: insname, datelast, datenext, insresult and buildingkey by inner joining inspector, inspecting and dw_building tables.
5) Insert rows in the inspectioninfo table into dw_inspectionFact.
6) If you come this far without any errors, then your data warehouse is ready to test. Write a query showing all information from dw_inspectionFact and dw_buildingDim by inner joining them.
7) Insert the screenshot of the resulting output of Question-6 below.
dw_buildingDim: dw_inspectionFact
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
