Professional Data Engineer Exam QuestionsBrowse all questions from this exam

Professional Data Engineer Exam - Question 9


Your company is using WILDCARD tables to query data across multiple tables with similar names. The SQL statement is currently failing with the following error:

Which table name will make the SQL statement work correctly?

Show Answer
Correct Answer: BD

D

Reference:

https://cloud.google.com/bigquery/docs/wildcard-tables

Discussion

16 comments
Sign in to comment
Ender_HOption: B
Sep 23, 2022

None, the actual `bigquery-public-data.noaa_gsod.gsod*` with back ticks at the beginning and at the end.

Jasar
Nov 10, 2022

yes it was the same , i hope im the real test we dont face any wrrors like that

Davijde13
Jan 15, 2023

I suspect there has been some typo with copy-paste of the option D

jitvimol
Dec 27, 2023

yes, I see from another source that actually ans D has to be backtick. Probably a problem when this web do data ingestion.

ABKR1300Option: D
May 6, 2024

Few might go with the Option B which will be a blunder because of the below reason. While querying the tables or views with the name, it is optional to surround with the backticks. But while querying the list of tables with Wild card character, it is must to surround with the backticks. We can get the Syntax error: Expected end of input but got "*" with the below query SELECT * FROM bigquery-public-data.noaa_gsod.gsod* WHERE _TABLE_SUFFIX = "2024" So, option D might be the correct one, provided if there is a typo.

PavaanOption: D
May 12, 2023

Answer is 'D' Reference : https://cloud.google.com/bigquery/docs/wildcard-table-reference Enclose table names with wildcards in backticks The wildcard table name contains the special character (*), which means that you must enclose the wildcard table name in backtick (`) characters.

dsyounessOption: B
May 21, 2024

bigquery-public-data.noaa_gsod.gsod* also works

AWSandeepOption: D
Sep 3, 2022

D. 'bigquery-public-data.noaa_gsod.gsod*`

priluftOption: D
Sep 6, 2022

D. 'bigquery-public-data.noaa_gsod.gsod*`

MelamposOption: B
Apr 26, 2023

bigquery-public-data.noaa_gsod.gsod* works

ZosbyOption: D
Feb 23, 2023

D is correct

hkhnhanOption: B
Mar 20, 2023

should be B, the backtick at D answer is wrong ' instead of `

hkhnhanOption: B
Mar 20, 2023

should be B, the backtick at D answer is wrong ' instead of `

vaga1Option: D
May 19, 2023

let's forget the fact that in BQ is used ` instead than ' which retrieves an error in any case. ` is called backquote, backtick, or left quote while ' is simply an apostrophe. Let's consider ' to be ` in every answer, since moderators could have not been aware of such when they had received the question.

vaga1
May 19, 2023

Who used BQ knows that the backquote is necessary only for the project name, while it can be used for the whole string, and necessary only when the project name contains special (special in this specific context) characters. - is a special character. so `bigquery-public-data`.noaa_gsod.gsod1940 would have worked too. The question now turns out to be `bigquery-public-data`.noaa_gsod.gsod* still works or due to the * presence we need to write `bigquery-public-data.noaa_gsod.gsod*` ? I personally do not remember, and I do not have a BQ at my disposal at the moment. But I know for sure that `bigquery-public-data.noaa_gsod.gsod*` works while `bigquery-public-data`.noaa_gsod.gsod* is not in the options.

rtcpostOption: D
Oct 22, 2023

Option D (assuming to have backticks) Refer: https://cloud.google.com/bigquery/docs/querying-wildcard-tables The following query is NOT valid because it isn't properly quoted with backticks: ``` #standardSQL /* Syntax error: Expected end of statement but got "-" at [4:11] */ SELECT max FROM # missing backticks bigquery-public-data.noaa_gsod.gsod* WHERE max != 9999.9 # code for missing data AND _TABLE_SUFFIX = '1929' ORDER BY max DESC ```

axantroffOption: D
Oct 29, 2023

D. 'bigquery-public-data.noaa_gsod.gsod*` is the right answer with 1 typo

RT_GOption: D
Nov 7, 2023

Agree with others - Option D

RT_GOption: D
Nov 7, 2023

Reference: https://cloud.google.com/bigquery/docs/querying-wildcard-tables The wildcard table name contains the special character (*), which means that you must enclose the wildcard table name in backtick (`) characters. For example, the following query is valid because it uses backticks: #standardSQL /* Valid SQL query */ SELECT max FROM `bigquery-public-data.noaa_gsod.gsod*` WHERE max != 9999.9 # code for missing data AND _TABLE_SUFFIX = '1929' ORDER BY max DESC

Chintu_573Option: B
Jun 25, 2024

IN option D, there is differert ' ` on first and last. That's why right option is second.