Date, Number, and String Functions
Lesson 1 of 1
  1. 1

    Oftentimes, data in columns of tables is not in the exact format we need to complete our desired analysis. We may need to extract a date from a full timestamp, manipulate a number, or combine first…

  2. 2

    We’ll begin with dates. Dates are often written in the following format 1. Date: YYYY-MM-DD 2. Datetime or Timestamp: YYYY-MM-DD hh:mm:ss We can use SQL’s date functions to transform …

  3. 3

    Nice work! Now let’s assume that we have a column in our […] table named […] in the format YYYY-MM-DD hh:mm:ss. We’d like to know the number of […] manufactured by day, and not by sec…

  4. 4

    Given a datepart and a column of date or timestamp data type, we can increment date or timestamp values by a specified interval. For example, in SQLite, the statement […] Would return a tim…

  5. 5

    Great work! Numeric functions can be used to transform numbers. Some common SQLite mathematical functions are included below that take numeric data types as inputs: - […] : Returns the sum of …

  6. 6

    A couple more useful numeric SQL functions are included below: […] and […] . […] : returns the greatest value in the set of the input numeric expressions […] : returns the least valu…

  7. 7

    String manipulation can be useful to derive information from columns. We’ll cover a couple of the common string functions here. A common use case for string manipulation in SQL is concatenation o…

  8. 8

    Another useful string function in SQL is […] : […] The function returns the string […] with all occurrences of the string […] replaced by the string […] . For example in […]…

  9. 9

    Congratulations! You just learned about date, number, and string functions in SQL. What can we generalize so far? Date Functions: * […] ; Returns the date and time of the column specified. Th…