-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery.txt
More file actions
39 lines (24 loc) · 1.09 KB
/
Copy pathQuery.txt
File metadata and controls
39 lines (24 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Here there are some queries for validation of the dataset and get more info about the data :
SELECT COUNT(*) FROM `retail_data_pipeline_dataset.retail_raw_data`;
SELECT
COUNTIF(Transaction_ID IS NULL) AS null_transactions,
COUNTIF(Customer_ID IS NULL) AS null_customer,
COUNTIF(Date IS NULL) AS null_date,
COUNTIF(products IS NULL) AS null_product
FROM `retail-data-pipeline-453817.retail_data_pipeline_dataset.retail_raw_data`;
SELECT
MIN(Date) AS earliest_date,
MAX(Date) AS latest_date,
FROM `retail-data-pipeline-453817.retail_data_pipeline_dataset.retail_raw_data`;
SELECT *
FROM `retail-data-pipeline-453817.retail_data_pipeline_dataset.retail_raw_data`
WHERE Date > CURRENT_DATE();
SELECT Transaction_ID,COUNT(*) AS count
FROM `retail-data-pipeline-453817.retail_data_pipeline_dataset.retail_raw_data`
GROUP BY(Transaction_ID)
HAVING count > 1;
SELECT *
FROM `retail-data-pipeline-453817.retail_data_pipeline_dataset.retail_raw_data`
WHERE Total_Purchases < 0;
SELECT DISTINCT Payment_Method
FROM `retail-data-pipeline-453817.retail_data_pipeline_dataset.retail_raw_data`;