--check the column data type without clicking the data:
SELECT * FROM `project_id1.Dataschema1.INFORMATION_SCHEMA.COLUMNS
WHERE table_name="table_name_c";
#use Bigquery API select statement via unnest for record row:
SELECT *
FROM `firebase-public-project.analytics_153293282.events_20180915`
WHERE event_name = "level_complete_quickplay"
LIMIT 10
#You might get error: cannot access field key on a value with type
SELECT event_name, param
FROM `firebase-public-project.analytics_153293282.events_20180915`,
UNNEST(event_params) AS param
WHERE event_name = "level_complete_quickplay"
AND param.key = "value"
SELECT event_name, param.value.int_value AS score
FROM `firebase-public-project.analytics_153293282.events_20180915`,
UNNEST(event_params) AS param
WHERE event_name = "level_complete_quickplay"
AND param.key = "value"
drop table if exists `project_id1.Dataschema1.table_name1`;
create table `project_id1.Dataschema1.table_name1`
as select distinct var1,var2
from `project_id1.Dataschema1.table_name_a` as a
inner join `project_id1.Dataschema1.table_name_b` as trans
on cast(LPAD(cast(a.cntycd as string), 5, '0') as string)=trans.cntycd ;
--paddle/replace with leading 0 in a string.
Slow and Steady Wins the Final!
(1+0.1%) ^ 365 = 1.44
(1+1%) ^ 365 = 37.78
Monday, February 1, 2021
GCP Study notes: Biquery API SQL examples
In case if you are using GCP bigquery to prepare dataset, here are some examples:
Subscribe to:
Post Comments (Atom)
Data Science Study Notes: reinforcement learning
Terminology: State vs Action vs Policy vs Reward vs State Transition. Policy function is probabality density function(PDF), policy network:...


-
How do we install packages in python? How do we send emails in python? How do we load/output csv file in/to Pytyon How do we output impo...
-
Welcome to Statistics world! Here are the lecture notes we are commonly used. Download Lecture Notes and Homework Lecture01: Introdu...
-
• Study notes 1: Python general, dataframe, SQL, Plot How do we install packages in python? How do we send emails in python? How d...

No comments:
Post a Comment