-
Notifications
You must be signed in to change notification settings - Fork 0
/
1. Data Combining
51 lines (43 loc) · 1.29 KB
/
1. Data Combining
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
37
38
39
40
41
42
43
44
45
46
47
48
49
-- Data Combining.
-- Combining the tripdata of all 12 months of the year 2023.
CREATE TABLE IF NOT EXISTS `lofty-fort-427707-j0.cyclistic_data.2023_combined_data` AS (
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202301_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202302_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202303_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202304_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202305_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202306_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202307_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202308_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202309_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202310_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202311_tripdata`
UNION ALL
SELECT *
FROM `lofty-fort-427707-j0.cyclistic_data.202312_tripdata`
);
-- checking no of rows which are 5667717
SELECT COUNT(*)
FROM `lofty-fort-427707-j0.cyclistic_data.2023_combined_data`;
-- End of script