4.3.4.Weekly challenge 3 - sj50179/Google-Data-Analytics-Professional-Certificate GitHub Wiki
Weekly challenge 3
LATEST SUBMISSION GRADE 100%
Question 1
Data analysts choose SQL for which of the following reasons? Select all that apply.
- SQL is a well-known standard in the professional community
- SQL can handle huge amounts of data
SQL is a powerful software programSQL is a programming language that can also create web apps
Correct. Data analysts choose SQL because it is a well-known standard in the professional community. SQL can also handle huge amounts of data.
Question 2
In which of the following situations would a data analyst use spreadsheets instead of SQL? Select all that apply.
When using a language to interact with multiple database programs- When working with a small dataset
When working with a dataset with more than 1,000,000 rows- When visually inspecting data
Correct. An analyst would choose to use spreadsheets instead of SQL when visually inspecting data or working with a small dataset.
Question 3
A data analyst creates many new tables in their company’s database. When the project is complete, the analyst wants to remove the tables so they don’t clutter the database. What SQL commands can they use to delete the tables?
- DROP TABLE IF EXISTS
INSERT INTOCREATE TABLE IF NOT EXISTSUPDATE
Correct. The analyst can use the DROP TABLE IF EXISTS
query to delete the tables so they don’t clutter the database.
Question 4
A data analyst is cleaning customer data for an online retail company. They are working with the following section of a database:
The analyst wants to retrieve the first two letters of each state so that all the entries are consistent and only contain 2 letters. What is the correct SQL clause to retrieve the first two letters of each state?
DISTINCT(state, 1, 2)- SUBSTR(state, 1, 2)
WHERE(state, 1, 2)LENGTH(state, 1, 2)
Correct. The correct clause is SUBSTR(state, 1, 2)
*.*
Question 5
A data analyst is cleaning a dataset. They find data entries with extra spaces. What SQL function can the analyst use to eliminate the extra spaces for consistency?
SUBSTRCAST- TRIM
LENGTH
Correct. The analyst can use the TRIM
function to eliminate the extra spaces for consistency.
Question 6
In SQL databases, what data type refers to a number that contains a decimal?
IntegerBooleanString- Float
Correct. In SQL databases, the float data type refers to a number that contains a decimal.
Question 7
A data analyst is working with product sales data. They import new data into a database. The database recognizes the data for product price as text strings. What SQL function can the analyst use to convert text strings to floats?
TRIM- CAST
SUBSTRLENGTH
Correct. The analyst can use the CAST
function to convert text strings to floats.
Question 8
A data analyst is cleaning survey data. The results for an optional question contain many nulls. What function can the analyst use to eliminate the null values from the results?
CONCAT- COALESCE
CASTLENGTH
Correct. The analyst can use the COALESCE
function to eliminate the null values from the results.