Google Cloud Professional Data Engineer — Question 263
You have enabled the free integration between Firebase Analytics and Google BigQuery. Firebase now automatically creates a new table daily in BigQuery in the format app_events_YYYYMMDD. You want to query all of the tables for the past 30 days in legacy SQL. What should you do?
Answer options
- A. Use the TABLE_DATE_RANGE function
- B. Use the WHERE_PARTITIONTIME pseudo column
- C. Use WHERE date BETWEEN YYYY-MM-DD AND YYYY-MM-DD
- D. Use SELECT IF.(date >= YYYY-MM-DD AND date <= YYYY-MM-DD
Correct answer: A
Explanation
The TABLE_DATE_RANGE function allows you to easily query multiple tables that follow a consistent naming convention based on dates, making it ideal for accessing the daily tables. The other options, while related to date filtering, do not support querying multiple tables created on a daily basis in the way required for this scenario.