0% found this document useful (0 votes)
8 views12 pages

Consumersticket

The document contains a series of SQL queries related to user data, service points, building usage, and billing information for a specific user identified by the login '100000177814'. It highlights various data retrievals, including user details, service point associations, building gas usage, and analysis data, with notes on missing data for specific months in 2022 and 2023. The queries are structured to extract and group data for analysis purposes, focusing on energy and billing metrics.

Uploaded by

parveenkatyal559
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views12 pages

Consumersticket

The document contains a series of SQL queries related to user data, service points, building usage, and billing information for a specific user identified by the login '100000177814'. It highlights various data retrievals, including user details, service point associations, building gas usage, and analysis data, with notes on missing data for specific months in 2022 and 2023. The queries are structured to extract and group data for analysis purposes, focusing on energy and billing metrics.

Uploaded by

parveenkatyal559
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 12

select * from user where login = '100000177814'

user id : 37c88384-7690-11eb-9cbd-12931c34f955

select * from user_service_point where user_id = '37c88384-7690-11eb-9cbd-


12931c34f955'
service_point _id = a3bb31f1-7665-11eb-9cbd-12931c34f955
service_point _id_2 = a34eb234-7665-11eb-9cbd-12931c34f955

select * from building_service_points where service_point_id in ('a3bb31f1-7665-


11eb-9cbd-12931c34f955', 'a34eb234-7665-11eb-9cbd-12931c34f955')
building id = '0a065ca5-3773-4bbf-a1ac-8a520dab6ddf '
building_Service_point_id : 4f807a26-a888-4c17-b0a9-3486a58ee5cb
building_Service_point_id : e3c34540-d3c0-4cbd-bb98-2435a8273e8c

select * from service_points where id = '099488ea-79e4-4510-99f7-c234f01e5329'


sp_usage_point : 5000011271
sp_usage_point_2 : 5003636130
bill_id :

SELECT * FROM `consumers`.`analysis` where building_id = '0a065ca5-3773-4bbf-


a1ac-8a520dab6ddf'
analysis_id : 740c798c-e3d8-48f4-8931-c3c72f5f4ad5

SELECT * FROM `consumers`.`interval_data` where meter_id in


('214fb997-489c-48b0-8084-89ef8c3ef8f7','b0730399-c18a-4186-b61a-54fa550afffc')
and usage_date like '%2023%' group by month(usage_date)
- getting data

select year(usage_date), month(usage_date), meter_id,


min(usage_date),max(usage_date) from processed_interval_data where analysis_id
='740c798c-e3d8-48f4-8931-c3c72f5f4ad5'
group by year(usage_date), month(usage_date), meter_id ;
- getting data

SELECT * FROM `consumers`.`merged_monthly_energy_data` where analysis_id =


'740c798c-e3d8-48f4-8931-c3c72f5f4ad5' and start_date like '%2023%'
-getting data - only 0 need data for 1 too

SELECT *
FROM `consumers`.`building_gas_usage` where meter_id in
('214fb997-489c-48b0-8084-89ef8c3ef8f7','b0730399-c18a-4186-b61a-54fa550afffc')
GROUP BY year(start_date), month(start_date), meter_id ;
- no data
SELECT * FROM `consumers`.`rats_raw_data` where analysis_id ='740c798c-e3d8-
48f4-8931-c3c72f5f4ad5' GROUP BY year(day), month(day);
- getting data

meter_id_1 : 214fb997-489c-48b0-8084-89ef8c3ef8f7
meter_id_2 : b0730399-c18a-4186-b61a-54fa550afffc

SELECT analysis_id, bill_item_def_id, cost, display_month, start_date, end_date,


unit_price FROM `consumers`.`merged_bill_items_data` where analysis_id =
'740c798c-e3d8-48f4-8931-c3c72f5f4ad5' and display_month like '%2022%'
- 4, 5, nd 8 missing

SELECT * FROM `consumers`.`merged_interval_data` where analysis_id = '740c798c-


e3d8-48f4-8931-c3c72f5f4ad5' and usage_date like '%2022%' group by
month(usage_date)
-getting data

imporved - SELECT analysis_id, id, is_used_for_analysis, usage_date, year FROM


`consumers`.`merged_interval_data` where analysis_id = '740c798c-e3d8-48f4-8931-
c3c72f5f4ad5' and usage_date like '%2022%' group by month(usage_date)
-getting data

SELECT * FROM `consumers`.`bill_statements` where user_id = '37c88384-7690-11eb-


9cbd-12931c34f955' and statement_date like '%2023%'
- getting data except for april

SELECT bill_id, bill_item_def_id, display_month, start_date, end_date FROM


`consumers`.`sdp_bill_items` where service_point_id in ('a3bb31f1-7665-11eb-
9cbd-12931c34f955', 'a34eb234-7665-11eb-9cbd-12931c34f955') and display_month
like '%2022%' group by bill_id
- 4, 5, 8, 12 missing

SELECT * FROM `datalake-prd-rotw-0727.consumers.ff_sdpaccitem` where ec_username


= '100000177814' and display_month like "%2022%";
- 4, 5, 8, 12 missing, data present in Feb'23

SELECT * FROM `datalake-prd-rotw-0727.consumers.bill_header_baseline` where


Contract_Account = '100000177814' and Billing_Period like "%2022%";
- 4 missing

SELECT * FROM `datalake-prd-rotw-0727.consumers.ff_bill` where ec_username =


'100000177814' and statement_date like "%2022%";
- 4 missing

You might also like