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

45. You are working with a database table named invoice that contains invoice data. The table includes columns for customer_id and total. You want to remove duplicate customers and identify which unique customers have a total greater than 5.

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 customer_id number is located in row 5?

NOTE: The query index starts at 1 not 0.

  • 57
  • 14
  • 52
  • 4

46. You are working with a database table named customer that contains customer data. The table includes columns about customer location such as city, state, country, and postal_code. You want to check what country names are greater than 7 characters.

You write the SQL query below. Add a LENGTH function that will return any country names that are greater than 7 characters long.

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

What is the value of postal_code in row 1 of your query result? (Hint: you will have to scroll to the right with your mouse or track pad to locate the indicated column.)

NOTE: The query index starts at 1 not 0.

  • 14700
  • None
  • 2010
  • N1 5LH

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply