exam questions

Exam DP-500 All Questions

View all questions & answers for the DP-500 exam

Exam DP-500 topic 1 question 46 discussion

Actual exam question from Microsoft's DP-500
Question #: 46
Topic #: 1
[All DP-500 Questions]

HOTSPOT -
You have an Azure Synapse Analytics serverless SQL pool and an Azure Data Lake Storage Gen2 account.
You need to query all the files in the ‘csv/taxi/’ folder and all its subfolders. All the files are in CSV format and have a header row.
How should you complete the query? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Az301301X
Highly Voted 2 years, 6 months ago
it says: query all folders and subfolders, hence /** . https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/query-folders-multiple-csv-files#traverse-folders-recursively
upvoted 18 times
...
eekman
Highly Voted 2 years, 4 months ago
Correct answer is BULK 'csv/taxi/**' : although 'csv/taxi/*.csv' also works (tested it), the file extension is not specified. It can be the case that the files are .txt files but still in CSV format. and FIRSTROW=2: you need to skip the headers (tested it). FIRSTROW=1 is the default value and will return the data including the headers.
upvoted 15 times
DarioReymago
2 years, 2 months ago
thats correct
upvoted 1 times
...
...
Eltooth
Most Recent 1 year, 12 months ago
BULK 'csv/taxi/**' FIRSTROW=2
upvoted 4 times
...
cookiemonster42
2 years, 5 months ago
1) https://mydatalake.blob.core.windows.net/data/files/**: All files in the files folder, and recursively its subfolders. 2) FIRSTROW=1 The FIRSTROW attribute isn't intended to skip column headers. Skipping headers isn't supported by the BULK INSERT statement. If you choose to skip rows, the SQL Server Database Engine looks only at the field terminators, and doesn't validate the data in the fields of skipped rows. https://learn.microsoft.com/en-us/training/modules/query-data-lake-using-azure-synapse-serverless-sql-pools/3-query-files https://learn.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql?view=sql-server-ver16
upvoted 3 times
cookiemonster42
2 years, 4 months ago
Sorry pals, I'd like to change my opinion, there's no FIRST ROW = TRUE in the code, so the FIRSTROW = 2 in this particular case
upvoted 1 times
cookiemonster42
2 years, 4 months ago
Sorry again, no HEADER = TRUE
upvoted 1 times
...
...
...
MrXBasit
2 years, 5 months ago
Serverless SQL pool can recursively traverse folders if you specify /** at the end of path. The following query will read all files from all folders and subfolders located in the csv/taxi folder. The answer is correct.
upvoted 2 times
ivanb94
2 years, 5 months ago
How can it be correct when the given solution does not have /** at the end? You probably meant to say that the solution with /** is correct. I agree, obviously.
upvoted 3 times
...
...
cherious
2 years, 5 months ago
The answer is correct: https://mydatalake.blob.core.windows.net/data/files/file*.csv: All .csv files in the files folder with names that start with "file". Source: https://learn.microsoft.com/en-us/training/modules/query-data-lake-using-azure-synapse-serverless-sql-pools/3-query-files And it should be FIRSTROW = 2, because it has headers. In the example (follow the link below), you can see that when the file has now header then FIRSTROW = 1. Source: https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/develop-openrowset#read-specific-columns-from-csv-file In Source
upvoted 2 times
...
nbagchi
2 years, 6 months ago
Correct answer is BULK 'csv/taxi/**' and FIRSTROW=1
upvoted 3 times
ABHI2023
2 years, 6 months ago
FIRSTROW=2 , as first row is header , Reference : https://learn.microsoft.com/en-us/training/modules/query-data-lake-using-azure-synapse-serverless-sql-pools/3-query-files?ns-enrollment-type=learningpath&ns-enrollment-id=learn.wwl.model-query-explore-data-for-azure-synapse
upvoted 5 times
...
Az301301X
2 years, 6 months ago
FIRSTROW=2, remember the "headers".
upvoted 8 times
...
...
AT96
2 years, 6 months ago
Correct answer is BULK 'adl://<your_adls_account_name>.dfs.core.windows.net/csv/taxi/',
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...