updated log_dwc with sql queries to generate dwc