Week 3 – Cleaning data with SQL – Shuffle Q/A 1

12. Fill in the blank: _____ refers to the process of converting data from one type to another.

  • Formatting
  • Cleaning
  • Typecasting
  • Querying

13. 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?

  • LENGTH
  • TRIM
  • SUBSTR
  • CAST

14. Fill in the blank: The _____ function can be used to join strings to create a new column.

  • CAST
  • COALESCE
  • TRIM
  • CONCAT

15. As a data analyst, you are working on a quick project containing a small amount of data. As the data was emailed to you, there is no need to query the data. What tool should you use to perform your analysis?

  • Spreadsheet
  • SQL
  • word process
  • CSV

16. A data analyst has added a massive table to their database on accident and needs to remove the table. What command can the analyst use to correct their mistake?

  • DROP TABLE IF NOT EXISTS
  • INSERT INTO
  • REMOVE TABLE IF EXISTS
  • DROP TABLE IF EXISTS

17. You are working with a database table that contains invoice data. The table includes a column for customer_id. You want to remove duplicate entries for customer_id and get a count of total customers in the database.

You write the SQL query below. Add a DISTINCT clause that will remove duplicate entries from the customer_id column.

NOTE: The three dots (...) indicate where to add the clause.

What is the total number of customers in the database?

  • 84
  • 105
  • 43
  • 59

18. In SQL databases, what data type refers to a number that does not contain a decimal?

  • String
  • Integer
  • Boolean
  • Float

19. After joining multiple tables you find your data contains a significant amount of null values. What function can you use to return only the non-null values in a list ?

  • CAST
  • COALESCE
  • TRIM
  • CONCAT

20. You are working with a database table that contains customer data. The table includes columns about customer location such as city, state, and country. The state names are abbreviated. You want to retrieve the first 2 letters of each state name. You decide to use the SUBSTR function to retrieve the first 2 letters of each state name, and use the AS command to store the result in a new column called new_state.

You write the SQL query below. Add a statement to your SQL query that will retrieve the first 2 letters of each state name and store the result in a new column as new_state.

NOTE: The three dots (...) indicate where to add the statement.

NOTE: SUBSTR takes in three arguments being column, starting_index, ending_index

What customer ID number is in row 9 of your query result?

NOTE: The query index starts at 1 not 0.

  • 3
  • 55
  • 47
  • 10

Shuffle Q/A 2

21. A junior data analyst joins a new company. The analyst learns that SQL is heavily utilized within the organization. Why would the organization choose to invest in SQL? Select all that apply.

  • SQL is a programming language that can also create web apps.
  • SQL can handle huge amounts of data.
  • SQL is a powerful software program.
  • SQL is a well-known standard in the professional community.

22. You are working with a database table that contains invoice data. The table includes columns for invoice_id and billing_state. You want to remove duplicate entries for billing state and sort the results by invoice ID.

You write the SQL query below. Add a DISTINCT clause that will remove duplicate entries from the billing_state column.

NOTE: The three dots (...) indicate where to add the clause.

What billing state appears in row 17 of your query result?

NOTE: The query index starts at 1 not 0.

  • AZ
  • NV
  • CA
  • WI

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply