1. Learn
  2. /
  3. Courses
  4. /
  5. Exploratory Data Analysis in SQL

Connected

Exercise

Truncate

Use trunc() to examine the distributions of attributes of the Fortune 500 companies.

Remember that trunc() truncates numbers by replacing lower place value digits with zeros:

trunc(value_to_truncate, places_to_truncate)

Negative values for places_to_truncate indicate digits to the left of the decimal to replace, while positive values indicate digits to the right of the decimal to keep.

Instructions 1/2

undefined XP
  • 1
    • Use trunc() to truncate employees to the 100,000s (5 zeros).
    • Count the number of observations with each truncated value.
  • 2
    • Repeat step 1 for companies with < 100,000 employees (most common).
    • This time, truncate employees to the 10,000s place.