Session Ready
Exercise

Choosing data types representations

In this chapter, you have explored many of the data types available for use in PostgreSQL databases including text, numeric, temporal, and boolean data types. Continuing with our SBA data example, let's gain some experience determining which data types to use to best represent the data that you are interested in storing. For example, if you wanted to understand the monthly payment rates of a borrower, it would be helpful to have the loan amount and interest rate represented as numeric values to aid in such a calculation.

Your manager has asked you to create a new loan table that requires specifying the correct data type and properties to use for the table columns.

Instructions
100 XP
  • Complete the definition the loan table including an approval_date to represent the date when a loan is initially approved.

  • Set the precision for the decimal-valued gross_approval column to allow loan amounts up to $5,000,000.

  • Provide a data type to best represent the length (in months) for loan repayment using term_in_months.

  • Define the data type for the column revolver_status to be represented by values of true and false.